HPS-MC
 
Loading...
Searching...
No Matches
Batch Class Reference

Generic batch processing interface. More...

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

Public Member Functions

 __init__ (self)
 
 parse_args (self, args)
 Parse command line arguments and perform setup.
 
 submit_job (self, job_id)
 Submit a single batch job and return the batch ID.
 
 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.
 
 default_rundir (self, job_id=None)
 
 build_cmd (self, job_id)
 This is the basic implementation of building a command to run the job from a batch system.
 

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
 

Protected Member Functions

 _logfile (self, job_id)
 Get the base name of a log file for the job.
 
 _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.
 
 _job_ids_missing_output (self, job_ids)
 Get a list of IDs for jobs that are missing output files.
 

Static Protected Member Functions

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

Detailed Description

Generic batch processing interface.

Definition at line 35 of file batch.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self)

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

Definition at line 40 of file batch.py.

Member Function Documentation

◆ _get_filtered_job_ids()

_get_filtered_job_ids (   self)
protected

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()

_job_ids_missing_output (   self,
  job_ids 
)
protected

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

Definition at line 226 of file batch.py.

◆ _logfile()

_logfile (   self,
  job_id 
)
protected

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

Definition at line 190 of file batch.py.

◆ _outputs_exist()

_outputs_exist (   job)
staticprotected

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()

build_cmd (   self,
  job_id 
)

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

Reimplemented in LSF, Slurm, and Auger.

Definition at line 160 of file batch.py.

◆ default_rundir()

default_rundir (   self,
  job_id = None 
)

Reimplemented in Slurm.

Definition at line 155 of file batch.py.

◆ parse_args()

parse_args (   self,
  args 
)

Parse command line arguments and perform setup.

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

Definition at line 58 of file batch.py.

◆ submit()

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 Auger, Swif, and Pool.

Definition at line 140 of file batch.py.

◆ submit_job()

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 LSF, Slurm, Auger, Local, and Pool.

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: