Slurm Scheduler Plugin API

Overview

This document describes the Slurm scheduler plugins and the API that defines them. It is intended as a resource to programmers wishing to write their own Slurm scheduler plugins.

Slurm scheduler plugins are Slurm plugins that implement the Slurm scheduler API described herein. They must conform to the Slurm Plugin API with the following specifications:

const char plugin_type[]
The major type must be "sched." The minor type can be any recognizable abbreviation for the type of scheduler. For example, the two provided plugins are:

  • builtin — A plugin that implements the API without providing any actual scheduling services. This is the default behavior and implements strict priority-based scheduling.
  • backfill — Backfill scheduling can launch lower-priority jobs sooner if possible as long as they would not delay the expected start time of any higher priority job.

const char plugin_name[]
Some descriptive name for the plugin. There is no requirement with respect to its format.

const uint32_t plugin_version
Must be set to the SLURM_VERSION_NUMBER macro, otherwise the plugin will not load. Used to ensure the plugin matches the current operating version of Slurm.

API Functions

The following functions must appear. Functions which are not implemented should be stubbed.

extern int init(void)

Description:
Called when the plugin is loaded, before any other functions are called. Put global initialization here.

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

extern void fini(void)

Description:
Called when the plugin is removed. Clear any allocated storage here.

Returns: None.

Note: These init and fini functions are not the same as those described in the dlopen (3) system library. The C run-time system co-opts those symbols for its own initialization. The system _init() is called before the Slurm init(), and the Slurm fini() is called before the system's _fini().

extern int sched_p_reconfig(void);

Description: Reread any configuration files.

Arguments: None

Returns: SLURM_SUCCESS.

Last modified 22 April 2021