.TH "Slurm API" "3" "Slurm front end node informational functions" "April 2015" "Slurm front end node informational functions" .SH "NAME" slurm_free_front_end_info_msg, slurm_load_front_end, slurm_print_front_end_info_msg, slurm_print_front_end_table, slurm_sprint_front_end_table \- Slurm front end node information reporting functions .SH "SYNTAX" .LP #include .br #include .LP void \fBslurm_free_front_end_info_msg\fR ( .br front_end_info_msg_t *\fIfront_end_info_msg_ptr\fP .br ); .LP int \fBslurm_load_front_end\fR ( .br time_t \fIupdate_time\fP, .br front_end_info_msg_t **\fIfront_end_info_msg_pptr\fP, .br ); .LP void \fBslurm_print_front_end_info_msg\fR ( .br FILE *\fIout_file\fp, .br front_end_info_msg_t *\fIfront_end_info_msg_ptr\fP, .br int \fIone_liner\fP .br ); .LP void \fBslurm_print_front_end_table\fR ( .br FILE *\fIout_file\fp, .br front_end_info_t *\fIfront_end_ptr\fP, .br int \fIone_liner\fP .br ); .LP char *\fBslurm_sprint_front_end_table\fR ( .br front_end_info_t *\fIfront_end_ptr\fP, .br int \fIone_liner\fP .br ); .SH "ARGUMENTS" .LP .TP \fIfront_end_info_msg_ptr\fP Specifies the pointer to the structure created by \fBslurm_load_front_end\fR. .TP \fIfront_end_info_msg_pptr\fP Specifies the double pointer to the structure to be created and filled with the time of the last front end node update, a record count, and detailed information about each front_end node. Detailed front_end node information is written to fixed sized records and includes: name, state, etc. See slurm.h for full details on the data structure's contents. .TP \fIfront_end_ptr\fP Specifies a pointer to a single front end node record from the \fIfront_end_info_msg_ptr\fP data structure. .TP \fIone_liner\fP Print one record per line if non\-zero. .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_free_front_end_info_msg\fR Release the storage generated by the \fBslurm_load_front_end\fR function. .LP \fBslurm_load_front_end\fR Returns a \front_end_info_msg_t\fP that contains an update time, record count, and array of records for all front end nodes. .LP \fBslurm_print_front_end_info_msg\fR Prints the contents of the data structure describing all front end node records from the data loaded by the \fBslurm_load_front_end\fR function. .LP \fBslurm_print_front_end_table\fR Prints to a file the contents of the data structure describing a single front end node record loaded by the \fBslurm_load_front_end\fR function. .LP \fBslurm_psrint_front_end_table\fR Prints to memory the contents of the data structure describing a single front end node record loaded by the \fBslurm_load_front_end\fR function. .SH "RETURN VALUE" .LP On success, zero is returned. On error, \-1 is returned, and Slurm error code is 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 .br #include .br #include .LP int main (int argc, char *argv[]) .br { .br int i; .br front_end_info_msg_t *front_end_info_ptr = NULL; .br front_end_info_t *front_end_ptr; .LP /* get and dump some node information */ .br if ( slurm_load_front_end ((time_t) NULL, .br &front_end_buffer_ptr) ) { .br slurm_perror ("slurm_load_front_end error"); .br exit (1); .br } .LP /* The easy way to print... */ .br slurm_print_front_end_info_msg (stdout, front_end_buffer_ptr, 0); .LP /* A harder way.. */ .br for (i = 0; i < front_end_buffer_ptr\->record_count; i++) { .br front_end_ptr = &front_end_buffer_ptr\->front_end_array[i]; .br slurm_print_front_end_table(stdout, front_end_ptr, 0); .br } .LP /* The hardest way. */ .br for (i = 0; i < front_end_buffer_ptr\->front_end_count; i++) { .br printf ("FrontEndName=%s StateCode=%u\\n", .br front_end_buffer_ptr\->front_end_array[i].name, .br front_end_buffer_ptr\->front_end_array[i].node_state); .br } .br slurm_free_front_end_info_msg (front_end_buffer_ptr); .br exit (0); .br } .SH "NOTES" These functions are included in the libslurm library, which must be linked to your process for use (e.g. "cc \-lslurm myprog.c"). .LP Some data structures contain index values to cross\-reference each other. If the \fIshow_flags\fP argument is not set to SHOW_ALL when getting this data, these index values will be invalid. .SH "COPYING" Copyright (C) 2010 Lawrence Livermore National Security. Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). CODE\-OCEC\-09\-009. All rights reserved. .LP This file is part of Slurm, a resource management program. For details, see . .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_load_node\fR(3), \fBslurm_perror\fR(3), \fBslurm_strerror\fR(3)