Set a whole array dependency

About this task

Like all jobs in LSF, a job array can be dependent on the completion or partial completion of a job or another job array. A number of job-array-specific dependency conditions are provided by LSF.

Procedure

To make a job array dependent on the completion of a job or another job array use the -w "dependency_condition" option of bsub.
For example, to have an array dependent on the completion of a job or job array with job ID 123, use the following command:
bsub -w "done(123)" -J "myArray2[1-1000]" myJob

Set a partial array dependency

Procedure

  1. To make a job or job array dependent on an existing job array, use one of the following dependency conditions.

    Condition

    Description

    numrun(jobArrayJobId, op num)

    Evaluate the number of jobs in RUN state

    numpend(jobArrayJobId, op num)

    Evaluate the number of jobs in PEND state

    numdone(jobArrayJobId, op num)

    Evaluate the number of jobs in DONE state

    numexit(jobArrayJobId, op num)

    Evaluate the number of jobs in EXIT state

    numended(jobArrayJobId, op num)

    Evaluate the number of jobs in DONE and EXIT state

    numhold(jobArrayJobId, op num)

    Evaluate the number of jobs in PSUSP state

    numstart(jobArrayJobId, op num)

    Evaluate the number of jobs in RUN and SSUSP and USUSP state

  2. Use one the following operators (op) combined with a positive integer (num) to build a condition:
    == | > | < | >= |<= | !=

    Optionally, an asterisk (*) can be used in place of num to mean all jobs submitted from the job array.

    For example, to start a job named myJob when 100 or more elements in a job array with job ID 123 have completed successfully:
    bsub -w "numdone(123, >= 100)" myJob