---
name: "slurm_checkpoint_error"
section: "3"
platform: "linux"
package: "libslurm-dev"
version: "18.08.5.2-1+deb10u2"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/slurm_checkpoint_error"
---

# slurm\_checkpoint\_error(3)

Slurm checkpoint functions

## NAME

slurm\_checkpoint\_able, slurm\_checkpoint\_complete, slurm\_checkpoint\_create, slurm\_checkpoint\_disable, slurm\_checkpoint\_enable, slurm\_checkpoint\_error, slurm\_checkpoint\_restart, slurm\_checkpoint\_vacate - Slurm checkpoint functions

## SYNTAX

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

int **slurm\_checkpoint\_able** (\
\
 	uint32\_t *job\_id*,\
\
 	uint32\_t *step\_id*,\
\
 	time\_t \**start\_time*,\
 );

int **slurm\_checkpoint\_complete** (\
\
 	uint32\_t *job\_id*,\
\
 	uint32\_t *step\_id*,\
\
 	time\_t *start\_time*,\
\
 	uint32\_t *error\_code*,\
\
 	char \**error\_msg*\
 );

int **slurm\_checkpoint\_create** (\
\
 	uint32\_t *job\_id*,\
\
 	uint32\_t *step\_id*,\
\
 	uint16\_t *max\_wait*,\
\
 	char \**image\_dir*\
 );

int **slurm\_checkpoint\_disable** (\
\
 	uint32\_t *job\_id*,\
\
 	uint32\_t *step\_id*\
 );

int **slurm\_checkpoint\_enable** (\
\
 	uint32\_t *job\_id*,\
\
 	uint32\_t *step\_id*\
 );

int **slurm\_checkpoint\_error** (

	uint32\_t *job\_id*,\
\
 	uint32\_t *step\_id*,\
\
 	uint32\_t \**error\_code*,\
\
 	char \*\* *error\_msg*\
 );

int **slurm\_checkpoint\_restart** (\
\
 	uint32\_t *job\_id*,\
\
 	uint32\_t *step\_id*,\
\
 	uint16\_t *stick*,\
\
 	char \**image\_dir*\
 );

int **slurm\_checkpoint\_tasks** (\
\
 	uint32\_t *job\_id*,\
\
 	uint32\_t *step\_id*,\
\
 	time\_t *begin\_time*,\
\
 	char \**image\_dir*,\
\
 	uint16\_t *max\_wait*,\
\
 	char \**nodelist*\
 );

int **slurm\_checkpoint\_vacate** (\
\
 	uint32\_t *job\_id*,\
\
 	uint32\_t *step\_id*,\
\
 	uint16\_t *max\_wait*,\
\
 	char \**image\_dir*\
 );

## ARGUMENTS

- *begin\_time*

  When to begin the operation.

- *error\_code*

  Error code for checkpoint operation. Only the highest value is preserved.

- *error\_msg*

  Error message for checkpoint operation. Only the *error\_msg* value for the highest *error\_code* is preserved.

- *image\_dir*

  Directory specification for where the checkpoint file should be read from or written to. The default value is specified by the *JobCheckpointDir* Slurm configuration parameter.

- *job\_id*

  Slurm job ID to perform the operation upon.

- *max\_wait*

  Maximum time to allow for the operation to complete in seconds.

- *nodelist*

  Nodes to send the request.

- *start\_time*

  Time at which last checkpoint operation began (if one is in progress), otherwise zero.

- *step\_id*

  Slurm job step ID to perform the operation upon. May be NO\_VAL if the operation is to be performed on all steps of the specified job. Specify SLURM\_BATCH\_SCRIPT to checkpoint a batch job.

- *stick*

  If non-zero then restart the job on the same nodes that it was checkpointed from.

## DESCRIPTION

**slurm\_checkpoint\_able** Report if checkpoint operations can presently be issued for the specified job step. If yes, returns SLURM\_SUCCESS and sets *start\_time* if checkpoint operation is presently active. Returns ESLURM\_DISABLED if checkpoint operation is disabled.

**slurm\_checkpoint\_complete** Note that a requested checkpoint has been completed.

**slurm\_checkpoint\_create** Request a checkpoint for the identified job step. Continue its execution upon completion of the checkpoint.

**slurm\_checkpoint\_disable** Make the identified job step non-checkpointable. This can be issued as needed to prevent checkpointing while a job step is in a critical section or for other reasons.

**slurm\_checkpoint\_enable** Make the identified job step checkpointable.

**slurm\_checkpoint\_error** Get error information about the last checkpoint operation for a given job step.

**slurm\_checkpoint\_restart** Request that a previously checkpointed job resume execution. It may continue execution on different nodes than were originally used. Execution may be delayed if resources are not immediately available.

**slurm\_checkpoint\_vacate** Request a checkpoint for the identified job step. Terminate its execution upon completion of the checkpoint.

## RETURN VALUE

Zero is returned upon success. On error, -1 is returned, and the Slurm error code is set appropriately.

## ERRORS

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

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

**ESLURM\_JOB\_PENDING** the requested job is still pending.

**ESLURM\_ALREADY\_DONE** the requested job has already completed.

**ESLURM\_DISABLED** the requested operation has been disabled for this job step. This will occur when a request for checkpoint is issued when they have been disabled.

**ESLURM\_NOT\_SUPPORTED** the requested operation is not supported on this system.

## EXAMPLE

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

int main (int argc, char \*argv\[\])\
 {\
\
 	uint32\_t job\_id, step\_id;

	if (argc \< 3) {\
\
 		printf("Usage: %s job\_id step\_id\\n", argv\[0\]);\
\
 		[exit(1)](/exit/1.md);\
\
 	}

	job\_id = atoi(argv\[1\]);\
\
 	step\_id = atoi(argv\[2\]);\
\
 	if (slurm\_checkpoint\_disable(job\_id, step\_id)) {\
\
 		slurm\_perror ("slurm\_checkpoint\_error:");\
\
 		exit (1);\
\
 	}\
\
 	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) 2004-2007 The Regents of the University of California. Copyright (C) 2008-2009 Lawrence Livermore National Security. 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

[**srun**(1)](/srun/1.md), [**squeue**(1)](/squeue/1.md), [**free**(3)](/free/3.md), [**slurm.conf**(5)](/slurm.conf/5.md)
