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
My script is as follows:
# 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
I have tried:
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
and also:
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
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.
afterokarray
syntax correctly. It should be -W depend=afterokarray:12345[] where 12345[] is the array job ID that is returned by the precedingqsub
. See also here on SO. – Kike