How to set the qsub to run job2 five seconds (or any desired value) after the job1 is finished?

别等时光非礼了梦想. 提交于 2019-12-08 03:57:57

问题


Currently what I do is to estimate when job1 will be finished, then using the “#PBS -a [myEstimatedTime+5]" directive I run qsub for job2. But I’m not happy with my approach since sometimes it is over/under estimated.

Is there any better solution?


回答1:


Add a time-killing job that runs 5 minutes between job1 and job2. The cluster's running order will be job1 -> job (for waiting 5 mins) -> job2.




回答2:


The best way to do this is through job dependencies. You can submit the jobs:

job1id=`qsub script1.sh`
qsub script.sh -W depend=after:$job1id

This won't make it execute 5 seconds after, but it will place a hold on the job (can't run) until after the first job finishes. In practice it will run more than about 5 seconds after because most scheduling iterations take more time than that anyway.



来源:https://stackoverflow.com/questions/7218942/how-to-set-the-qsub-to-run-job2-five-seconds-or-any-desired-value-after-the-jo

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