1Slurm API(3) Slurm suspend, resume and requeue functions Slurm API(3)
2
3
4
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
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
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
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 ignoring any previous checkpoint.
92
93 slurm_requeue2 Requeue a running or pending Slurm batch job or job
94 array. The job script will be restarted from its
95 beginning, ignoring any previous checkpoint. Call
96 the function slurm_free_job_array_resp to release
97 memory allocated for the response array.
98
99 slurm_free_job_array_resp
100 Release memory allocated by the slurm_suspend2,
101 slurm_resume2, slurm_requeue2, and slurm_update_job2
102 functions.
103
104
106 Zero is returned upon success. On error, -1 is returned, and the Slurm
107 error code is set appropriately. Functions slurm_suspend2,
108 slurm_resume2, and slurm_requeue2 return zero if the resp array is
109 filled, in which the that array should be examined to determine the
110 error codes for individual tasks of a job array. Then call the func‐
111 tion slurm_free_job_array_resp to release memory allocated for the
112 response array.
113
114
116 ESLURM_DISABLED the operation is currently disabled (e.g. attempt to
117 suspend a job that is not running, resume a job that is not currently
118 suspended, or requeue a job on which the operation has been disabled).
119
120 ESLURM_INVALID_JOB_ID the requested job id does not exist.
121
122 ESLURM_ACCESS_DENIED the requesting user lacks authorization for the
123 requested action (e.g. not user root or SlurmUser).
124
125 ESLURM_JOB_PENDING the requested job is still pending.
126
127 ESLURM_ALREADY_DONE the requested job has already completed.
128
129 ESLURM_NOT_SUPPORTED the requested operation is not supported on this
130 system.
131
132
134 These functions are included in the libslurm library, which must be
135 linked to your process for use (e.g. "cc -lslurm myprog.c").
136
137
139 Portions copyright (C) 2014 SchedMD LLC. Portions copyright (C)
140 2005-2006 The Regents of the University of California. Produced at
141 Lawrence Livermore National Laboratory (cf, DISCLAIMER).
142 CODE-OCEC-09-009. All rights reserved.
143
144 This file is part of Slurm, a resource management program. For
145 details, see <https://slurm.schedmd.com/>.
146
147 Slurm is free software; you can redistribute it and/or modify it under
148 the terms of the GNU General Public License as published by the Free
149 Software Foundation; either version 2 of the License, or (at your
150 option) any later version.
151
152 Slurm is distributed in the hope that it will be useful, but WITHOUT
153 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
154 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
155 for more details.
156
157
159 scontrol(1)
160
161
162
163April 2015 Slurm suspend, resume and requeue functions Slurm API(3)