---
name: "slurm_load_ctl_conf"
section: "3"
platform: "linux"
package: "libslurm-dev"
version: "20.11.7+really20.11.4-2+deb11u1"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/slurm_free_ctl_conf"
---

# slurm\_load\_ctl\_conf(3)

Slurm information reporting functions

Part of [slurm\_free\_ctl\_conf(3)](/slurm_free_ctl_conf/3.md).

## NAME

slurm\_free\_ctl\_conf, slurm\_load\_ctl\_conf, slurm\_print\_ctl\_conf - Slurm information reporting functions

## SYNTAX

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

long **slurm\_api\_version** ();

void **slurm\_free\_ctl\_conf** (\
\
 	slurm\_conf\_t \**conf\_info\_msg\_ptr*\
 );

int **slurm\_load\_ctl\_conf** (\
\
 	time\_t *update\_time*,\
\
 	slurm\_conf\_t \*\**conf\_info\_msg\_pptr*\
 );

void **slurm\_print\_ctl\_conf** (\
\
 	FILE \**out\_file*,\
\
 	slurm\_conf\_t \**conf\_info\_msg\_ptr*\
 );

## ARGUMENTS

- *conf\_info\_msg\_pptr*

  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.

- *conf\_info\_msg\_ptr*

  Specifies the pointer to the structure created by **slurm\_load\_ctl\_conf**.

- *out\_file*

  Specifies the file to print data to.

- *update\_time*

  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.

## DESCRIPTION

**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\_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.

## RETURN VALUE

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.

## ERRORS

**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.

## EXAMPLE

\#include \<stdio.h\>\
 \#include \<stdlib.h\>\
 \#include \<slurm/slurm.h\>\
 \#include \<slurm/slurm\_errno.h\>

int main (int argc, char \*argv\[\])\
 {\
\
 	slurm\_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,\
\
 		SLURM\_VERSION\_MAJOR(version),\
\
 		SLURM\_VERSION\_MINOR(version),\
\
 		SLURM\_VERSION\_MICRO(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,\
\
 	                      conf\_info\_msg\_ptr);

	/\* The hard way \*/\
\
 	printf ("control\_machine = %s\\n",\
\
 	        conf\_info\_msg\_ptr-\>control\_machine\[0\]);\
\
 	printf ("first\_job\_id = %u\\n",\
\
 	        conf\_info\_msg\_ptr-\>first\_job\_id);

	slurm\_free\_ctl\_conf (conf\_info\_msg\_ptr);\
\
 	exit (0);\
 }

## NOTE

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

## COPYING

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 \<https://slurm.schedmd.com/\>.

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.

## SEE ALSO

[**scontrol**(1)](/scontrol/1.md), [**slurm\_get\_errno**(3)](/slurm_get_errno/3.md), [**slurm\_perror**(3)](/slurm_perror/3.md), [**slurm\_strerror**(3)](/slurm_strerror/3.md)
