SLURM Check, Modify and Cancel a Job using the scontrol & scancel commands
scontrol command
Besides the brief listing of every job using the squeue command,
a user can also see the detailed information of each job. Run the SLURM
command scontrol show with a job ID:
You can check if the information is right for the job. If the job has
not started to run and you would like change any specification, you can
hold the job first using the scontrol hold command:
where you can see from the results of the squeue command, the job is
pending due to the user's hold. You can choose the information you want to change in scontrol show results. Put them in the
scontrol update command and modify the information after the = symbol. For example, the command line
will change the resource request of the job 8929 from 80 nodes and 80
tasks with intel14 nodes to 2 nodes and 2 tasks with intel16 nodes.
After the update, you can use the scontrol show command again to verify
the job setting. Once you are done with the update work, you can release
the job hold by command scontrol release:
The job is now running due to the change of the resource request by the
command scontrol update. Again, we can check the running job using the
command scontrol show:
If at any moment before the job complete, you would like to remove
the job, you can use the scancel command to cancel a job. For example,
the command
1
$scancel8929
will cancel job 8929. For a complete usage information about the scancel
command, please refer to
https://slurm.schedmd.com/scancel.html at the
SLURM web site.