buildtest.executors.slurm

This module implements the SlurmExecutor class responsible for submitting jobs to Slurm Scheduler. This class is called in class BuildExecutor when initializing the executors.

Module Contents

Classes

SlurmExecutor

The SlurmExecutor class is responsible for submitting jobs to Slurm Scheduler.

Attributes

logger

buildtest.executors.slurm.logger
class buildtest.executors.slurm.SlurmExecutor(name, settings, site_configs, account=None, maxpendtime=None, timeout=None)[source]

Bases: buildtest.executors.base.BaseExecutor

The SlurmExecutor class is responsible for submitting jobs to Slurm Scheduler. The SlurmExecutor performs the following steps:

  • load: load slurm configuration from buildtest configuration file

  • dispatch: dispatch job to scheduler and acquire job ID

  • poll: wait for Slurm jobs to finish, if job is pending and exceeds maxpendtime then cancel job

  • gather: Once job is complete, gather job data

Initiate a base executor, meaning we provide a name (also held by the BuildExecutor base that holds it) and the loaded dictionary of config opts to parse.

Parameters:
  • name (str) – name of executor

  • setting (dict) – setting for a given executor defined in configuration file

  • site_configs (buildtest.config.SiteConfiguration) – Instance of SiteConfiguration class

  • timeout (str, optional) – Test timeout in number of seconds

  • maxpendtime (int, optional) – Maximum Pending Time until job is cancelled. The default is 1 day (86400s)

  • account (str, optional) – Account to use for job submission

  • maxpendtime – Maximum Pending Time until job is cancelled. The default is 1 day (86400s)

type = 'slurm'
launcher_command(numprocs=None, numnodes=None)[source]

Return sbatch launcher command with options used to submit job

run(builder)[source]

This method is responsible for dispatching job to slurm scheduler and extracting job id. If job id is valid we pass the job to buildtest.executors.slurm.SlurmJob class and store object in builder.job.

Parameters:

builder (buildtest.buildsystem.base.BuilderBase) – An instance object of BuilderBase type

gather(builder)[source]

Gather Slurm job data after job completion. In this step we call builder.job.gather(), and update builder metadata such as returncode, output and error file.

Parameters:

builder (buildtest.buildsystem.base.BuilderBase) – An instance object of BuilderBase type