Cancelling jobs
A normal job#
scancel <jobid>One task in an array#
scancel <arrayjobid>_<taskid>For example, scancel 1234567_7 cancels only task 7 — the rest of the array keeps running.
An entire array#
scancel <arrayjobid>scancel 1234567 cancels every task in that array, whether pending or already running.
What actually happens#
scancel requests termination — it doesn't guarantee an instant stop. A running job is sent a signal and Slurm gives it a short window to exit before forcing it; a pending job is simply removed from the queue. Either way, the job's state may take a few moments to settle — a job you just cancelled can briefly still show up in squeue.
squeue -j <jobid>An empty result means the job is gone. sacct will show it as CANCELLED:
sacct -j <jobid> --format=JobID,State,ExitCodeNote Cancelling doesn't delete anything. Any output already written by your program stays on disk exactly as it was when the job stopped — this is a property of your program, not of scancel. Whether a partial result is usable depends on what your program was doing when it was cut off; some produce a clean partial file, others don't.
When to cancel#
Common, reasonable reasons:
- You submitted with the wrong input file or the wrong arguments
- You requested the wrong resources (see Submitting jobs)
- You accidentally submitted a duplicate
- You submitted an array larger than intended
- The job is clearly stuck — no progress, no output, far past when it should have finished
- You simply don't need the result anymore
Warning Cancelling and resubmitting repeatedly is not a way to improve your place in the queue — fairshare and priority work the same regardless, and doing this just adds churn. If a job is pending for a reason you can't resolve yourself, see Why is my job pending? instead.
