LSF (bsub): how to specify one "final" task that should be run after all the others have finished?

BASIC PROBLEM: I want to send N + 1 jobs to an LSF-managed Linux cluster so that (N + 1) -st "up" does not start until all previous N jobs have been completed.

EXTRA: If possible, it would be ideal if I could organize the questions in order to get the (N + 1) -st ("wrapped") task as the first argument, the value 0 (say), if all the previous N tasks were completed successfully, otherwise the value is different from 0.

This problem (or at least the part labeled “BASIC PROBLEM”) is much simpler than it seems that LSF bsub designed to handle, so I have to wade through the voluminous documentation for bsub easiest way to do what I want to do.

What will be the simplest bsub to reach this agreement?


To be more specific, what would I have to replace the various slots ??? below to ensure that wrapup is executed only after all foo jobs have completed (ideally with an argument that reflects the final status of the foo job)?

 bsub -q someq ??? foo 1 bsub -q someq ??? foo 2 bsub -q someq ??? foo 3 bsub -q someq ??? wrapup [???] 
+3
cluster-computing lsf
source share
1 answer

To expand the answer to Michael Klasson’s question, here you will find the bsub -w option, which allows you to submit a task that will be scheduled only if some dependency condition is met.

The most common terms of use are the exit status of some other task, if you name each of your tasks "foo $ i" with -J:

 bsub -q someq -J "job_1" foo 1 bsub -q someq -J "job_2" foo 2 bsub -q someq -J "job_3" foo 3 

Then you can send another task, which depends on the exit status of these tasks as follows:

 bsub -q someq -w "done(job_1) && done(job_2) && done(job_3)" wrapup 

This tells LSF to only schedule a wrapping if jobs with the names job_1, job_2 and job_3 end with DONE status. You can also use the job id instead of job names or specify the specific status you want to check with expressions like

 done("job_1") // termination status is DONE exit("job_1") // termination status is EXIT ended("job_1") // termination status is EXIT or DONE 

And combine them with the logical operators &, || ,!

+9
source share

All Articles