Using and Administering

dependency

Specifies the dependencies between job steps. A job dependency, if used in a given job step, must be explicitly specified for that step.

The syntax is:

dependency = expression

where the syntax for the expression is:

step_name operator
value

where step_name (as described in step_name) must be a previously defined job step and operator can be one of the following:

==
equal to
!=
not equal to
<=
less than or equal to
>=
greater than or equal to
<
less than
>
greater than
&&
and
||
or

The value is usually a number which specifies the job return code to which the step_name is set. It can also be one of the following LoadLeveler defined job step return codes:

CC_NOTRUN
The return code set by LoadLeveler for a job step which is not run because the dependency is not met. The value of CC_NOTRUN is 1002.

CC_REMOVED
The return code set by LoadLeveler for a job step which is removed from the system (because, for example, llcancel was issued against the job step). The value of CC_REMOVED is 1001.

Examples: The following are examples of dependency statements:

Example 1: In the following example, the step that contains this dependency statement will run if the return code from step 1 is zero:

dependency = (step1 == 0)

Example 2: In the following example, step1 will run with the executable called myprogram1. Step2 will run only if LoadLeveler removes step1 from the system. If step2 does run, the executable called myprogram2 gets run.

# Beginning of step1
# @ step_name = step1
# @ executable = myprogram1
# @ ...
# @ queue
# Beginning of step2
# @ step_name = step2
# @ dependency = step1 == CC_REMOVED
# @ executable = myprogram2
# @ ...
# @ queue

Example 3: In the following example, step1 will run with the executable called myprogram1. Step2 will run if the return code of step1 equals zero. If the return code of step1 does not equal zero, step2 does not get executed. If step2 is not run, the dependency statement in step3 gets evaluated and it is determined that step2 did not run. Therefore, myprogram3 gets executed.

# Beginning of step1
# @ step_name = step1
# @ executable = myprogram1
# @ ...
# @ queue
# Beginning of step2
# @ step_name = step2
# @ dependency = step1 == 0
# @ executable = myprogram2
# @ ...
# @ queue
# Beginning of step3
# @ step_name = step3
# @ dependency = step2 == CC_NOTRUN
# @ executable = myprogram3
# @ ...
# @ queue

Example 4: In the following example, the step that contains step2 returns a non-negative value if successful. This step should take into account the fact that LoadLeveler uses a value of 1001 for CC_REMOVED and 1002 for CC_NOTRUN. This is done with the following dependency statement:

dependency = (step2 >= 0) && (step2 < CC_REMOVED)


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]