LSF (bsub): how to specify a single “wrap-up” job to be run after all others finish?

给你一囗甜甜゛ 提交于 2019-11-29 07:19:24

To expand on Michael Closson's answer, what you're looking for here is bsub's -w option, which allows you to submit a job that will only be scheduled if some dependency condition is met.

The most common conditions to use is the exit status of some other job, if you name each of your "foo $i" jobs 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 submit another job that depends on the exit status of these jobs as follows:

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

This tells LSF to only schedule "wrapup" if the jobs named job_1, job_2, and job_3 terminate with DONE status. You can also use job-id's instead of job names, or specify the specific status you want to test for 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 these with logical operators &&, ||, !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!