Say I submit a job using something like bsub pwd
. Now I would like to get the job ID of that job in order to build a dependency for the next job. Is there some way I can get bsub to return the job ID?
相关问题
- Referencing job index in LSF job array
- How to launch multithreaded mpi processes in lsf?
- How to optimize multithreaded program for use in L
- SLURM display the stdout and stderr of an unfinish
- LSF - Get ID of submitted job
相关文章
- “的qsub - 现在”等同采用BSUB(“qsub -now” equivalent using
- 在LSF作业数组引用作业索引(Referencing job index in LSF job ar
- Referencing job index in LSF job array
- How to launch multithreaded mpi processes in lsf?
- How to optimize multithreaded program for use in L
- SLURM display the stdout and stderr of an unfinish
- LSF - Get ID of submitted job
- LSF (bsub): how to specify a single “wrap-up” job
In case you are using C++, you can use the lsblib, LSF C API to submit jobs. The input and the output are structs. In particular, the output struct contains the job id.
Nils and Andrey have the answers to this specific question in shell and C/C++ environments respectively. For the purposes of building dependencies, you can also name your job with -J then build the dependency based on the job name:
There's a bit more info here.
This also works with job arrays:
You can even do element-by-element dependency. The following job's i-th element will only run when the corresponding element in
ArrayB
reachesDONE
status:You can find more info on the various things you can specify in
-w
here.If you just want to view the JOBID after submission, most of the time I will just use bhist or bhist -l to view the running jobs and details.
Just as a reference, this is the best solution I could come up with so far. It takes advantage of the fact that bsub write a line containing the ID to STDOUT.
Usage: