diff --git a/doc/man/man3/hostlist_create.3 b/doc/man/man3/hostlist_create.3 index da62704a7a85e6ebae30e4ab39ed4f0fb8ab8804..4fb4c7ccb7487a06926334bf028a80fe439a576c 100644 --- a/doc/man/man3/hostlist_create.3 +++ b/doc/man/man3/hostlist_create.3 @@ -1,4 +1,4 @@ -.TH "Slurm API" "3" "November 2002" "Morris Jette" "Slurm host list support functions" +.TH "Slurm API" "3" "January 2003" "Morris Jette" "Slurm host list support functions" .SH "NAME" hostlist_create \- Slurm host list support functions .SH "SYNTAX" @@ -81,7 +81,7 @@ int main (int argc, char *argv[]) .br if (my_hostlist == NULL) { .br - fprintf (stderr, "No memory\n"); + fprintf (stderr, "No memory\\n"); .br exit (1); .br @@ -89,7 +89,7 @@ int main (int argc, char *argv[]) .LP while ( (host = hostlist_shift(my_hostlist)) ) .br - printf ("host = %s\n", host); + printf ("host = %s\\n", host); .LP hostlist_destroy (my_hostlist) ; .br diff --git a/doc/man/man3/slurm_allocate_resources.3 b/doc/man/man3/slurm_allocate_resources.3 index 3698153bc082d10257377684baf25c1920c65ce5..577c933edfc9a726d4e63d16615563d9a26f0f09 100644 --- a/doc/man/man3/slurm_allocate_resources.3 +++ b/doc/man/man3/slurm_allocate_resources.3 @@ -1,4 +1,4 @@ -.TH "Slurm API" "3" "December 2002" "Morris Jette" "Slurm job initiation functions" +.TH "Slurm API" "3" "January 2003" "Morris Jette" "Slurm job initiation functions" .SH "NAME" slurm_allocate_resources, slurm_allocate_resources_and_run, slurm_confirm_allocation, @@ -232,7 +232,7 @@ int main (int argc, char *argv[]) .br } .br - printf ("Allocated nodes %s to job_id %u\n", + printf ("Allocated nodes %s to job_id %u\\n", .br slurm_alloc_msg_ptr->node_list, .br @@ -242,13 +242,13 @@ int main (int argc, char *argv[]) .br job_id)) { .br - printf ("cancel errno %d\n", slurm_get_errno()); + printf ("cancel errno %d\\n", slurm_get_errno()); .br exit (1); .br } .br - printf ("canceled job_id %u\n", + printf ("canceled job_id %u\\n", .br slurm_alloc_msg_ptr->job_id ); .br diff --git a/doc/man/man3/slurm_free_ctl_conf.3 b/doc/man/man3/slurm_free_ctl_conf.3 index 253c6fc09532ae77446b6694384e58018d1e885c..6cffc5a21e41903241329263994131a846f86c86 100644 --- a/doc/man/man3/slurm_free_ctl_conf.3 +++ b/doc/man/man3/slurm_free_ctl_conf.3 @@ -100,11 +100,11 @@ int main (int argc, char *argv[]) .LP /* The hard way */ .br - printf ("control_machine = %s\n", + printf ("control_machine = %s\\n", .br slurm_ctl_conf_ptr->control_machine); .br - printf ("server_timeout = %u\n", + printf ("server_timeout = %u\\n", .br slurm_ctl_conf_ptr->server_timeout); .LP diff --git a/doc/man/man3/slurm_free_job_info_msg.3 b/doc/man/man3/slurm_free_job_info_msg.3 index 5b11099fd0a762a42e623396795eb8e10ffdbbc6..154cd16a80f283ff7177ca89e328d0f1fb30fd91 100644 --- a/doc/man/man3/slurm_free_job_info_msg.3 +++ b/doc/man/man3/slurm_free_job_info_msg.3 @@ -1,4 +1,4 @@ -.TH "Slurm API" "3" "October 2002" "Morris Jette" "Slurm job information reporting functions" +.TH "Slurm API" "3" "January 2003" "Morris Jette" "Slurm job information reporting functions" .SH "NAME" slurm_free_job_info_msg, slurm_load_jobs, slurm_print_job_info, slurm_print_job_info_msg @@ -8,6 +8,8 @@ slurm_print_job_info, slurm_print_job_info_msg #include <stdio.h> .br #include <slurm.h> +.br +#include <sys/types.h> .LP void \fBslurm_free_job_info_msg\fR ( .br @@ -23,9 +25,17 @@ int \fBslurm_load_jobs\fR ( .br ); .LP +int \fBslurm_pid2jobid\fR ( +.br + pid_t \fIjob_pid\fP, +.br + uint32_t *\fIjob_id_ptr\fP +.br +); +.LP void \fBslurm_print_job_info\fR ( .br - FILE *\fIout_file\fp, + FILE *\fIout_file\fP, .br job_info_t *\fIjob_ptr\fP .br @@ -33,7 +43,7 @@ void \fBslurm_print_job_info\fR ( .LP void \fBslurm_print_job_info_msg\fR ( .br - FILE *\fIout_file\fp, + FILE *\fIout_file\fP, .br job_info_msg_t *\fIjob_info_msg_ptr\fP .br @@ -51,14 +61,20 @@ of integers with pairs of start and end index number into the node information records and the data is terminated with a value of -1. See slurm.h for full details on the data structure's contents. .TP +\fIjob_id_ptr\fP +Specifies a pointer to a storage location into which a Slurm job id may be placed. +.TP \fIjob_info_msg_ptr\fP Specifies the pointer to the structure created by \fBslurm_load_jobs\fR. +.TP +\fIjob_pid\fP +Specifies a process id of some process on the current node. .TP \fIjob_ptr\fP Specifies a pointer to a single job records from the \fIjob_info_msg_ptr\fP data structure. .TP -\fIout_file\ +\fIout_file\fP Specifies the file to print data to. .TP \fIupdate_time\fP @@ -70,6 +86,8 @@ function. .LP \fBslurm_load_jobs\fR Returns a job_info_msg_t that contains an update time, record count, and array of job_table records for all jobs. .LP +\fBslurm_pid2jobid\fR Returns a Slurm job id corresponding to the supplied local process id. +.LP \fBslurm_print_job_info\fR Prints the contents of the data structure describing a single job records from the data loaded by the \fBslurm_load_node\fR function. .LP @@ -88,6 +106,8 @@ On success, zero is returned. On error, -1 is returned, and Slurm error code is #include <stdio.h> .br #include <slurm.h> +.br +#include <sys/types.h> .LP int main (int argc, char *argv[]) .br @@ -98,6 +118,8 @@ int main (int argc, char *argv[]) job_info_msg_t * job_info_msg = NULL; .br job_info_t * job_ptr; +.br + uint32_t job_id; .LP /* get and dump some job information */ .br @@ -127,7 +149,7 @@ int main (int argc, char *argv[]) .LP /* The hardest way. */ .br - printf ("Jobs updated at %lx, record count %d\n", + printf ("Jobs updated at %lx, record count %d\\n", .br job_buffer_ptr->last_update, .br @@ -135,7 +157,7 @@ int main (int argc, char *argv[]) .br for (i = 0; i < job_buffer_ptr->record_count; i++) { .br - printf ("JobId=%u UserId=%u\n", + printf ("JobId=%u UserId=%u\\n", .br job_buffer_ptr->job_array[i].job_id, .br @@ -144,6 +166,14 @@ int main (int argc, char *argv[]) } .LP slurm_free_job_info_msg (job_buffer_ptr); +.LP + if (slurm_pid2jobid (getpid(), &job_id)) +.br + slurm_perror ("slurm_load_jobs error"); +.br + else +.br + printf ("Slurm job id = %u\\n", job_id); .br exit (0); .br diff --git a/doc/man/man3/slurm_free_job_step_info_response_msg.3 b/doc/man/man3/slurm_free_job_step_info_response_msg.3 index bce4dc6dd80987f1757e52ba0c50849bfbf437ef..8f19c854bbfc0fb488cae93b53ea51ac0d4dd10c 100644 --- a/doc/man/man3/slurm_free_job_step_info_response_msg.3 +++ b/doc/man/man3/slurm_free_job_step_info_response_msg.3 @@ -1,4 +1,4 @@ -.TH "Slurm API" "3" "October 2002" "Morris Jette" "Slurm job step information functions" +.TH "Slurm API" "3" "January 2003" "Morris Jette" "Slurm job step information functions" .SH "NAME" \fBslurm_free_job_step_info_response_msg, slurm_get_job_steps, slurm_print_job_step_info, slurm_print_job_step_info_msg @@ -142,7 +142,7 @@ int main (int argc, char *argv[]) .LP /* The hardest way. */ .br - printf ("Steps updated at %lx, record count %d\n", + printf ("Steps updated at %lx, record count %d\\n", .br step_info_ptr->last_update, .br @@ -150,7 +150,7 @@ int main (int argc, char *argv[]) .br for (i = 0; i < step_info_ptr->job_step_count; i++) { .br - printf ("JobId=%u StepId=%u\n", + printf ("JobId=%u StepId=%u\\n", .br step_info_ptr->job_steps[i].job_id, .br diff --git a/doc/man/man3/slurm_free_node_info.3 b/doc/man/man3/slurm_free_node_info.3 index 94adb48a5b574ae9c33f428aa1bd5343bc66a6f9..5d76bac282f515d4c7fea9fe9e8e7f543e9e443a 100644 --- a/doc/man/man3/slurm_free_node_info.3 +++ b/doc/man/man3/slurm_free_node_info.3 @@ -1,4 +1,4 @@ -.TH "Slurm API" "3" "October 2002" "Morris Jette" "Slurm node informational calls" +.TH "Slurm API" "3" "January 2003" "Morris Jette" "Slurm node informational calls" .SH "NAME" slurm_free_node_info, slurm_load_node, slurm_print_node_info_msg, slurm_print_node_table @@ -141,7 +141,7 @@ int main (int argc, char *argv[]) .br for (i = 0; i < node_buffer_ptr->node_count; i++) { .br - printf ("NodeName=%s CPUs=%u\n", + printf ("NodeName=%s CPUs=%u\\n", .br node_buffer_ptr->node_array[i].name, .br @@ -195,7 +195,7 @@ int main (int argc, char *argv[]) .br } .br - printf("\n\n"); + printf("\\n\\n"); .br } .br diff --git a/doc/man/man3/slurm_free_partition_info.3 b/doc/man/man3/slurm_free_partition_info.3 index c37d4f288877ce2facff3718caf007d1998dd773..a05620bfc855addc3a47cec6a3405a5388c65801 100644 --- a/doc/man/man3/slurm_free_partition_info.3 +++ b/doc/man/man3/slurm_free_partition_info.3 @@ -1,4 +1,4 @@ -.TH "Slurm API" "3" "October 2002" "Morris Jette" "Slurm partition information reporting functions" +.TH "Slurm API" "3" "January 2003" "Morris Jette" "Slurm partition information reporting functions" .SH "NAME" slurm_free_partition_info, slurm_load_partitions, slurm_print_partition_info, slurm_print_partition_info_msg @@ -118,7 +118,7 @@ int main (int argc, char *argv[]) .LP /* The hardest way. */ .br - printf("Partitions updated at %lx, records=%d\n", + printf("Partitions updated at %lx, records=%d\\n", .br part_buffer_ptr->last_update, .br @@ -126,7 +126,7 @@ int main (int argc, char *argv[]) .br for (i = 0; i < part_buffer_ptr->record_count; i++) { .br - printf ("PartitionName=%s Nodes=%s\n", + printf ("PartitionName=%s Nodes=%s\\n", .br part_info_ptr->partition_array[i].name, .br diff --git a/doc/man/man3/slurm_get_errno.3 b/doc/man/man3/slurm_get_errno.3 index 4b608f125c9f215ace8e9a1449ad7aa2380903aa..7d83a31cc64a047c39a69a3be40e2b176c065d47 100644 --- a/doc/man/man3/slurm_get_errno.3 +++ b/doc/man/man3/slurm_get_errno.3 @@ -1,4 +1,4 @@ -.TH "Slurm API" "3" "October 2002" "Morris Jette" "Slurm error handling functions" +.TH "Slurm API" "3" "January 2003" "Morris Jette" "Slurm error handling functions" .SH "NAME" slurm_get_errno, slurm_perror, slurm_strerror \- Slurm error handling functions .SH "SYNTAX" @@ -48,11 +48,11 @@ int main (int argc, char *argv[]) .br /* assume Slurm API function failed here */ .br - fprintf (stderr, "Slurm function errno = %d\n", + fprintf (stderr, "Slurm function errno = %d\\n", .br slurm_get_errno ()); .br - fprintf (stderr, "Slurm function errno = %d %s\n", + fprintf (stderr, "Slurm function errno = %d %s\\n", .br slurm_get_errno (), .br @@ -93,10 +93,11 @@ details. \fBslurm_free_resource_allocation_response_msg\fR(3), \fBslurm_free_submit_response_response_msg\fR(3), \fBslurm_get_job_steps\fR(3), -\fBslurm_init_job_desc_msg\fR(3), \fBslurm_init_part_desc_msg\fR(3), +\fBslurm_init_job_desc_msg\fR(3), \fBslurm_init_part_desc_msg\fR(3), \fBslurm_job_step_create\fR(3), \fBslurm_job_will_run\fR(3), \fBslurm_load_ctl_conf\fR(3), \fBslurm_load_jobs\fR(3), \fBslurm_load_node\fR(3), \fBslurm_load_partitions\fR(3), +\fBslurm_pid2jobid\fR(3), \fBslurm_reconfigure\fR(3), \fBslurm_shutdown\fR(3), \fBslurm_submit_batch_job\fR(3), \fBslurm_update_job\fR(3), \fBslurm_update_node\fR(3), \fBslurm_update_partition\fR(3) diff --git a/doc/man/man3/slurm_pid2jobid.3 b/doc/man/man3/slurm_pid2jobid.3 new file mode 100644 index 0000000000000000000000000000000000000000..836ffa79b478c25f79af77cc002dc816f26891c0 --- /dev/null +++ b/doc/man/man3/slurm_pid2jobid.3 @@ -0,0 +1 @@ +.so man3/slurm_free_job_info_msg.3