Conventions

10.5 Job Dependencies

10.5-A Basic Job Dependency Support

By default, basic single step job dependencies are supported through completed/failed step evaluation. Basic dependency support does not require special configuration and is activated by default. Dependent jobs are only supported through a resource manager and therefore submission methods depend upon the specific resource manager being used. For the TORQUE qsub command, the semantics listed in the section below can be used with the -W x=depend=<STRING> or -W depend=<STRING> flag; for the Moab msub command, the -l depend=<STRING> or -W x=depend=<STRING> flag. For other resource managers, consult the resource manager specific documentation.

Job Dependency Syntax

Dependency Format Description
after after:<job>[:<job>]... Job may start at any time after specified jobs have started execution.
afterany afterany:<job>[:<job>]... Job may start at any time after all specified jobs have completed regardless of completion status.
afterok afterok:<job>[:<job>]... Job may be start at any time after all specified jobs have successfully completed.
afternotok afternotok:<job>[:<job>]... Job may start at any time after all specified jobs have completed unsuccessfully.
before before:<job>[:<job>]... Job may start at any time before specified jobs have started execution.
beforeany beforeany:<job>[:<job>]... Job may start at any time before all specified jobs have completed regardless of completion status.
beforeok beforeok:<job>[:<job>]... Job may start at any time before all specified jobs have successfully completed.
beforenotok beforenotok:<job>[:<job>]... Job may start at any time before any specified jobs have completed unsuccessfully.
on on:<count> Job may start after <count> dependencies on other jobs have been satisfied.
synccount synccount:<count> Job is the first in a set of jobs to be executed at the same time. <count> is the number of additional jobs in the set, which can be up to 5. synccount is valid for single-request jobs with TORQUE as the resource manager.
syncwith syncwith:<job> Job is an additional member of a set of jobs to be executed at the same time. Moab supports up to 5 jobs. syncwith is valid for single-request jobs with TORQUE as the resource manager.

<job>={JOBNAME.jobname|jobid}

When using JobName dependencies, prepend "JOBNAME." to avoid ambiguity.

The before dependencies do not work with jobs submitted with msub; they work only with qsub.

Any of the dependencies containing before must be used in conjunction with the on dependency. So, if job A must run before job B, job B must be submitted with depend=on:1, as well as job A having depend=before:A. This means job B cannot run until one dependency of another job on job B has been fulfilled. This prevents job B from running until job A can be successfully submitted.

Related topics