---
name: "slurm_job_step_create"
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_job_step_create"
---

# slurm\_job\_step\_create(3)

Slurm job step initiation functions

## NAME

slurm\_free\_job\_step\_create\_response\_msg, slurm\_job\_step\_create - Slurm job step initiation functions

## SYNTAX

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

void **slurm\_free\_job\_step\_create\_response\_msg** (\
\
 	job\_step\_create\_response\_msg\_t \**slurm\_step\_alloc\_resp\_msg\_ptr*\
 );

int **slurm\_job\_step\_create** (\
\
 	job\_step\_create\_request\_msg\_t \**slurm\_step\_alloc\_req\_msg\_ptr*,\
\
 	job\_step\_create\_response\_msg\_t \*\**slurm\_step\_alloc\_resp\_msg\_pptr*\
 );

## ARGUMENTS

- *slurm\_step\_alloc\_req\_msg\_ptr*

  Specifies the pointer to the structure with job step request specification. See slurm.h for full details on the data structure's contents.

- *slurm\_step\_alloc\_resp\_msg\_pptr*

  Specifies the double pointer to the structure to be created and filled with a description of the created job step: node allocation, credentials, etc. See slurm.h for full details on the data structure's contents.

## DESCRIPTION

**slurm\_free\_job\_step\_create\_response\_msg** Release the storage generated in response to a call of the function **slurm\_job\_step\_create**.

**slurm\_job\_step\_create** Initialize a job step including the allocation of nodes to it from those already allocate to that job. Always release the response message when no longer required using the function **slurm\_free\_job\_step\_create\_response\_msg**. The list of host names returned may be matched to their data in the proper order by using the functions **hostlist\_create**, **hostlist\_shift**, and **hostlist\_destroy**.

## RETURN VALUE

On success, zero is returned. On error, -1 is returned, and Slurm error code is set appropriately.

## ERRORS

**SLURM\_PROTOCOL\_VERSION\_ERROR** Protocol version has changed, re-link your code.

**ESLURM\_INVALID\_JOB\_ID** the requested job id does not exist.

**ESLURM\_ALREADY\_DONE** the specified job has already completed and can not be modified.

**ESLURM\_ACCESS\_DENIED** the requesting user lacks authorization for the requested action (e.g. trying to delete or modify another user's job).

**ESLURM\_DISABLED** the ability to create a job step is currently disabled. This is indicative of the job being suspended. Retry the call as desired.

**ESLURM\_INTERCONNECT\_FAILURE** failed to configure the node interconnect.

**ESLURM\_BAD\_DIST** task distribution specification is invalid.

**SLURM\_PROTOCOL\_SOCKET\_IMPL\_TIMEOUT** Timeout in communicating with Slurm controller.

## 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

**hostlist\_create**(3), **hostlist\_shift**(3), **hostlist\_destroy**(3), [**srun**(1)](/srun/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)
