1Slurm API(3) Slurm job and step update functions Slurm API(3)
2
3
4
6 slurm_init_job_desc_msg, slurm_init_update_step_msg, slurm_update_job,
7 slurm_update_job2, slurm_update_step - Slurm job and step update func‐
8 tions
9
10
12 #include <slurm/slurm.h>
13
14 void slurm_init_job_desc_msg (
15 job_desc_msg_t *job_desc_msg_ptr
16 );
17
18 void slurm_init_update_step_msg (
19 step_update_request_msg_t * step_msg
20 );
21
22 int slurm_update_job (
23 job_desc_msg_t * job_msg
24 );
25
26 int slurm_update_job2 (
27 job_desc_msg_t * job_msg,
28 job_array_resp_msg_t **resp
29 );
30
31 int slurm_update_step (
32 step_update_request_msg_t * step_msg
33 );
34
35 void slurm_free_job_array_resp (
36 job_array_resp_msg_t *resp
37 );
38
39
41 job_msg
42 Specifies the pointer to a job descriptor. See slurm.h for full
43 details on the data structure's contents.
44
45 step_msg
46 Specifies the pointer to a step descriptor. See slurm.h for
47 full details on the data structure's contents.
48
49 resp Array of error codes and job IDs. Always use the
50 slurm_free_job_array_resp function to release the memory allo‐
51 cated to hold the error codes.
52
53
55 slurm_init_job_desc_msg
56 Initialize the contents of a job descriptor with
57 default values. Execute this function before issuing
58 a request to submit or modify a job.
59
60 slurm_init_update_step_msg
61 Initialize the contents of a job step update descrip‐
62 tor with default values. Execute this function
63 before issuing a request to modify a job step.
64
65 slurm_update_job Update a job with the changes made to the data struc‐
66 ture passed as an argument to the function.
67
68 slurm_update_job2 Update a job or job array with the changes made to
69 the data structure passed as an argument to the func‐
70 tion. Call the function slurm_free_job_array_resp to
71 release memory allocated for the response array.
72
73 slurm_update_step Update a job step with the changes made to the data
74 structure passed as an argument to the function.
75
76 slurm_free_job_array_resp
77 Release memory allocated by the slurm_suspend2,
78 slurm_resume2, slurm_requeue2, and slurm_update_job2
79 functions.
80
81
83 On success, zero is returned. On error, -1 is returned, and the Slurm
84 error code is set appropriately. The function slurm_update_job2
85 returns zero if the resp array is filled, in which the that array
86 should be examined to determine the error codes for individual tasks of
87 a job array. Then call the function slurm_free_job_array_resp to
88 release memory allocated for the response array.
89
90
92 SLURM_PROTOCOL_VERSION_ERROR Protocol version has changed, re-link your
93 code.
94
95 ESLURM_ACCESS_DENIED The requesting user lacks authorization for the
96 requested action (e.g. trying to modify another user's job).
97
98 ESLURM_INVALID_JOB_ID Invalid job or step ID value.
99
100 ESLURM_INVALID_TIME_VALUE Invalid time value.
101
102
104 #include <stdio.h>
105 #include <slurm/slurm.h>
106 #include <slurm/slurm_errno.h>
107
108 int main (int argc, char *argv[])
109 {
110 job_desc_msg_t update_job_msg;
111 step_update_request_msg_t update_step_msg;
112
113 slurm_init_job_desc_msg( &update_job_msg );
114 update_job_msg.job_id = 1234;
115 update_job_msg time_limit = 200;
116 if (slurm_update_job (&update_job_msg)) {
117 slurm_perror ("slurm_update_job error");
118 exit (1);
119 }
120
121 slurm_init_update_step_msg( &update_step_msg );
122 update_step_msg.job_id = 1234;
123 update_step_msg.step_id = 2;
124 update_step_msg time_limit = 30;
125 if (slurm_update_step (&update_step_msg)) {
126 slurm_perror ("slurm_update_step error");
127 exit (1);
128 }
129 exit (0);
130 }
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 2009-2010 Lawrence Livermore National Security. Produced at Lawrence
141 Livermore National Laboratory (cf, DISCLAIMER). CODE-OCEC-09-009. All
142 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), slurm_free_job_array_resp(3), slurm_get_errno(3),
160 slurm_perror(3), slurm_strerror(3),
161
162
163
164April 2015 Slurm job and step update functions Slurm API(3)