# SLURM Job Submit Plugin API

## Overview

This document describes SLURM job submit plugins and the API that defines them. It is intended as a resource to programmers wishing to write their own SLURM job submit plugins. This is version 100 of the API.

SLURM job submit plugins must conform to the SLURM Plugin API with the following specifications:

const char plugin_name[]="full text name"

A free-formatted ASCII text string that identifies the plugin.

const char plugin_type[]="major/minor"

The major type must be "job_submit." The minor type can be any suitable name for the type of accounting package. We include samples in the SLURM distribution for

- defaults—Set default values for job submission or modify requests.
- logging—Log select job submission and modification parameters.
- partition—Sets a job's default partition based upon job submission parameters and available partitions.

SLURM can be configured to use multiple job_submit plugins if desired.

## API Functions

All of the following functions are required. Functions which are not implemented must be stubbed.

int job_submit(struct job_descriptor *job_desc)

Description:
This function is called by the slurmctld daemon with job submission parameters supplied by the salloc, sbatch or srun command. It can be used to log and/or modify the job parameters supplied by the user as desired. Note that this function has access to the slurmctld's global data structures, for example to examine the available partitions, reservations, etc.

Arguments:
job_desc (input/output) the job allocation request specifications.

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

int job_modify(struct job_descriptor *job_desc, struct job_record *job_ptr)

Description:
This function is called by the slurmctld daemon with job modification parameters supplied by the scontrol or sview command. It can be used to log and/or modify the job parameters supplied by the user as desired. Note that this function has access to the slurmctld's global data structures, for example to examine the available partitions, reservations, etc.

Arguments:
job_desc (input/output) the job allocation request specifications.
job_ptr (input/output) slurmctld daemon's current data structure for the job to be modified.

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

## Versioning

This document describes version 100 of the SLURM Job Submission API. Future releases of SLURM may revise this API.

Last modified 13 April 2010