如何等待扭矩作业阵列完成 [英] How to wait for a torque job array to complete
问题描述
我有一个脚本,可将数据结构分成多个块.这些块使用扭矩作业数组进行处理,然后合并回一个结构中.
I have a script that splits a data structure into chunks. The chunks are processed using a torque job array and then merged back into a single structure.
合并操作取决于作业阵列的完成情况.如何使合并操作等待扭矩作业阵列完成?
The merge operation is dependent on the job array completing. How do I make the merge operation wait for the torque job array to complete?
$ qsub --version
Version: 4.1.6
我的脚本如下:
# Splits the data structure and processes the chunks
qsub -t 1-100 -l nodes=1:ppn=40,walltime=48:00:00,vmem=120G ./job.sh
# Merges the processed chunks back into a single structure
./merge.sh
我尝试过:
qsub -t 1-100 -l nodes=1:ppn=40,walltime=48:00:00,vmem=120G -N job1 ./job.sh
qsub -W depend=afterokarray:job1 ./merge.sh
还有:
qsub -t 1-100 -l nodes=1:ppn=40,walltime=48:00:00,vmem=120G -N job1 ./job.sh
qsub -hold_jid job1 ./merge.sh
都不起作用.前者导致错误[qsub:非法-W值],而后者也导致错误:qsub:脚本文件'job1'无法加载-没有此类文件或目录.
Neither worked. The former resulted in error [qsub: illegal -W value], and the latter also resulted in error: qsub: script file 'job1' cannot be loaded - No such file or directory.
推荐答案
qsub -t 1-100 -l nodes=1:ppn=40,walltime=48:00:00,vmem=120G -N job1 ./job.sh
包含Jobid. 因此,以下操作应适用于bash:
contains the jobid. So following should work in bash:
FIRST=`qsub first_1.sh`
qsub -W depend=afterok:$FIRST second_1.sh
这篇关于如何等待扭矩作业阵列完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!