Getting started with the I2BC cluster
Objective 3
Deleting a job with qdel
.
What if I changed my mind? How can I stop the job I just submitted??!
Getting familiar with qdel
In addition to qsub
(submit a job) and qstat
(follow a job), the third OpenPBS command you should know is qdel
to delete a job. You can only delete your own jobs, deleting other people’s jobs won’t work.
Let’s see what jobs are running:
john.doe@cluster-i2bc:/home/john.doe$ qstat
Job id Name User Time Use S Queue
---------------- ---------------- ---------------- -------- - -----
321295.pbsserver run_CHIC.sh luke.skywalker 0 Q chrody
Let’s now try to delete Luke’s job:
john.doe@cluster-i2bc:/home/john.doe$ qdel 321295.pbsserver
qdel: Unauthorized Request 321295.pbsserver
See? Nothing happened because I can only delete my own jobs.
Delete one of your jobs
sleep 60s
command in it to give you time to delete it before it finishes).
john.doe@cluster-i2bc:/home/john.doe$ qsub pbs_script.sh
918860.pbsserver
Make sure it’s running with the qstat
command (we’ve added the -u $USER
option to only show your jobs):
john.doe@cluster-i2bc:/home/john.doe$ qstat -u $USER
Job id Name User Time Use S Queue
---------------- ---------------- ---------------- -------- - -----
918860.pbsserver pbs_script.sh john.doe 0 Q common
Let’s now try to delete the job you just created:
john.doe@cluster-i2bc:/home/john.doe$ qdel 918860.pbsserver
And let’s now check if we can see the job is in the list:
john.doe@cluster-i2bc:/home/john.doe$ qstat -u $USER
john.doe@cluster-i2bc:/home/john.doe$
No… it’s gone as expected (in some cases, you might still see it for a little while before it disappears, that’s normal).
Take home message
1) qdel
to delete a job using it’s unique job id
2) you can only delete your own jobs