1Slurm API(3)      Slurm suspend, resume and requeue functions     Slurm API(3)
2
3
4

NAME

6       slurm_suspend,     slurm_suspend2,     slurm_resume,     slurm_resume2,
7       slurm_requeue, slurm_requeue2, slurm_free_job_array_resp  - Slurm  sus‐
8       pend, resume and requeue functions
9
10

SYNTAX

12       #include <slurm/slurm.h>
13
14       int slurm_suspend (
15            uint32_t job_id
16       );
17
18       int slurm_suspend2 (
19               char * job_id_str,
20               job_array_resp_msg_t **resp
21       );
22
23       int slurm_resume (
24            uint32_t job_id
25       );
26
27       int slurm_resume2 (
28               char * job_id_str,
29               job_array_resp_msg_t **resp
30       );
31
32       int slurm_requeue (
33               uint32_t job_id,
34               uint32_t state
35       );
36
37       int slurm_requeue2 (
38            char * job_id_str,
39               uint32_t state,
40               job_array_resp_msg_t **resp
41       );
42
43       void slurm_free_job_array_resp (
44               job_array_resp_msg_t *resp
45       );
46
47

ARGUMENTS

49       job_id Slurm job ID to perform the operation upon in numeric form.
50
51       job_id_str
52              Slurm job ID to perform the operation upon in string form.  This
53              is intended to be a single job.  For job arrays, the job ID  may
54              be  followed  by an underscore and task ID values.  For example:
55              "123", "123_4", "123_4-6", "123_4,6,8", and  "123_4-6,18".   The
56              functions  using this option are designed primarily for use with
57              job arrays so that separate error codes can be returned for each
58              task of the job array.
59
60       resp   Array   of   error   codes   and   job   IDs.   Always  use  the
61              slurm_free_job_array_resp function to release the  memory  allo‐
62              cated to hold the error codes.
63
64       state  The state in which the job should be requeued valid values are:
65
66              "0"                 If the job has to be requeued in JOB_PENDING
67                                  state.
68
69              "JOB_SPECIAL_EXIT"  If the job has to be requeued in the special
70                                  exit state and be held.
71
72              "JOB_REQUEUE_HOLD"  If  the job has to be requeued in "JOB_PEND‐
73                                  ING" and held state.
74
75

DESCRIPTION

77       slurm_suspend     Suspend the specified job.
78
79       slurm_suspend2    Suspend the specified job or  job  array.   Call  the
80                         function  slurm_free_job_array_resp to release memory
81                         allocated for the response array.
82
83       slurm_resume      Resume execution of a previously suspended job.
84
85       slurm_resume2     Resume execution of a previously suspended job or job
86                         array.   Call  the function slurm_free_job_array_resp
87                         to release memory allocated for the response array.
88
89       slurm_requeue     Requeue a running or pending Slurm  batch  job.   The
90                         job script will be restarted from its beginning.
91
92       slurm_requeue2    Requeue  a  running or pending Slurm batch job or job
93                         array.  The job script will  be  restarted  from  its
94                         beginning.          Call         the         function
95                         slurm_free_job_array_resp to release memory allocated
96                         for the response array.
97
98       slurm_free_job_array_resp
99                         Release   memory  allocated  by  the  slurm_suspend2,
100                         slurm_resume2, slurm_requeue2, and  slurm_update_job2
101                         functions.
102
103

RETURN VALUE

105       Zero is returned upon success.  On error, -1 is returned, and the Slurm
106       error   code   is   set   appropriately.    Functions   slurm_suspend2,
107       slurm_resume2,  and  slurm_requeue2  return  zero  if the resp array is
108       filled, in which the that array should be  examined  to  determine  the
109       error  codes  for individual tasks of a job array.  Then call the func‐
110       tion slurm_free_job_array_resp to  release  memory  allocated  for  the
111       response array.
112
113

ERRORS

115       ESLURM_DISABLED  the  operation  is currently disabled (e.g. attempt to
116       suspend a job that is not running, resume a job that is  not  currently
117       suspended, or requeue a job on which the operation has been disabled).
118
119       ESLURM_INVALID_JOB_ID the requested job id does not exist.
120
121       ESLURM_ACCESS_DENIED  the  requesting  user lacks authorization for the
122       requested action (e.g. not user root or SlurmUser).
123
124       ESLURM_JOB_PENDING the requested job is still pending.
125
126       ESLURM_ALREADY_DONE the requested job has already completed.
127
128       ESLURM_NOT_SUPPORTED the requested operation is not supported  on  this
129       system.
130
131

NOTE

133       These  functions  are  included  in the libslurm library, which must be
134       linked to your process for use (e.g. "cc -lslurm myprog.c").
135
136

COPYING

138       Portions copyright  (C)  2014  SchedMD  LLC.   Portions  copyright  (C)
139       2005-2006  The  Regents  of  the University of California.  Produced at
140       Lawrence    Livermore    National    Laboratory    (cf,    DISCLAIMER).
141       CODE-OCEC-09-009. All rights reserved.
142
143       This  file  is  part  of  Slurm,  a  resource  management program.  For
144       details, see <https://slurm.schedmd.com/>.
145
146       Slurm is free software; you can redistribute it and/or modify it  under
147       the  terms  of  the GNU General Public License as published by the Free
148       Software Foundation; either version 2  of  the  License,  or  (at  your
149       option) any later version.
150
151       Slurm  is  distributed  in the hope that it will be useful, but WITHOUT
152       ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY  or
153       FITNESS  FOR  A PARTICULAR PURPOSE.  See the GNU General Public License
154       for more details.
155
156

SEE ALSO

158       scontrol(1)
159
160
161
162November 2019     Slurm suspend, resume and requeue functions     Slurm API(3)
Impressum