Slurm API(3)

NAME
slurm_spawn - Slurm checkpoint functions

SYNTAX

#include <slurm/slurm.h>

slurm_step_ctx slurm_checkpoint_complete (
    uint32_t job_id,
    uint32_t step_id
);

slurm_step_ctx slurm_checkpoint_create (
    uint32_t job_id,
    uint32_t step_id,
    uint16_t max_wait
);

slurm_step_ctx slurm_checkpoint_disable (
    uint32_t job_id,
    uint32_t step_id
);

slurm_step_ctx slurm_checkpoint_enable (
    uint32_t job_id,
    uint32_t step_id
);

slurm_step_ctx slurm_checkpoint_error (
    uint32_t job_id,
    uint32_t step_id,
    uint16_t *ckpt_errno,
    char ** ckpt_strerror
);

slurm_step_ctx slurm_checkpoint_failed (
    uint32_t job_id,
    uint32_t step_id,
    uint16_t ckpt_errno
);

slurm_step_ctx slurm_checkpoint_resume (
    uint32_t job_id,
    uint32_t step_id
);

slurm_step_ctx slurm_checkpoint_vacate (
    uint32_t job_id,
    uint32_t step_id,
    uint16_t max_wait
);

ARGUMENTS

ckpt_errno
    Set to the last checkpoint error number associated with this slurm job step. This is an error number specific to the checkpoint mechanism and independent of system or SLURM error numbers.

ckpt_strerror
    Set to a string descriptive of the last checkpoint error associated with this slurm job step. This storage must be freed by the caller.

job_id
    SLURM job ID to perform the operation upon.

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

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 (only for the slurm_checkpoint function).

DESCRIPTION

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 indentified job step checkpointable.

slurm_checkpoint_failed Note that a requested checkpoint has been failed.

slurm_checkpoint_resume Request that a previously checkpointed job resume execution. It may continue execution on differrent 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_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;
    uint16_t ckpt_errno;
    char *ckpt_strerror;

    if (argc < 3) {
        printf("Usage: %s job_id step_id\n");
        exit(1);
    }

    job_id = atoi(argv[1]);
    step_id = atoi(argv[2]);
    if (slurm_checkpoint_error(job_id, step_id,
            &ckpt_errno, &ckpt_strerror)) {
        slurm_perror ("slurm_checkpoint_error:");
        exit (1);
    }

    printf ("step:%u.%u ckpt_errno=%u ckpt_strerror:%s\n",
            job_id, step_id, ckpt_errno, ckpt_strerror);
    free(ckpt_strerror);
    exit (0);
}

COPYING
Copyright (C) 2004 The Regents of the University of California. Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). UCRL-CODE-2002-040.

This file is part of SLURM, a resource management program. For details, see <http://www.llnl.gov/linux/slurm/>.

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), squeue(1), free(3)