Belle II Software  release-06-01-15
PBS.PBSResult Class Reference
Inheritance diagram for PBS.PBSResult:
Collaboration diagram for PBS.PBSResult:

Public Member Functions

def __init__ (self, job, job_id)
 
def update_status (self)
 
def ready (self)
 
def get_exit_code_from_file (self)
 

Public Attributes

 job_id
 job id given by PBS
 
 job
 Job object for result.
 
 time_to_wait_for_exit_code_file
 After our first attempt to view the exit code file once the job is 'finished', how long should we wait for it to exist before timing out?
 
 exit_code_file_initial_time
 Time we started waiting for the exit code file to appear.
 

Static Public Attributes

dictionary backend_code_to_status
 PBS statuses mapped to Job statuses. More...
 

Private Member Functions

def _update_result_status (self, qstat_output)
 
def _get_status_from_output (self, output)
 

Private Attributes

 _is_ready
 Quicker way to know if it's ready once it has already been found. More...
 

Detailed Description

Simple class to help monitor status of jobs submitted by `PBS` Backend.

You pass in a `Job` object (or `SubJob`) and job id from a qsub command.
When you call the `ready` method it runs bjobs to see whether or not the job has finished.

Definition at line 1386 of file backends.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  job,
  job_id 
)
Pass in the job object and the job id to allow the result to do monitoring and perform
post processing of the job.

Definition at line 1406 of file backends.py.

Member Function Documentation

◆ _update_result_status()

def _update_result_status (   self,
  qstat_output 
)
private
Parameters:
        qstat_output (dict): The JSON output of a previous call to qstat which we can re-use to find the
        status of this job. Obviously you should only be passing a JSON dict that contains the 'Job_Id' and
        'job_state' information, otherwise it is useless.

Definition at line 1428 of file backends.py.

◆ get_exit_code_from_file()

def get_exit_code_from_file (   self)
inherited
Read the exit code file to discover the exit status of the job command. Useful falback if the job is no longer
known to the job database (batch system purged it for example). Since some backends may take time to download
the output files of the job back to the working directory we use a time limit on how long to wait.

Definition at line 879 of file backends.py.

◆ ready()

def ready (   self)
inherited
Returns whether or not this job result is known to be ready. Doesn't actually change the job status. Just changes
the 'readiness' based on the known job status.

Definition at line 858 of file backends.py.

◆ update_status()

def update_status (   self)
Update the job's (or subjobs') status by calling qstat.

Reimplemented from Result.

Definition at line 1415 of file backends.py.

Member Data Documentation

◆ _is_ready

_is_ready
privateinherited

Quicker way to know if it's ready once it has already been found.

Saves a lot of calls to batch system commands.

Definition at line 851 of file backends.py.

◆ backend_code_to_status

dictionary backend_code_to_status
static
Initial value:
= {"R": "running",
"C": "completed",
"FINISHED": "completed",
"E": "failed",
"H": "submitted",
"Q": "submitted",
"T": "submitted",
"W": "submitted",
"H": "submitted"
}

PBS statuses mapped to Job statuses.

Definition at line 1395 of file backends.py.


The documentation for this class was generated from the following file: