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.
The answer
You should user afterokarray:
Another example
This is another example, let say you need to execute a job two times and after those, execute another one:
Execute
qsub < nueva_tarea_2.bash
an them use (10[].docker) in the other submitssion fileThe output of
contains the jobid. So following should work in bash: