Say I sent a job with a dependency using qsub -W depend=afterok:JOBID
to the cluster, how to I clear it with qalter command (using PBSpro scheduler)? I found Some info in the qalter
man page, but couldn't find how to clear it, just how to create a new dependency.
With a little help from some friends I got an answer, apparently I had to submit a qalter
command to alter the dependency, but instead of specifying a new JOBID
, just omitting the :JOBID
.
Submit a job that depends on successful completion of a previous job (say 1234
)
qsub -q my_queue -l ... -W depend=afterok:1234 file.pbs
The newly submitted job will stay on-hold until job 1234
finishes with ExitStatus:0
. We can check the JobId and status of the newly submitted job using the qstat
command (its status should be H for Hold and say its Id is 1235
).
Then if we decide that we don't need to wait for the first command to finish, we
can clear the dependency:
qalter -W depend=afterok 1235
Note that I ommited the colon and the dependency Id after afterok
and that qalter
requires the JobId it's altering as its last argument.