LSF-获取已提交作业的ID [英] LSF - Get ID of submitted job
本文介绍了LSF-获取已提交作业的ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
说我使用bsub pwd
之类的东西提交工作.现在,我想获取该作业的作业ID,以便为下一个作业建立依赖关系.有什么办法可以让bsub返回作业ID?
Say I submit a job using something like bsub pwd
. Now I would like to get the job ID of that job in order to build a dependency for the next job. Is there some way I can get bsub to return the job ID?
推荐答案
仅作为参考,到目前为止,这是我能想到的最佳解决方案.利用bsub将包含ID的行写到STDOUT的事实.
Just as a reference, this is the best solution I could come up with so far. It takes advantage of the fact that bsub write a line containing the ID to STDOUT.
function nk_jobid {
output=$($*)
echo $output | head -n1 | cut -d'<' -f2 | cut -d'>' -f1
}
用法:
jobid=$(nk_jobid bsub pwd)
这篇关于LSF-获取已提交作业的ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文