|
Lines 47-63
implemented must be stubbed.
Link Here
|
| 47 |
|
47 |
|
| 48 |
<p class="commandline">int jobacct_gather_p_poll_data(List task_list, bool pgid_plugin, uint64_t cont_id) |
48 |
<p class="commandline">int jobacct_gather_p_poll_data(List task_list, bool pgid_plugin, uint64_t cont_id) |
| 49 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
49 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 50 |
jobacct_gather_p_poll_data() Build a table of all current processes. |
50 |
Build a table of all current processes. |
| 51 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
51 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 52 |
<span class="commandline"> task_list</span> (in/out) List containing |
52 |
<span class="commandline"> task_list</span> (in/out) List containing |
| 53 |
current processes <br> |
53 |
current processes <br> |
| 54 |
<span class="commandline"> pgid_plugin</span> (input) if we are |
54 |
<span class="commandline"> pgid_plugin</span> (input) if we are |
| 55 |
running with the pgid plugin |
55 |
running with the pgid plugin<br> |
| 56 |
<span class="commandline"> cont_id</span> (input) container id of processes if not running with pgid |
56 |
<span class="commandline"> cont_id</span> (input) container id of processes if not running with pgid |
| 57 |
|
57 |
|
| 58 |
<p class="commandline">int jobacct_gather_p_endpoll() |
58 |
<p class="commandline">int jobacct_gather_p_endpoll() |
| 59 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
59 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 60 |
jobacct_gather_p_endpoll() is called when the process is finished to stop the |
60 |
Called when the process is finished to stop the |
| 61 |
polling thread. |
61 |
polling thread. |
| 62 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
62 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 63 |
<span class="commandline">none</span> |
63 |
<span class="commandline">none</span> |
|
Lines 67-73
polling thread.
Link Here
|
| 67 |
|
67 |
|
| 68 |
<p class="commandline">int jobacct_gather_p_add_task(pid_t pid, uint16_t tid) |
68 |
<p class="commandline">int jobacct_gather_p_add_task(pid_t pid, uint16_t tid) |
| 69 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
69 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 70 |
jobacct_gather_p_add_task() used to add a task to the poller. |
70 |
Used to add a task to the poller. |
| 71 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
71 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 72 |
<span class="commandline"> pid</span> (input) Process id <br> |
72 |
<span class="commandline"> pid</span> (input) Process id <br> |
| 73 |
<span class="commandline"> tid</span> (input) slurm global task id |
73 |
<span class="commandline"> tid</span> (input) slurm global task id |
|
Lines 76-81
jobacct_gather_p_add_task() used to add a task to the poller.
Link Here
|
| 76 |
<span class="commandline">SLURM_ERROR</span> on failure. |
76 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 77 |
|
77 |
|
| 78 |
|
78 |
|
|
|
79 |
|
| 80 |
<h2>Job Account Gathering</h2> |
| 81 |
<p>All of the following functions are not required but may be used. |
| 82 |
|
| 83 |
<p class="commandline">int jobacct_gather_init(void) |
| 84 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 85 |
Loads the job account gather plugin. |
| 86 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 87 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 88 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 89 |
|
| 90 |
<p class="commandline">int jobacct_gather_fini(void) |
| 91 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 92 |
Unloads the job account gathering plugin. |
| 93 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 94 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 95 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 96 |
|
| 97 |
<p class="commandline">int jobacct_gather_startpoll(uin16_t fequency) |
| 98 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 99 |
Creates and starts the polling thread. |
| 100 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 101 |
<span class="commandline"> fequency </span> (input) frequency of the polling. |
| 102 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 103 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 104 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 105 |
|
| 106 |
<p class="commandline">void jobacct_gather_change_poll(uint16_t frequency) |
| 107 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 108 |
Changes the polling thread to a new frequency. |
| 109 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 110 |
<span class="commandline"> fequency </span> (input) frequency of the polling |
| 111 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 112 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 113 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 114 |
|
| 115 |
<p class="commandline">void jobacct_gather_suspend_poll() |
| 116 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 117 |
Temporarily stops the polling thread. |
| 118 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 119 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 120 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 121 |
|
| 122 |
<p class="commandline">void jobacct_gather_resume_poll() |
| 123 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 124 |
Resumes the polling thread that was stopped. |
| 125 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 126 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 127 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 128 |
|
| 129 |
<p class="commandine">jobacctinfo_t *jobacct_gather_stat_task(pid_t |
| 130 |
pid) |
| 131 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 132 |
Gets the basis of the information of the task. |
| 133 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 134 |
<span class="commandline">pid</span> (input) process id. |
| 135 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 136 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 137 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 138 |
|
| 139 |
<p class="commandline">jobacctinfo_t *jobacct_gather_remove_task(pid_t pid) |
| 140 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 141 |
Removes the task. |
| 142 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 143 |
<span class="commandline">pid</span> (input) process id. |
| 144 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 145 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 146 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 147 |
|
| 148 |
<p class="commandline">int |
| 149 |
jobacct_gather_set_proctrack_container_id(uint64_t id) |
| 150 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 151 |
Sets the proctrack container to a given id. |
| 152 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 153 |
<span class="commandline">id</span> (input) id to set. |
| 154 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 155 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 156 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 157 |
|
| 158 |
|
| 159 |
<p class="commandline">int jobacct_gather_set_mem_limit(uint32_t job_id, |
| 160 |
uint32_t step_id,uint32_t mem_limit) |
| 161 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 162 |
Sets the memory limit of the job account. |
| 163 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 164 |
<span class="commandline">job_id</span> (input) id of the job.<br> |
| 165 |
<span class="commandline">sted_id</span> (input) id of the step.<br> |
| 166 |
<span class="commandline">mem_limit</span> (input) memory limit in MB. |
| 167 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 168 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 169 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 170 |
|
| 171 |
<p class="commandline">void jobacct_gather_handle_mem_limit(uint32_t total_job_mem, uint32_t total_job_vsize) |
| 172 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 173 |
Called to find out how much memory is used. |
| 174 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 175 |
<span class="commandline"> total_job_mem</span> (input) total |
| 176 |
amount of memory for jobs.<br> |
| 177 |
<span class="commandline"> total_job_vsize</span> (input) the |
| 178 |
total job size. |
| 179 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 180 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 181 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 182 |
|
| 183 |
<h2>Job Account Info</h2> |
| 184 |
<p>All of the following functions are not required but may be used. |
| 185 |
|
| 186 |
<p class="commandline">jobacctinfo_t *jobacctinfo_create(jobacct_id_t |
| 187 |
*jobacct_id) |
| 188 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 189 |
Creates the job account info. |
| 190 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 191 |
<span class="commandline"> jobacct_id</span> (input) the job |
| 192 |
account id. |
| 193 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 194 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 195 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 196 |
|
| 197 |
<p class="commandline">void jobacctinfo_destroy(void *object) |
| 198 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 199 |
Destroys the job account info. |
| 200 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 201 |
<span class="commandline"> object</span> (input) the job that needs to be destroyed |
| 202 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 203 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 204 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 205 |
|
| 206 |
<p class="commandline">int jobacctinfo_setinfo(jobacctinfo_t *jobacct, enum jobacct_data_type type, void *data) |
| 207 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 208 |
Set the information for the job. |
| 209 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 210 |
<span class="commandline"> jobacct</span> (input) job account<br> |
| 211 |
<span class="commandline"> type</span>(input) enum telling the plugin how to transform the data.<br> |
| 212 |
<span class="commandline"> data</span> (input/output) Is a void * and |
| 213 |
the actual data type depends upon the first argument to this function (type). |
| 214 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 215 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 216 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 217 |
|
| 218 |
<p class="commandline">int jobacctinfo_getinfo(jobacctinfo_t *jobacct, enum jobacct_data_type type, void *data) |
| 219 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 220 |
Gets the information about the job. |
| 221 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 222 |
<span class="commandline"> jobacct</span> (input) job account.<br> |
| 223 |
<span class="commandline">type</span> (input) the |
| 224 |
data type of the job account. |
| 225 |
<span class="commandline">data</span> |
| 226 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 227 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 228 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 229 |
|
| 230 |
<p class="commandline"> void jobacctinfo_pack(jobacctinfo_t *jobacct, |
| 231 |
uint16_t rpc_version, Buf buffer) |
| 232 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 233 |
Packs the job account information. |
| 234 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 235 |
<span class="commandline">jobacct</span> (input) the job account.<br> |
| 236 |
<span class="commandline">rpc_version</span> (input) the |
| 237 |
rpc version.<br> |
| 238 |
<span class="commandline">buffer</span> (input) the buffer. |
| 239 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 240 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 241 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 242 |
|
| 243 |
<p class="commandline">int jobacctinfo_unpack(jobacctinfo_t **jobacct, |
| 244 |
uint16_t rpc_version, Buf buffer) |
| 245 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 246 |
Unpacks the job account information. |
| 247 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 248 |
<span class="commandline">jobacct</span> (input) the job account.<br> |
| 249 |
<span class="commandline">rpc_version</span> (input) the rpc |
| 250 |
version.<br> |
| 251 |
<span class="commandline">buffer</span> (input) the buffer. |
| 252 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 253 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 254 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 255 |
|
| 256 |
<p class="commandline">void jobacctinfo_aggregate(jobacctinfo_t *dest, jobacctinfo_t *from) |
| 257 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 258 |
Aggregates the jobs. |
| 259 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 260 |
<span class="commandline">dest</span> (input) New destination of the job.<br> |
| 261 |
<span class="commandline">from</span> (input) Original location of job. |
| 262 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 263 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 264 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 265 |
|
| 266 |
<p class="commandline">void jobacctinfo_2_stats(slurmdb_stats_t *stats, jobacctinfo_t *jobacct) |
| 267 |
<p style="margin-left:.2in"><b>Description</b>:<br> |
| 268 |
Gets the stats of the job in accounting. |
| 269 |
<p style="margin-left:.2in"><b>Arguments</b>: <br> |
| 270 |
<span class="commandline">stats</span> (input) slurm data base stat.<br> |
| 271 |
<span class="commandline">jobacct</span> (input) the job account. |
| 272 |
<p style="margin-left:.2in"><b>Returns</b>: <br> |
| 273 |
<span class="commandline">SLURM_SUCCESS</span> on success, or<br> |
| 274 |
<span class="commandline">SLURM_ERROR</span> on failure. |
| 275 |
|
| 79 |
<p class="footer"><a href="#top">top</a> |
276 |
<p class="footer"><a href="#top">top</a> |
| 80 |
|
277 |
|
| 81 |
|
278 |
|
|
Lines 94-99
plugin and the frequency at which to gather information about running jobs.
Link Here
|
| 94 |
releases of SLURM may revise this API. A job accounting gather plugin conveys its |
291 |
releases of SLURM may revise this API. A job accounting gather plugin conveys its |
| 95 |
ability to implement a particular API version using the mechanism outlined |
292 |
ability to implement a particular API version using the mechanism outlined |
| 96 |
for SLURM plugins. |
293 |
for SLURM plugins. |
|
|
294 |
|
| 97 |
<p class="footer"><a href="#top">top</a> |
295 |
<p class="footer"><a href="#top">top</a> |
| 98 |
|
296 |
|
| 99 |
<p style="text-align:center;">Last modified 29 May 2012</p> |
297 |
<p style="text-align:center;">Last modified 29 May 2012</p> |