How to set the qsub to run job2 five seconds (or a

2019-06-05 11:13发布

问题:

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.