Using the MOAB Workload Manager - Job Dependencies
Article Index
Using the MOAB Workload Manager
Basic MOAB Script
MOAB Serial Job
Running an interactive job
Running an MPI job
MOAB MPICH2 Job
MOAB OpenMPI Job
MOAB MPICH1 Job
Job Dependencies
MOAB Queues
All Pages

Job Dependencies

One can indicate a dependency between two or more jobs by using the -W x=depend:dependency-type:jobid flag for the msub commando. For example to tell moab that job2.sh can only run after job1.sh successfully finishes, one can use:

$ msub job1.sh
12345

$ msub -W x=depend:afterok:12345 job2.sh
12346

This will queue job1.sh with a jobid of 12345, queue job2.sh with jobid 12346 and indicate moab that job2.sh has to wait until job1.sh has finished.

Dependency types

Dependency Format Description
after after:[:]... Job may start at any time after specified jobs have started execution.
afterany afterany:[:]... Job may start at any time after all specified jobs have completed regardless of completion status.
afterok afterok:[:]... Job may be start at any time after all specified jobs have successfully completed.
afternotok afternotok:[:]... Job may start at any time after any specified jobs have completed unsuccessfully.
before before:[:]... Job may start at any time before specified jobs have started execution.
beforeany beforeany:[:]... Job may start at any time before all specified jobs have completed regardless of completion status.
beforeok beforeok:[:]... Job may start at any time before all specified jobs have successfully completed.
beforenotok beforenotok:[:]... Job may start at any time before any specified jobs have completed unsuccessfully.
on on: Job may start after dependencies on other jobs have been satisfied.
synccount synccount: Job must start at the same time as other jobs that reference this job using the syncwith keyword.
syncwith syncwith: Job must start at the same time as .