如何将qsub设置为在job1完成五秒钟后(或任何期望的值)运行job2? [英] How to set the qsub to run job2 five seconds (or any desired value) after the job1 is finished?

查看:151
本文介绍了如何将qsub设置为在job1完成五秒钟后(或任何期望的值)运行job2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我的工作是估算job1何时完成,然后使用 #PBS -a [myEstimatedTime + 5]指令为job2运行qsub,但是我对我的方法不满意,因为有时它是

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

这不会它会在5秒钟后执行,但会暂停该作业(无法运行),直到第一个作业完成为止。实际上,它会在大约5秒钟后运行,因为大多数调度迭代都要花费更多的时间。

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.

这篇关于如何将qsub设置为在job1完成五秒钟后(或任何期望的值)运行job2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆