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¶
The SlurmExecutor class is responsible for submitting jobs to Slurm Scheduler. |
Attributes¶
- buildtest.executors.slurm.logger¶
- class buildtest.executors.slurm.SlurmExecutor(name, settings, site_configs, account=None, maxpendtime=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
- type = slurm¶
- launcher_command(self, numprocs=None, numnodes=None)[source]¶
Return sbatch launcher command with options used to submit job
- run(self, 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 inbuilder.job
.- Parameters
builder (buildtest.buildsystem.base.BuilderBase) – An instance object of BuilderBase type
- poll(self, builder)[source]¶
This method is called during poll stage where we invoke
builder.job.poll()
to get updated job state. If job is pending or suspended we stop timer and check if job needs to be cancelled if time exceedsmaxpendtime
value.- Parameters
builder (buildtest.buildsystem.base.BuilderBase) – An instance object of BuilderBase type