Skip to content
Snippets Groups Projects
Commit 46078e8b authored by Phil Eckert's avatar Phil Eckert
Browse files

bring coding example up to date.

parent b0c2210c
No related branches found
No related tags found
No related merge requests found
...@@ -289,6 +289,8 @@ SLURM controller. ...@@ -289,6 +289,8 @@ SLURM controller.
.LP .LP
#include <stdio.h> #include <stdio.h>
.br .br
#include <stdlib.h>
.br
#include <slurm/slurm.h> #include <slurm/slurm.h>
.br .br
#include <slurm/slurm_errno.h> #include <slurm/slurm_errno.h>
...@@ -301,7 +303,7 @@ int main (int argc, char *argv[]) ...@@ -301,7 +303,7 @@ int main (int argc, char *argv[])
.br .br
int i; int i;
.br .br
job_info_msg_t * job_info_msg = NULL; job_info_msg_t * job_buffer_ptr = NULL;
.br .br
job_info_t * job_ptr; job_info_t * job_ptr;
.br .br
...@@ -321,7 +323,7 @@ int main (int argc, char *argv[]) ...@@ -321,7 +323,7 @@ int main (int argc, char *argv[])
.LP .LP
/* The easy way to print... */ /* The easy way to print... */
.br .br
slurm_print_job_info_msg (stdout, job_buffer_ptr); slurm_print_job_info_msg (stdout, job_buffer_ptr, 0);
.LP .LP
/* A harder way.. */ /* A harder way.. */
.br .br
...@@ -329,7 +331,7 @@ int main (int argc, char *argv[]) ...@@ -329,7 +331,7 @@ int main (int argc, char *argv[])
.br .br
job_ptr = &job_buffer_ptr\->job_array[i]; job_ptr = &job_buffer_ptr\->job_array[i];
.br .br
slurm_print_job_info(stdout, job_ptr); slurm_print_job_info(stdout, job_ptr, 1);
.br .br
} }
.LP .LP
...@@ -353,21 +355,21 @@ int main (int argc, char *argv[]) ...@@ -353,21 +355,21 @@ int main (int argc, char *argv[])
.LP .LP
if (job_buffer_ptr\->record_count >= 1) { if (job_buffer_ptr\->record_count >= 1) {
.br .br
uint16_t rotate; uint16_t nodes;
.br .br
if (slurm_get_select_jobinfo( if (slurm_get_select_jobinfo(
.br .br
job_buffer_ptr\->job_array[0].select_jobinfo, job_buffer_ptr\->job_array[0].select_jobinfo,
.br .br
SELECT_DATA_ROTATE, SELECT_JOBDATA_NODE_CNT,
.br .br
&rotate) == SLURM_SUCCESS) &nodes) == SLURM_SUCCESS)
.br .br
printf("JobId=%u Rotate=%u\\n", printf("JobId=%u Nodes=%u\\n",
.br .br
job_buffer_ptr\->job_array[0].job_id, job_buffer_ptr\->job_array[0].job_id,
.br .br
rotate); nodes);
.br .br
} }
.LP .LP
...@@ -380,7 +382,7 @@ int main (int argc, char *argv[]) ...@@ -380,7 +382,7 @@ int main (int argc, char *argv[])
else else
.br .br
printf ("Slurm job id = %u\\n", job_id); printf ("Slurm job id = %u\\n", job_id);
.br .LP
exit (0); exit (0);
.br .br
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment