1scancel(1) Slurm Commands scancel(1)
2
3
4
6 scancel - Used to signal jobs or job steps that are under the control
7 of Slurm.
8
9
11 scancel [OPTIONS...] [job_id[_array_id][.step_id]] [job_id[_ar‐
12 ray_id][.step_id]...]
13
14
16 scancel is used to signal or cancel jobs, job arrays or job steps. An
17 arbitrary number of jobs or job steps may be signaled using job speci‐
18 fication filters or a space separated list of specific job and/or job
19 step IDs. If the job ID of a job array is specified with an array ID
20 value then only that job array element will be cancelled. If the job
21 ID of a job array is specified without an array ID value then all job
22 array elements will be cancelled. While a heterogeneous job is in a
23 PENDING state, only the entire job can be cancelled rather than its in‐
24 dividual components. A request to cancel an individual component of a
25 heterogeneous job while in a PENDING state will return an error. After
26 the job has begun execution, an individual component can be cancelled.
27 A job or job step can only be signaled by the owner of that job or user
28 root. If an attempt is made by an unauthorized user to signal a job or
29 job step, an error message will be printed and the job will not be sig‐
30 naled.
31
32
34 -A, --account=account
35 Restrict the scancel operation to jobs under this charge ac‐
36 count.
37
38
39 -b, --batch
40 By default, signals other than SIGKILL are not sent to the batch
41 step (the shell script). With this option scancel signals only
42 the batch step, but not any other steps. This is useful when
43 the shell script has to trap the signal and take some applica‐
44 tion defined action. Note that most shells cannot handle sig‐
45 nals while a command is running (child process of the batch
46 step), the shell use to wait until the command ends to then han‐
47 dle the signal. Children of the batch step are not signaled with
48 this option, use -f, --full instead. NOTE: If used with -f,
49 --full, this option ignored. NOTE: This option is not applica‐
50 ble if step_id is specified. NOTE: The shell itself may exit
51 upon receipt of many signals. You may avoid this by explicitly
52 trap signals within the shell script (e.g. "trap <arg> <sig‐
53 nals>"). See the shell documentation for details.
54
55
56 -M, --clusters=<string>
57 Cluster to issue commands to. Implies --ctld. Note that the
58 SlurmDBD must be up for this option to work properly.
59
60
61 --ctld Send the job signal request to the slurmctld daemon rather than
62 directly to the slurmd daemons. This increases overhead, but of‐
63 fers better fault tolerance. This is the default behavior on
64 architectures using front end nodes (e.g. Cray ALPS computers)
65 or when the --clusters option is used.
66
67
68 -f, --full
69 By default, signals other than SIGKILL are not sent to the batch
70 step (the shell script). With this option scancel signals also
71 the batch script and its children processes. Most shells cannot
72 handle signals while a command is running (child process of the
73 batch step), the shell use to wait until the command ends to
74 then handle the signal. Unlike -b, --batch, children of the
75 batch step are also signaled with this option. NOTE: srun steps
76 are also children of the batch step, so steps are also signaled
77 with this option.
78
79
80 --help Print a help message describing all scancel options.
81
82
83 -H, --hurry
84 Do not stage out any burst buffer data.
85
86
87 -i, --interactive
88 Interactive mode. Confirm each job_id.step_id before performing
89 the cancel operation.
90
91
92 -n, --jobname=job_name, --name=job_name
93 Restrict the scancel operation to jobs with this job name.
94
95
96 -w, --nodelist=host1,host2,...
97 Cancel any jobs using any of the given hosts. The list may be
98 specified as a comma-separated list of hosts, a range of hosts
99 (host[1-5,7,...] for example), or a filename. The host list will
100 be assumed to be a filename only if it contains a "/" character.
101
102
103 -p, --partition=partition_name
104 Restrict the scancel operation to jobs in this partition.
105
106
107 -q, --qos=qos
108 Restrict the scancel operation to jobs with this quality of ser‐
109 vice.
110
111
112 -Q, --quiet
113 Do not report an error if the specified job is already com‐
114 pleted. This option is incompatible with the --verbose option.
115
116
117
118 -R, --reservation=reservation_name
119 Restrict the scancel operation to jobs with this reservation
120 name.
121
122
123 --sibling=cluster_name
124 Remove an active sibling job from a federated job.
125
126
127 -s, --signal=signal_name
128 The name or number of the signal to send. If this option is not
129 used the specified job or step will be terminated. Note. If this
130 option is used the signal is sent directly to the slurmd where
131 the job is running bypassing the slurmctld thus the job state
132 will not change even if the signal is delivered to it. Use the
133 scontrol command if you want the job state change be known to
134 slurmctld.
135
136
137 -t, --state=job_state_name
138 Restrict the scancel operation to jobs in this state.
139 job_state_name may have a value of either "PENDING", "RUNNING"
140 or "SUSPENDED".
141
142
143 --usage
144 Print a brief help message listing the scancel options.
145
146
147 -u, --user=user_name
148 Restrict the scancel operation to jobs owned by this user.
149
150
151 -v, --verbose
152 Print additional logging. Multiple v's increase logging detail.
153 This option is incompatible with the --quiet option.
154
155
156 -V, --version
157 Print the version number of the scancel command.
158
159
160 --wckey=wckey
161 Restrict the scancel operation to jobs using this workload char‐
162 acterization key.
163
164
165 ARGUMENTS
166
167
168 job_id The Slurm job ID to be signaled.
169
170
171 step_id
172 The step ID of the job step to be signaled. If not specified,
173 the operation is performed at the level of a job.
174
175 If neither --batch nor --signal are used, the entire job will be
176 terminated.
177
178 When --batch is used, the batch shell processes will be sig‐
179 naled. The child processes of the shell will not be signaled by
180 Slurm, but the shell may forward the signal.
181
182 When --batch is not used but --signal is used, then all job
183 steps will be signaled, but the batch script itself will not be
184 signaled.
185
186
188 Executing scancel sends a remote procedure call to slurmctld. If enough
189 calls from scancel or other Slurm client commands that send remote pro‐
190 cedure calls to the slurmctld daemon come in at once, it can result in
191 a degradation of performance of the slurmctld daemon, possibly result‐
192 ing in a denial of service.
193
194 Do not run scancel or other Slurm client commands that send remote pro‐
195 cedure calls to slurmctld from loops in shell scripts or other pro‐
196 grams. Ensure that programs limit calls to scancel to the minimum nec‐
197 essary for the information you are trying to gather.
198
199
201 Some scancel options may be set via environment variables. These envi‐
202 ronment variables, along with their corresponding options, are listed
203 below. (Note: Command line options will always override these set‐
204 tings.)
205
206 SCANCEL_ACCOUNT -A, --account=account
207
208 SCANCEL_BATCH -b, --batch
209
210 SCANCEL_CTLD --ctld
211
212 SCANCEL_FULL -f, --full
213
214 SCANCEL_HURRY -H, --hurry
215
216 SCANCEL_INTERACTIVE -i, --interactive
217
218 SCANCEL_NAME -n, --name=job_name
219
220 SCANCEL_PARTITION -p, --partition=partition_name
221
222 SCANCEL_QOS -q, --qos=qos
223
224 SCANCEL_STATE -t, --state=job_state_name
225
226 SCANCEL_USER -u, --user=user_name
227
228 SCANCEL_VERBOSE -v, --verbose
229
230 SCANCEL_WCKEY --wckey=wckey
231
232 SLURM_CONF The location of the Slurm configuration file.
233
234 SLURM_CLUSTERS -M, --clusters
235
236
238 If multiple filters are supplied (e.g. --partition and --name) only the
239 jobs satisfying all of the filtering options will be signaled.
240
241 Cancelling a job step will not result in the job being terminated. The
242 job must be cancelled to release a resource allocation.
243
244 To cancel a job, invoke scancel without --signal option. This will
245 send first a SIGCONT to all steps to eventually wake them up followed
246 by a SIGTERM, then wait the KillWait duration defined in the slurm.conf
247 file and finally if they have not terminated send a SIGKILL. This
248 gives time for the running job/step(s) to clean up.
249
250 If a signal value of "KILL" is sent to an entire job, this will cancel
251 the active job steps but not cancel the job itself.
252
253 On Cray systems, all signals except SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP,
254 SIGTTIN, SIGTTOU, SIGURG, or SIGWINCH cause the ALPS reservation to be
255 released. The job however will not be terminated except in the case of
256 SIGKILL and may then be used for post processing.
257
258
260 When using SlurmDBD, users who have an AdminLevel defined (Operator or
261 Admin) and users who are account coordinators are given the authority
262 to invoke scancel on other users jobs.
263
264
266 Send SIGTERM to steps 1 and 3 of job 1234:
267
268 $ scancel --signal=TERM 1234.1 1234.3
269
270
271 Cancel job 1234 along with all of its steps:
272
273 $ scancel 1234
274
275
276 Send SIGKILL to all steps of job 1235, but do not cancel the job it‐
277 self:
278
279 $ scancel --signal=KILL 1235
280
281
282 Send SIGUSR1 to the batch shell processes of job 1236:
283
284 $ scancel --signal=USR1 --batch 1236
285
286
287 Cancel all pending jobs belonging to user "bob" in partition "debug":
288
289 $ scancel --state=PENDING --user=bob --partition=debug
290
291
292 Cancel only array ID 4 of job array 1237
293
294 $ scancel 1237_4
295
296
298 Copyright (C) 2002-2007 The Regents of the University of California.
299 Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
300 Copyright (C) 2008-2011 Lawrence Livermore National Security.
301 Copyright (C) 2010-2021 SchedMD LLC.
302
303 This file is part of Slurm, a resource management program. For de‐
304 tails, see <https://slurm.schedmd.com/>.
305
306 Slurm is free software; you can redistribute it and/or modify it under
307 the terms of the GNU General Public License as published by the Free
308 Software Foundation; either version 2 of the License, or (at your op‐
309 tion) any later version.
310
311 Slurm is distributed in the hope that it will be useful, but WITHOUT
312 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
313 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
314 for more details.
315
316
318 slurm_kill_job (3), slurm_kill_job_step (3)
319
320
321
322October 2021 Slurm Commands scancel(1)