buildtest.executors.pbs

This module implements PBSExecutor class that defines how executors submit job to PBS Scheduler

Module Contents

Classes

PBSExecutor

The PBSExecutor class is responsible for submitting jobs to PBS Scheduler.

PBSJob

See https://www.altair.com/pdfs/pbsworks/PBSReferenceGuide2021.1.pdf section 8.1 for Job State Codes

Attributes

logger

class buildtest.executors.pbs.PBSExecutor(name, settings, site_configs, max_pend_time=None)

Bases: buildtest.executors.base.BaseExecutor

The PBSExecutor class is responsible for submitting jobs to PBS Scheduler. The class implements the following methods:

load: load PBS executors from configuration file dispatch: submit PBS job to scheduler poll: poll PBS job via qstat and retrieve job state gather: gather job result cancel: cancel job if it exceeds max pending time

poll_cmd = qstat
type = pbs
dispatch(self, builder)

This method is responsible for dispatching PBS job, get JobID and start record metadata in builder object. If job failed to submit we check returncode and exit with failure. After we submit job, we start timer and record when job was submitted and poll job once to get job details and store them in builder object.

Parameters

builder (BuilderBase, required) – builder object

gather(self, builder)

This method is responsible for getting output of job using qstat -x -f -F json <jobID> and storing the result in builder object. We retrieve specific fields such as exit status, start time, end time, runtime and store them in builder object. We read output and error file and store the content in builder object.

Parameters

builder (BuilderBase, required) – builder object

launcher_command(self)
load(self)

Load the a Cobalt executor configuration from buildtest settings.

poll(self, builder)

This method is responsible for polling Cobalt job, we check the job state and existence of output file. If file exists or job is in ‘exiting’ stage we set job to ‘done’ stage and gather results. If job is in ‘pending’ stage we check if job exceeds ‘max_pend_time’ time limit by checking with builder timer attribute using start and stop method. If job exceeds the time limit job is cancelled.

Parameters

builder (BuilderBase, required) – builder object

class buildtest.executors.pbs.PBSJob(jobID)

Bases: buildtest.executors.job.Job

See https://www.altair.com/pdfs/pbsworks/PBSReferenceGuide2021.1.pdf section 8.1 for Job State Codes

cancel(self)

Cancel job

error_file(self)
exitcode(self)
fail(self)
gather(self)
is_complete(self)
is_pending(self)

Check if job is in pending state

is_running(self)

Check if job is in running state

is_suspended(self)

Check if job is in suspended state

output_file(self)
poll(self)

Poll job and update job state.

success(self)

This method determines if job was completed successfully. According to https://www.altair.com/pdfs/pbsworks/PBSAdminGuide2021.1.pdf section 14.9 Job Exit Status Codes we have the following:

Exit Code: X < 0 - Job could not be executed Exit Code: 0 <= X < 128 - Exit value of Shell or top-level process Exit Code: X >= 128 - Job was killed by signal

Exit Code 0 is a success

buildtest.executors.pbs.logger