You are here: 9 General Job Administration > Job Dependencies

9.5 Job Dependencies

9.5.1 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.

Use the -l depend=<STRING> flag for the Torque qsub command and the Moab msub command.

Torque qsub also supports the -W x=depend=<STRING> or -W depend=<STRING> flag. Moab msub command also supports the -W x=depend=<STRING> flag.

For other resource managers, consult the resource manager specific documentation.

9.5.1.A 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*, synccount, and syncwith 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.

When you submit a dependency job and the dependency is not met, the job will remain idle in the queue indefinitely. To configure Moab to automatically cancel these failed dependency jobs, set the CANCELFAILEDDEPENDENCYJOBS scheduler flag. Moab also lets you cancel all jobs that a specified <job_id> depends on using mjobctl -c flags=follow-dependency <job_id>.

Related Topics 

© 2016 Adaptive Computing