Platform LSF Administration Guide Version 6.2

Job Dependency Scheduling
Administering Platform LSF
376
Job Dependency Scheduling
About job dependency scheduling
Sometimes, whether a job should start depends on the result of another job. For
example, a series of jobs could process input data, run a simulation, generate images
based on the simulation output, and finally, record the images on a high-resolution film
output device. Each step can only be performed after the previous step finishes
successfully, and all subsequent steps must be aborted if any step fails.
Some jobs may not be considered complete until some post-job processing is
performed. For example, a job may need to exit from a post-execution job script, clean
up job files, or transfer job output after the job completes.
In LSF, any job can be dependent on other LSF jobs. When you submit a job, you use
bsub -w to specify a dependency expression, usually based on the job states of
preceding jobs.
LSF will not place your job unless this dependency expression evaluates to TRUE. If you
specify a dependency on a job that LSF cannot find (such as a job that has not yet been
submitted), your job submission fails.
Specifying a job dependency
To specify job dependencies, use bsub -w to specify a dependency expression for the
job.
Syntax
bsub -w '
dependency_expression'
The dependency expression is a logical expression composed of one or more
dependency conditions. For syntax of individual dependency conditions, see
Dependency Conditions” on page 378.
To make dependency expression of multiple conditions, use the following logical
operators:
&& (AND)
|| (OR)
! (NOT)
Use parentheses to indicate the order of operations, if necessary.
Enclose the dependency expression in single quotes (') to prevent the shell from
interpreting special characters (space, any logic operator, or parentheses). If you use
single quotes for the dependency expression, use double quotes for quoted items
within it, such as job names.
Job names specify only your own jobs, unless you are an LSF administrator.
Use double quotes (") around job names that begin with a number.
In Windows, enclose the dependency expression in double quotes (") when the
expression contains a space. For example:
bsub -w "exit(678, 0)" requires double quotes in Windows.
bsub -w 'exit(678,0)' can use single quotes in Windows.