1scancel(1)                      Slurm Commands                      scancel(1)
2
3
4

NAME

6       scancel  -  Used to signal jobs or job steps that are under the control
7       of Slurm.
8
9

SYNOPSIS

11       scancel   [OPTIONS...]    [job_id[_array_id][.step_id]]    [job_id[_ar‐
12       ray_id][.step_id]...]
13
14

DESCRIPTION

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

OPTIONS

34       -A, --account=account
35              Restrict  the  scancel  operation  to jobs under this charge ac‐
36              count.
37
38       -b, --batch
39              By default, signals other than SIGKILL are not sent to the batch
40              step  (the  shell script). With this option scancel signals only
41              the batch step, but not any other steps.  This  is  useful  when
42              the  shell  script has to trap the signal and take some applica‐
43              tion defined action.  Most shells cannot handle signals while  a
44              command  is running (i.e. is a child process of the batch step),
45              so the shell needs to wait until the command ends to then handle
46              the  signal.   Children  of the batch step are not signaled with
47              this option. If this is desired, use -f, --full instead.   NOTE:
48              If used with -f, --full, this option ignored.  NOTE: This option
49              is not applicable if step_id is specified.  NOTE: The shell  it‐
50              self  may exit upon receipt of many signals.  You may avoid this
51              by explicitly trap signals within the shell script  (e.g.  "trap
52              <arg> <signals>"). See the shell documentation for details.
53
54       -M, --clusters=<string>
55              Cluster  to  issue  commands  to. Implies --ctld.  Note that the
56              SlurmDBD must be up for this option to work properly.
57
58       --ctld Send the job signal request to the slurmctld daemon rather  than
59              directly to the slurmd daemons. This increases overhead, but of‐
60              fers better fault tolerance.  This is the  default  behavior  on
61              architectures  using front end nodes (e.g.  Cray ALPS computers)
62              or when the --clusters option is used.
63
64       -f, --full
65              By default, signals other than SIGKILL are not sent to the batch
66              step  (the  shell script). With this option scancel also signals
67              the batch script and its children processes.  Most shells cannot
68              handle  signals  while  a  command  is  running (i.e. is a child
69              process of the batch step), so the shell needs to wait until the
70              command  ends  to  then  handle the signal.  Unlike -b, --batch,
71              children of the batch step are also signaled with  this  option.
72              NOTE:  srun  steps are also children of the batch step, so steps
73              are also signaled with this option.
74
75       --help Print a help message describing all scancel options.
76
77       -H, --hurry
78              Do not stage out any burst buffer data.
79
80       -i, --interactive
81              Interactive mode. Confirm each job_id.step_id before  performing
82              the cancel operation.
83
84       -n, --jobname=job_name, --name=job_name
85              Restrict the scancel operation to jobs with this job name.
86
87       -w, --nodelist=host1,host2,...
88              Cancel  any  jobs using any of the given hosts.  The list may be
89              specified as a comma-separated list of hosts, a range  of  hosts
90              (host[1-5,7,...] for example), or a filename. The host list will
91              be assumed to be a filename only if it contains a "/" character.
92
93       -p, --partition=partition_name
94              Restrict the scancel operation to jobs in this partition.
95
96       -q, --qos=qos
97              Restrict the scancel operation to jobs with this quality of ser‐
98              vice.
99
100       -Q, --quiet
101              Do  not  report  an  error  if the specified job is already com‐
102              pleted.  This option is incompatible with the --verbose option.
103
104       -R, --reservation=reservation_name
105              Restrict the scancel operation to  jobs  with  this  reservation
106              name.
107
108       --sibling=cluster_name
109              Remove an active sibling job from a federated job.
110
111       -s, --signal=signal_name
112              The name or number of the signal to send.  If this option is not
113              used the specified job or step will be terminated. Note. If this
114              option  is  used the signal is sent directly to the slurmd where
115              the job is running bypassing the slurmctld thus  the  job  state
116              will  not  change even if the signal is delivered to it. Use the
117              scontrol command if you want the job state change  be  known  to
118              slurmctld.
119
120       -t, --state=job_state_name
121              Restrict   the   scancel   operation  to  jobs  in  this  state.
122              job_state_name may have a value of either  "PENDING",  "RUNNING"
123              or "SUSPENDED".
124
125       --usage
126              Print a brief help message listing the scancel options.
127
128       -u, --user=user_name
129              Restrict the scancel operation to jobs owned by this user.
130
131       -v, --verbose
132              Print  additional logging. Multiple v's increase logging detail.
133              This option is incompatible with the --quiet option.
134
135       -V, --version
136              Print the version number of the scancel command.
137
138       --wckey=wckey
139              Restrict the scancel operation to jobs using this workload char‐
140              acterization key.
141

ARGUMENTS

143       job_id The Slurm job ID to be signaled.
144
145       step_id
146              The  step  ID of the job step to be signaled.  If not specified,
147              the operation is performed at the level of a job.
148
149              If neither --batch nor --signal are used, the entire job will be
150              terminated.
151
152              When  --batch  is  used,  the batch shell processes will be sig‐
153              naled.  The child processes of the shell will not be signaled by
154              Slurm, but the shell may forward the signal.
155
156              When  --batch  is  not  used  but --signal is used, then all job
157              steps will be signaled, but the batch script itself will not  be
158              signaled.
159

PERFORMANCE

161       Executing scancel sends a remote procedure call to slurmctld. If enough
162       calls from scancel or other Slurm client commands that send remote pro‐
163       cedure  calls to the slurmctld daemon come in at once, it can result in
164       a degradation of performance of the slurmctld daemon, possibly  result‐
165       ing in a denial of service.
166
167       Do not run scancel or other Slurm client commands that send remote pro‐
168       cedure calls to slurmctld from loops in shell  scripts  or  other  pro‐
169       grams.  Ensure that programs limit calls to scancel to the minimum nec‐
170       essary for the information you are trying to gather.
171
172

ENVIRONMENT VARIABLES

174       Some scancel options may be set via environment variables. These  envi‐
175       ronment  variables,  along with their corresponding options, are listed
176       below.  (Note: Command line options will  always  override  these  set‐
177       tings.)
178
179
180       SCANCEL_ACCOUNT     -A, --account=account
181
182       SCANCEL_BATCH       -b, --batch
183
184       SCANCEL_CTLD        --ctld
185
186       SCANCEL_FULL        -f, --full
187
188       SCANCEL_HURRY       -H, --hurry
189
190       SCANCEL_INTERACTIVE -i, --interactive
191
192       SCANCEL_NAME        -n, --name=job_name
193
194       SCANCEL_PARTITION   -p, --partition=partition_name
195
196       SCANCEL_QOS         -q, --qos=qos
197
198       SCANCEL_STATE       -t, --state=job_state_name
199
200       SCANCEL_USER        -u, --user=user_name
201
202       SCANCEL_VERBOSE     -v, --verbose
203
204       SCANCEL_WCKEY       --wckey=wckey
205
206       SLURM_CONF          The location of the Slurm configuration file.
207
208       SLURM_CLUSTERS      -M, --clusters
209

NOTES

211       If multiple filters are supplied (e.g. --partition and --name) only the
212       jobs satisfying all of the filtering options will be signaled.
213
214       Cancelling a job step will not result in the job being terminated.  The
215       job must be cancelled to release a resource allocation.
216
217       To  cancel  a  job,  invoke scancel without --signal option.  This will
218       send first a SIGCONT to all steps to eventually wake them  up  followed
219       by a SIGTERM, then wait the KillWait duration defined in the slurm.conf
220       file and finally if they have not  terminated  send  a  SIGKILL.   This
221       gives time for the running job/step(s) to clean up.
222
223       If  a signal value of "KILL" is sent to an entire job, this will cancel
224       the active job steps but not cancel the job itself.
225
226       On Cray systems, all signals except SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP,
227       SIGTTIN,  SIGTTOU, SIGURG, or SIGWINCH cause the ALPS reservation to be
228       released.  The job however will not be terminated except in the case of
229       SIGKILL and may then be used for post processing.
230
231

AUTHORIZATION

233       When  using SlurmDBD, users who have an AdminLevel defined (Operator or
234       Admin) and users who are account coordinators are given  the  authority
235       to invoke scancel on other users jobs.
236
237

EXAMPLES

239       Send SIGTERM to steps 1 and 3 of job 1234:
240
241              $ scancel --signal=TERM 1234.1 1234.3
242
243
244       Cancel job 1234 along with all of its steps:
245
246              $ scancel 1234
247
248
249       Send  SIGKILL  to  all steps of job 1235, but do not cancel the job it‐
250       self:
251
252              $ scancel --signal=KILL 1235
253
254
255       Send SIGUSR1 to the batch shell processes of job 1236:
256
257              $ scancel --signal=USR1 --batch 1236
258
259
260       Cancel all pending jobs belonging to user "bob" in partition "debug":
261
262              $ scancel --state=PENDING --user=bob --partition=debug
263
264
265       Cancel only array ID 4 of job array 1237
266
267              $ scancel 1237_4
268
269

COPYING

271       Copyright (C) 2002-2007 The Regents of the  University  of  California.
272       Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
273       Copyright (C) 2008-2011 Lawrence Livermore National Security.
274       Copyright (C) 2010-2022 SchedMD LLC.
275
276       This  file  is  part  of Slurm, a resource management program.  For de‐
277       tails, see <https://slurm.schedmd.com/>.
278
279       Slurm is free software; you can redistribute it and/or modify it  under
280       the  terms  of  the GNU General Public License as published by the Free
281       Software Foundation; either version 2 of the License, or (at  your  op‐
282       tion) any later version.
283
284       Slurm  is  distributed  in the hope that it will be useful, but WITHOUT
285       ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY  or
286       FITNESS  FOR  A PARTICULAR PURPOSE.  See the GNU General Public License
287       for more details.
288
289

SEE ALSO

291       slurm_kill_job (3), slurm_kill_job_step (3)
292
293
294
295February 2022                   Slurm Commands                      scancel(1)
Impressum