Use slurm job id

我是研究僧i 提交于 2019-12-03 18:39:53

问题


When I launch a computation on the cluster, I usually have a separate program doing the post-processing at the end :

sbatch simulation
sbatch --dependency=afterok:JOBIDHERE postprocessing

I want to avoid mistyping and automatically have the good job id inserted. Any idea? Thanks


回答1:


You can do something like this:

RES=$(sbatch simulation) && sbatch --dependency=afterok:${RES##* } postprocessing

The RES variable will hold the result of the sbatch command, something like Submitted batch job 102045. The construct ${RES##* } isolates the last word (see more info here), in the current case the job id. The && part ensures you do not try to submit the second job in the case the first submission fails.



来源:https://stackoverflow.com/questions/19960332/use-slurm-job-id

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