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?
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?
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.
添加一个在 job1 和 job2 之间运行 5 分钟的耗时作业。集群的运行顺序是 job1 -> job(等待 5 分钟) -> job2。