HPS-MC
Batch Class Reference

Generic batch processing interface. More...

Inheritance diagram for Batch:
BatchSystem Local Pool Auger LSF Slurm Swif

Public Member Functions

def __init__ (self)
 
def parse_args (self, args)
 Parse command line arguments and perform setup. More...
 
def submit_job (self, job_id)
 Submit a single batch job and return the batch ID. More...
 
def submit (self)
 This is the generic batch submission function which gets a list of jobs to run based on command line arguments and submits them individually. More...
 
def default_rundir (self, job_id=None)
 
def build_cmd (self, job_id)
 This is the basic implementation of building a command to run the job from a batch system. More...
 

Public Attributes

 parser
 
 script_name
 
 script
 
 jobstore
 
 debug
 
 log_dir
 
 run_dir
 
 check_output
 
 job_ids
 
 job_steps
 
 start_job_num
 
 end_job_num
 
 config_files
 

Private Member Functions

def _logfile (self, job_id)
 Get the base name of a log file for the job. More...
 
def _get_filtered_job_ids (self)
 Get a list of job IDs to submit based on parsed command line options and whether output files are being checked. More...
 
def _job_ids_missing_output (self, job_ids)
 Get a list of IDs for jobs that are missing output files. More...
 

Static Private Member Functions

def _outputs_exist (job)
 Check if all output files exist for the given job. More...
 

Detailed Description

Generic batch processing interface.

Definition at line 35 of file batch.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Reimplemented in Pool, Local, Swif, Auger, Slurm, LSF, and BatchSystem.

Definition at line 40 of file batch.py.

Member Function Documentation

◆ _get_filtered_job_ids()

def _get_filtered_job_ids (   self)
private

Get a list of job IDs to submit based on parsed command line options and whether output files are being checked.

Definition at line 209 of file batch.py.

◆ _job_ids_missing_output()

def _job_ids_missing_output (   self,
  job_ids 
)
private

Get a list of IDs for jobs that are missing output files.

Definition at line 226 of file batch.py.

◆ _logfile()

def _logfile (   self,
  job_id 
)
private

Get the base name of a log file for the job.

Definition at line 190 of file batch.py.

◆ _outputs_exist()

def _outputs_exist (   job)
staticprivate

Check if all output files exist for the given job.

This is not the job ID but the full JSON job data.

Return False when first missing output is found.

Definition at line 197 of file batch.py.

◆ build_cmd()

def build_cmd (   self,
  job_id 
)

This is the basic implementation of building a command to run the job from a batch system.

Reimplemented in Auger, Slurm, and LSF.

Definition at line 160 of file batch.py.

◆ default_rundir()

def default_rundir (   self,
  job_id = None 
)

Reimplemented in Slurm.

Definition at line 155 of file batch.py.

◆ parse_args()

def parse_args (   self,
  args 
)

Parse command line arguments and perform setup.

Reimplemented in Pool, Swif, Slurm, LSF, and BatchSystem.

Definition at line 58 of file batch.py.

◆ submit()

def submit (   self)

This is the generic batch submission function which gets a list of jobs to run based on command line arguments and submits them individually.

It calls the abstract submit_job() method and prints the batch system ID that was returned, if any.

Reimplemented in Pool, Swif, and Auger.

Definition at line 140 of file batch.py.

◆ submit_job()

def submit_job (   self,
  job_id 
)

Submit a single batch job and return the batch ID.

This is abstract as each batch system will do this differently.

Some batch systems don't implement this but sub-classes should override this and make it a no-op so that they can be instantiated.

Reimplemented in Pool, Local, Auger, Slurm, and LSF.

Definition at line 129 of file batch.py.

Member Data Documentation

◆ check_output

check_output

Definition at line 98 of file batch.py.

◆ config_files

config_files

Definition at line 122 of file batch.py.

◆ debug

debug

Definition at line 81 of file batch.py.

◆ end_job_num

end_job_num

Definition at line 112 of file batch.py.

◆ job_ids

job_ids

Definition at line 101 of file batch.py.

◆ job_steps

job_steps

Definition at line 105 of file batch.py.

◆ jobstore

jobstore

Definition at line 79 of file batch.py.

◆ log_dir

log_dir

Definition at line 84 of file batch.py.

◆ parser

parser

Definition at line 56 of file batch.py.

◆ run_dir

run_dir

Definition at line 91 of file batch.py.

◆ script

script

Definition at line 71 of file batch.py.

◆ script_name

script_name

Definition at line 67 of file batch.py.

◆ start_job_num

start_job_num

Definition at line 111 of file batch.py.


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