Slurm API(3)

NAME
slurm_init_part_desc_msg, slurm_reconfigure, slurm_shutdown, slurm_update_job, slurm_update_node, slurm_update_partition - Slurm administrative functions

SYNTAX

#include <slurm/slurm.h>

void slurm_init_part_desc_msg (
    update_part_msg_t *update_part_msg_ptr
);

int slurm_reconfigure ( );

int slurm_shutdown (
    uint16_t core
);

int slurm_update_job (
    job_desc_msg_t *update_job_msg_ptr
);

int slurm_update_node (
    update_node_msg_t *update_node_msg_ptr
);

int slurm_update_partition (
    update_part_msg_t *update_part_msg_ptr
);

ARGUMENTS

core
    Generate a core file if value is non-zero.

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

update_node_msg_ptr
    Specifies the pointer to a node update request specification. See slurm.h for full details on the data structure's contents.

update_part_msg_ptr
    Specifies the pointer to a partition update request specification. See slurm.h for full details on the data structure's contents.

DESCRIPTION

slurm_init_part_desc_msg Initialize the contents of a partition descriptor with default values. Note: slurm_init_part_desc_msg is not equivalent to setting the data structure values to zero. Execute this function before executing slurm_update_part.

slurm_reconfigure Request that the Slurm controller re-read its configuration file. The new configuration parameters take effect immediately. This function may only be successfully executed by user root.

slurm_shutdown Request that the Slurm controller terminate. This function may only be successfully executed by user root.

slurm_update_job Request that the configuration of a job be updated. Note that most, but not all parameters of a job may be changed by this function. Initialize the data structure using the slurm_init_job_desc_msg function prior to setting values of the parameters to be changed. Note: slurm_init_job_desc_msg is not equivalent to setting the data structure values to zero. This function may only be successfully executed by user root.

slurm_update_node Request that the state of one or more nodes be updated. Note that the state of a node (e.g. DRAINING, IDLE, etc.) may be changed, but its hardware configuration may not be changed by this function. If the hardware configuration of a node changes, update the Slurm configuration file and execute the slurm_reconfigure function. This function may only be successfully executed by user root. The node state flag NODE_STATE_NO_RESPOND may be specified without changing the underlying node state. This might be used by some external system monitoring tool to inform the Slurm controller that a node has become unusable.

slurm_update_part Request that the configuration of a partition be updated. Note that most, but not all parameters of a partition may be changed by this function. Initialize the data structure using the slurm_init_part_desc_msg function prior to setting values of the parameters to be changed. Note: slurm_init_part_desc_msg is not equivalent to setting the data structure values to zero. If the partition name specified by this function does not already exist, a new partition is created with the supplied parameters. This function may only be successfully executed by user root.

RETURN VALUE

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

ERRORS

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

ESLURM_INVALID_NODE_NAME the requested node name(s) is/are not valid.

ESLURM_INVALID_NODE_STATE the specified state node state or requested node state transition is not valid.

ESLURM_INVALID_PARTITION_NAME the requested partition name is not valid.

ESLURM_ACCESS_DENIED the requesting user lacks authorization for the requested action (e.g. trying to delete or modify another user's job).

EXAMPLE

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

int main (int argc, char *argv[])
{
    job_desc_msg_t update_job_msg;
    update_node_msg_t update_node_msg;
    partition_desc_msg_t update_part_msg ;

    if (slurm_reconfigure ( )) {
        slurm_perror ("slurm_reconfigure error");
        exit (1);
    }

    slurm_init_job_desc_msg( &update_job_msg );
    update_job_msg.job_id = 1234;
    update_job_msg time_limit = 200;
    if (slurm_update_job (&update_job_msg)) {
        slurm_perror ("slurm_update_job error");
        exit (1);
    }

    slurm_init_part_desc_msg ( &update_part_msg );
    update_part_msg.name = "test.partition";
    update_part_msg.state_up = 0; /* partition down */
    if (slurm_update_partition (&update_part_msg)) {
        slurm_perror ("slurm_update_partition error");
        exit (1);
    }

    update_node_msg.node_names = "lx[10-12]";
    update_node_msg.node_state = NODE_STATE_DRAINING ;
    if (slurm_update_node (&update_node_msg)) {
        slurm_perror ("slurm_update_node error");
        exit (1);
    }
    exit (0);
}

COPYING
Copyright (C) 2002 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

scontrol(1), slurm_get_errno(3), slurm_init_job_desc_msg(3), slurm_perror(3), slurm_strerror(3)