buildtest.scheduler.cobalt

Module Contents

Classes

CobaltJob

The CobaltJob class performs operation on cobalt job upon job submission such

Attributes

logger

buildtest.scheduler.cobalt.logger
class buildtest.scheduler.cobalt.CobaltJob(jobID)[source]

Bases: buildtest.scheduler.job.Job

The CobaltJob class performs operation on cobalt job upon job submission such as polling job, gather job record, cancel job. We also retrieve job state and determine if job is pending, running, complete, suspended.

is_pending()[source]

Return True if job is pending otherwise returns False. When cobalt recieves job it is in starting followed by queued state. We check if job is in either state.

is_running()[source]

Return True if job is running otherwise returns False. Cobalt job state for running job is is marked as running

is_complete()[source]

Return True if job is complete otherwise returns False. Cobalt job state for completed job job is marked as exiting

is_suspended()[source]

Return True if job is suspended otherwise returns False. Cobalt job state for suspended is marked as user_hold

is_cancelled()[source]

Return True if job is cancelled otherwise returns False. Job state is cancelled which is set by class cancel method

cobalt_log()[source]

Return job cobalt.log file

poll()[source]

Poll job by running qstat -l --header State <jobid> which retrieves job state.

retrieve_jobdata()[source]

Gather Job state by running qstat -lf <jobid> which retrieves all fields. The output is in text format which is parsed into key/value pair and stored in a dictionary. This method will return a dict containing the job record

$ qstat -lf 347106
   JobID: 347106
       JobName           : hold_job
       User              : shahzebsiddiqui
       WallTime          : 00:10:00
       QueuedTime        : 00:13:14
       RunTime           : N/A
       TimeRemaining     : N/A
cancel()[source]

Cancel job by running qdel <jobid>. This method is called if job timer exceeds maxpendtime if job is pending.