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 it's
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 wait until the command ends to then
47 handle the signal. Children of the batch step are not signaled
48 with this option, use -f, --full instead. NOTE: If used with
49 -f, --full, this option ignored. NOTE: This option is not
50 applicable if step_id is specified. NOTE: The shell itself may
51 exit upon receipt of many signals. You may avoid this by
52 explicitly trap signals within the shell script (e.g. "trap
53 <arg> <signals>"). 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 Clusters to issue commands to. Note that the SlurmDBD must be
89 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 Some scancel options may be set via environment variables. These envi‐
189 ronment variables, along with their corresponding options, are listed
190 below. (Note: commandline options will always override these settings)
191
192 SCANCEL_ACCOUNT -A, --account=account
193
194 SCANCEL_BATCH -b, --batch
195
196 SCANCEL_CTLD --ctld
197
198 SCANCEL_FULL -f, --full
199
200 SCANCEL_HURRY -H, --hurry
201
202 SCANCEL_INTERACTIVE -i, --interactive
203
204 SCANCEL_NAME -n, --name=job_name
205
206 SCANCEL_PARTITION -p, --partition=partition_name
207
208 SCANCEL_QOS -q, --qos=qos
209
210 SCANCEL_STATE -t, --state=job_state_name
211
212 SCANCEL_USER -u, --user=user_name
213
214 SCANCEL_VERBOSE -v, --verbose
215
216 SCANCEL_WCKEY --wckey=wckey
217
218 SLURM_CONF The location of the Slurm configuration file.
219
220
222 If multiple filters are supplied (e.g. --partition and --name) only the
223 jobs satisfying all of the filtering options will be signaled.
224
225 Cancelling a job step will not result in the job being terminated. The
226 job must be cancelled to release a resource allocation.
227
228 To cancel a job, invoke scancel without --signal option. This will
229 send first a SIGCONT to all steps to eventually wake them up followed
230 by a SIGTERM, then wait the KillWait duration defined in the slurm.conf
231 file and finally if they have not terminated send a SIGKILL. This
232 gives time for the running job/step(s) to clean up.
233
234 If a signal value of "KILL" is sent to an entire job, this will cancel
235 the active job steps but not cancel the job itself.
236
237 On Cray systems, all signals except SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP,
238 SIGTTIN, SIGTTOU, SIGURG, or SIGWINCH cause the ALPS reservation to be
239 released. The job however will not be terminated except in the case of
240 SIGKILL and may then be used for post processing.
241
242
244 When using the Slurm db, users who have AdminLevel's defined (Operator
245 or Admin) and users who are account coordinators are given the author‐
246 ity to invoke scancel on other user's jobs.
247
248
250 Send SIGTERM to steps 1 and 3 of job 1234:
251 scancel --signal=TERM 1234.1 1234.3
252
253
254 Cancel job 1234 along with all of its steps:
255 scancel 1234
256
257
258 Send SIGKILL to all steps of job 1235, but do not cancel the job
259 itself:
260 scancel --signal=KILL 1235
261
262
263 Send SIGUSR1 to the batch shell processes of job 1236:
264 scancel --signal=USR1 --batch 1236
265
266
267 Cancel job all pending jobs belonging to user "bob" in partition
268 "debug":
269 scancel --state=PENDING --user=bob --partition=debug
270
271
272 Cancel only array ID 4 of job array 1237
273 scancel 1237_4
274
275
277 Copyright (C) 2002-2007 The Regents of the University of California.
278 Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
279 Copyright (C) 2008-2011 Lawrence Livermore National Security.
280 Copyright (C) 2010-2015 SchedMD LLC.
281
282 This file is part of Slurm, a resource management program. For
283 details, see <https://slurm.schedmd.com/>.
284
285 Slurm is free software; you can redistribute it and/or modify it under
286 the terms of the GNU General Public License as published by the Free
287 Software Foundation; either version 2 of the License, or (at your
288 option) any later version.
289
290 Slurm is distributed in the hope that it will be useful, but WITHOUT
291 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
292 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
293 for more details.
294
295
297 slurm_kill_job (3), slurm_kill_job_step (3)
298
299
300
301June 2018 Slurm Commands scancel(1)