slurm_free_ctl_conf(3) slurm_load_ctl_conf,


#include <stdio.h>
#include <slurm/slurm.h>

long slurm_api_version ();

void slurm_free_ctl_conf (
       slurm_ctl_conf_t *conf_info_msg_ptr


int slurm_load_ctl_conf (
       time_t update_time,

       slurm_ctl_conf_t **conf_info_msg_pptr


void slurm_print_ctl_conf (
       FILE *out_file,

       slurm_ctl_conf_t *conf_info_msg_ptr



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.
Specifies the pointer to the structure created by slurm_load_ctl_conf.
Specifies the file to print data to.
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.


slurm_api_version Return the Slurm API version number.

slurm_free_ctl_conf Release the storage generated by the slurm_load_ctl_conf function.

slurm_load_ctl_conf Returns a slurm_ctl_conf_t that contains Slurm configuration records.

slurm_print_ctl_conf Prints the contents of the data structure loaded by the slurm_load_ctl_conf function.


For slurm_api_version 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.


SLURM_NO_CHANGE_IN_DATA Data has not changed since update_time.

SLURM_PROTOCOL_VERSION_ERROR Protocol version has changed, re-link your code.

SLURM_PROTOCOL_SOCKET_IMPL_TIMEOUT Timeout in communicating with Slurm controller.


#include <stdio.h>
#include <stdlib.h>
#include <slurm/slurm.h>
#include <slurm/slurm_errno.h>

int main (int argc, char *argv[])
       slurm_ctl_conf_t * conf_info_msg_ptr = NULL;

       long version = slurm_api_version();

       /* We can use the Slurm version number to determine how

        * API should be used */

       printf("slurm_api_version: %ld, %ld.%ld.%ld\n", version,




       /* get and print some configuration information */

       if ( slurm_load_ctl_conf ((time_t) NULL,

        &conf_info_msg_ptr ) ) {

               slurm_perror ("slurm_load_ctl_conf error");

               exit (1);


       /* The easy way to print */

       slurm_print_ctl_conf (stdout,


       /* The hard way */

       printf ("control_machine = %s\n",


       printf ("first_job_id = %u\n",


       slurm_free_ctl_conf (conf_info_msg_ptr);

       exit (0);



These functions are included in the libslurm library, which must be linked to your process for use (e.g. "cc -lslurm myprog.c").


Copyright (C) 2002-2007 The Regents of the University of California. Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). CODE-OCEC-09-009. All rights reserved.

This file is part of Slurm, a resource management program. For details, see <>.

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.

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.