| .TH "Slurm API" "3" "April 2007" "Morris Jette" "Slurm informational calls" |
| |
| .SH "NAME" |
| slurm_free_ctl_conf, slurm_load_ctl_conf, |
| slurm_print_ctl_conf \- Slurm information reporting functions |
| |
| .SH "SYNTAX" |
| .LP |
| #include <stdio.h> |
| .br |
| #include <slurm/slurm.h> |
| .LP |
| long \fBslurm_api_version\fR (); |
| .LP |
| void \fBslurm_free_ctl_conf\fR ( |
| .br |
| slurm_ctl_conf_t *\fIconf_info_msg_ptr\fP |
| .br |
| ); |
| .LP |
| int \fBslurm_load_ctl_conf\fR ( |
| .br |
| time_t \fIupdate_time\fP, |
| .br |
| slurm_ctl_conf_t **\fIconf_info_msg_pptr\fP |
| .br |
| ); |
| .LP |
| void \fBslurm_print_ctl_conf\fR ( |
| .br |
| FILE *\fIout_file\fp, |
| .br |
| slurm_ctl_conf_t *\fIconf_info_msg_ptr\fP |
| .br |
| ); |
| .SH "ARGUMENTS" |
| .LP |
| .TP |
| \fIconf_info_msg_pptr\fP |
| Specifies the double pointer to the structure to be created and filled with the |
| time of the last configuration update and detailed configuration information. |
| Configuration information includes control machine names, file names, timer |
| values, etc. See slurm.h for full details on the data structure's contents. |
| .TP |
| \fIconf_info_msg_ptr\fP |
| Specifies the pointer to the structure created by \fBslurm_load_ctl_conf\fR. |
| .TP |
| \fIout_file\fP |
| Specifies the file to print data to. |
| .TP |
| \fIupdate_time\fP |
| For all of the following informational calls, if update_time is equal to or |
| greater than the last time changes where made to that information, new information |
| is not returned. Otherwise all the configuration. job, node, or partition records |
| are returned. |
| .SH "DESCRIPTION" |
| .LP |
| \fBslurm_api_version\fR Return the SLURM API version number. |
| .LP |
| \fBslurm_free_ctl_conf\fR Release the storage generated by the |
| \fBslurm_load_ctl_conf\fR function. |
| .LP |
| \fBslurm_load_ctl_conf\fR Returns a slurm_ctl_conf_t that contains |
| Slurm configuration records. |
| .LP |
| \fBslurm_print_ctl_conf\fR Prints the contents of the data structure loaded by the |
| \fBslurm_load_ctl_conf\fR function. |
| .SH "RETURN VALUE" |
| .LP |
| For \fBslurm_api_version\fR the SLURM API version number is returned. |
| All other functions return zero on success and \-1 on error with the |
| SLURM error code set appropriately. |
| .SH "ERRORS" |
| .LP |
| \fBSLURM_NO_CHANGE_IN_DATA\fR Data has not changed since \fBupdate_time\fR. |
| .LP |
| \fBSLURM_PROTOCOL_VERSION_ERROR\fR Protocol version has changed, re\-link your code. |
| .LP |
| \fBSLURM_PROTOCOL_SOCKET_IMPL_TIMEOUT\fR Timeout in communicating with |
| SLURM controller. |
| .SH "EXAMPLE" |
| .LP |
| #include <stdio.h> |
| .br |
| #include <slurm/slurm.h> |
| .br |
| #include <slurm/slurm_errno.h> |
| .LP |
| int main (int argc, char *argv[]) |
| .br |
| { |
| .br |
| slurm_ctl_conf_t * conf_info_msg_ptr = NULL; |
| .br |
| long version = slurm_api_version; |
| .LP |
| /* We can use the SLURM version number to determine how |
| .br |
| * API should be used */ |
| .br |
| printf("slurm_api_version: %ld, %ld.%ld.%ld\\n", version, |
| .br |
| SLURM_VERSION_MAJOR(version), |
| .br |
| SLURM_VERSION_MINOR(version), |
| .br |
| SLURM_VERSION_MICRO(version)); |
| .LP |
| /* get and print some configuration information */ |
| .br |
| if ( slurm_load_ctl_conf ((time_t) NULL, |
| .br |
| &conf_info_msg_ptr ) ) { |
| .br |
| slurm_perror ("slurm_load_ctl_conf error"); |
| .br |
| exit (1); |
| .br |
| } |
| .br |
| /* The easy way to print */ |
| .br |
| slurm_print_ctl_conf (stdout, |
| .br |
| conf_info_msg_ptr); |
| .LP |
| /* The hard way */ |
| .br |
| printf ("control_machine = %s\\n", |
| .br |
| slurm_ctl_conf_ptr\->control_machine); |
| .br |
| printf ("server_timeout = %u\\n", |
| .br |
| slurm_ctl_conf_ptr\->server_timeout); |
| .LP |
| slurm_free_ctl_conf (conf_info_msg_ptr); |
| .br |
| exit (0); |
| .br |
| } |
| |
| .SH "NOTE" |
| These functions are included in the libslurm library, |
| which must be linked to your process for use |
| (e.g. "cc \-lslurm myprog.c"). |
| |
| .SH "COPYING" |
| Copyright (C) 2002\-2007 The Regents of the University of California. |
| Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). |
| UCRL\-CODE\-226842. |
| .LP |
| This file is part of SLURM, a resource management program. |
| For details, see <https://computing.llnl.gov/linux/slurm/>. |
| .LP |
| SLURM is free software; you can redistribute it and/or modify it under |
| the terms of the GNU General Public License as published by the Free |
| Software Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| .LP |
| SLURM is distributed in the hope that it will be useful, but WITHOUT ANY |
| WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| details. |
| .SH "SEE ALSO" |
| .LP |
| \fBscontrol\fR(1), |
| \fBslurm_get_errno\fR(3), \fBslurm_perror\fR(3), \fBslurm_strerror\fR(3) |
| |