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]]
12 [job_id[_array_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
23 pending state, only the entire job can be cancelled rather than its
24 individual components. A request to cancel an individual component of
25 a heterogeneous job not in pending state will return an error. After
26 the job has begun execution, the 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
36 account.
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 --ctld Send the job signal request to the slurmctld daemon rather than
57 directly to the slurmd daemons. This increases overhead, but
58 offers better fault tolerance. This is the default behavior on
59 architectures using front end nodes (e.g. Cray ALPS computers)
60 or when the --clusters option is used.
61
62
63 -f, --full
64 By default, signals other than SIGKILL are not sent to the batch
65 step (the shell script). With this option scancel signals also
66 the batch script and its children processes. Most shells cannot
67 handle signals while a command is running (child process of the
68 batch step), the shell use to wait until the command ends to
69 then handle the signal. Unlike -b, --batch, children of the
70 batch step are also signaled with this option. NOTE: srun steps
71 are also children of the batch step, so steps are also signaled
72 with this option.
73
74
75 --help Print a help message describing all scancel options.
76
77
78 -H, --hurry
79 Do not stage out any burst buffer data.
80
81
82 -i, --interactive
83 Interactive mode. Confirm each job_id.step_id before performing
84 the cancel operation.
85
86
87 -M, --clusters=<string>
88 Cluster to issue commands to. Implies --ctld. Note that the
89 SlurmDBD must be up for this option to work properly.
90
91
92 -n, --jobname=job_name, --name=job_name
93 Restrict the scancel operation to jobs with this job name.
94
95
96 -p, --partition=partition_name
97 Restrict the scancel operation to jobs in this partition.
98
99
100 -q, --qos=qos
101 Restrict the scancel operation to jobs with this quality of ser‐
102 vice.
103
104
105 -Q, --quiet
106 Do not report an error if the specified job is already com‐
107 pleted. This option is incompatible with the --verbose option.
108
109
110
111 -R, --reservation=reservation_name
112 Restrict the scancel operation to jobs with this reservation
113 name.
114
115
116 --sibling=cluster_name
117 Remove an active sibling job from a federated job.
118
119
120 -s, --signal=signal_name
121 The name or number of the signal to send. If this option is not
122 used the specified job or step will be terminated. Note. If this
123 option is used the signal is sent directly to the slurmd where
124 the job is running bypassing the slurmctld thus the job state
125 will not change even if the signal is delivered to it. Use the
126 scontrol command if you want the job state change be known to
127 slurmctld.
128
129
130 -t, --state=job_state_name
131 Restrict the scancel operation to jobs in this state.
132 job_state_name may have a value of either "PENDING", "RUNNING"
133 or "SUSPENDED".
134
135
136 -u, --user=user_name
137 Restrict the scancel operation to jobs owned by this user.
138
139
140 --usage
141 Print a brief help message listing the scancel options.
142
143
144 -v, --verbose
145 Print additional logging. Multiple v's increase logging detail.
146 This option is incompatible with the --quiet option.
147
148
149 -V, --version
150 Print the version number of the scancel command.
151
152
153 -w, --nodelist=host1,host2,...
154 Cancel any jobs using any of the given hosts. The list may be
155 specified as a comma-separated list of hosts, a range of hosts
156 (host[1-5,7,...] for example), or a filename. The host list will
157 be assumed to be a filename only if it contains a "/" character.
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: commandline options will always override these settings)
204
205 SCANCEL_ACCOUNT -A, --account=account
206
207 SCANCEL_BATCH -b, --batch
208
209 SCANCEL_CTLD --ctld
210
211 SCANCEL_FULL -f, --full
212
213 SCANCEL_HURRY -H, --hurry
214
215 SCANCEL_INTERACTIVE -i, --interactive
216
217 SCANCEL_NAME -n, --name=job_name
218
219 SCANCEL_PARTITION -p, --partition=partition_name
220
221 SCANCEL_QOS -q, --qos=qos
222
223 SCANCEL_STATE -t, --state=job_state_name
224
225 SCANCEL_USER -u, --user=user_name
226
227 SCANCEL_VERBOSE -v, --verbose
228
229 SCANCEL_WCKEY --wckey=wckey
230
231 SLURM_CONF The location of the Slurm configuration file.
232
233 SLURM_CLUSTERS -M, --clusters
234
235
237 If multiple filters are supplied (e.g. --partition and --name) only the
238 jobs satisfying all of the filtering options will be signaled.
239
240 Cancelling a job step will not result in the job being terminated. The
241 job must be cancelled to release a resource allocation.
242
243 To cancel a job, invoke scancel without --signal option. This will
244 send first a SIGCONT to all steps to eventually wake them up followed
245 by a SIGTERM, then wait the KillWait duration defined in the slurm.conf
246 file and finally if they have not terminated send a SIGKILL. This
247 gives time for the running job/step(s) to clean up.
248
249 If a signal value of "KILL" is sent to an entire job, this will cancel
250 the active job steps but not cancel the job itself.
251
252 On Cray systems, all signals except SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP,
253 SIGTTIN, SIGTTOU, SIGURG, or SIGWINCH cause the ALPS reservation to be
254 released. The job however will not be terminated except in the case of
255 SIGKILL and may then be used for post processing.
256
257
259 When using SlurmDBD, users who have an AdminLevel defined (Operator or
260 Admin) and users who are account coordinators are given the authority
261 to invoke scancel on other users jobs.
262
263
265 Send SIGTERM to steps 1 and 3 of job 1234:
266 scancel --signal=TERM 1234.1 1234.3
267
268
269 Cancel job 1234 along with all of its steps:
270 scancel 1234
271
272
273 Send SIGKILL to all steps of job 1235, but do not cancel the job
274 itself:
275 scancel --signal=KILL 1235
276
277
278 Send SIGUSR1 to the batch shell processes of job 1236:
279 scancel --signal=USR1 --batch 1236
280
281
282 Cancel job all pending jobs belonging to user "bob" in partition
283 "debug":
284 scancel --state=PENDING --user=bob --partition=debug
285
286
287 Cancel only array ID 4 of job array 1237
288 scancel 1237_4
289
290
292 Copyright (C) 2002-2007 The Regents of the University of California.
293 Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
294 Copyright (C) 2008-2011 Lawrence Livermore National Security.
295 Copyright (C) 2010-2015 SchedMD LLC.
296
297 This file is part of Slurm, a resource management program. For
298 details, see <https://slurm.schedmd.com/>.
299
300 Slurm is free software; you can redistribute it and/or modify it under
301 the terms of the GNU General Public License as published by the Free
302 Software Foundation; either version 2 of the License, or (at your
303 option) any later version.
304
305 Slurm is distributed in the hope that it will be useful, but WITHOUT
306 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
307 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
308 for more details.
309
310
312 slurm_kill_job (3), slurm_kill_job_step (3)
313
314
315
316July 2020 Slurm Commands scancel(1)