buildtest.executors.lsf

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

Module Contents

Classes

LSFExecutor

The LSFExecutor class is responsible for submitting jobs to LSF Scheduler.

Attributes

logger

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

Bases: buildtest.executors.base.BaseExecutor

The LSFExecutor class is responsible for submitting jobs to LSF Scheduler. The LSFExecutor performs the following steps

  • load: load lsf configuration from buildtest configuration file

  • dispatch: dispatch job to scheduler and acquire job ID

  • poll: wait for LSF jobs to finish

  • 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

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

This command returns the launcher command and any options specified in configuration file. This is useful when generating the build script in the BuilderBase class

run(builder)[source]

This method is responsible for dispatching job to scheduler and extracting job ID by applying a re.search against output at onset of job submission. If job id is not retrieved due to job failure or unable to match regular expression we mark job incomplete by invoking buildtest.buildsystem.base.BuilderBase.incomplete`() method and return from method.

If we have a valid job ID we invoke buildtest.executors.lsf.LSFJob class given the job id to poll job and store this into builder.job attribute.

Parameters

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

poll(builder)[source]

Given a builder object we poll the job by invoking builder method builder.job.poll() return state of job. If job is suspended or pending we stop timer and check if timer exceeds maxpendtime value which could be defined in configuration file or passed via command line --max-pend-time

Parameters

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

gather(builder)[source]

Gather Job detail after completion of job by invoking the builder method builder.job.gather(). We retrieve exit code, output file, error file and update builder metadata.

Parameters

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