bout_runners.submitter.submitter_factory

Contains the submitter factory.

Functions

get_processor_split(submitter_section)

Return the processor split based on the submitter configuration file.

get_submission_dict(cluster_section)

Return the submission dict based on the submitter configuration file.

get_submitter([name, argument_dict])

Return a Submitter object.

infer_submitter()

Infer the submitter and return appropriate positional and keyword arguments.

pbs_is_available()

Check if the PBS system is available.

slurm_is_available()

Check if the SLURM system is available.

bout_runners.submitter.submitter_factory.get_processor_split(submitter_section: configparser.SectionProxy)bout_runners.submitter.processor_split.ProcessorSplit[source]

Return the processor split based on the submitter configuration file.

Parameters
submitter_sectionconfigparser.SectionProxy

The section of the submitters configuration to use Must contain the section number_of_processors

Returns
ProcessorSplit

The processor split object

bout_runners.submitter.submitter_factory.get_submission_dict(cluster_section: configparser.SectionProxy) → Dict[str, Optional[str]][source]

Return the submission dict based on the submitter configuration file.

Parameters
cluster_sectionconfigparser.SectionProxy

The cluster section of the submitters configuration Must contain the sections walltime, account, queue, mail

Returns
submission_dictdict

Dictionary containing options for the submission_dict The submission_dict is a keyword parameter to the cluster constructors

See also

AbstractClusterSubmitter

Submitter object used for clusters

bout_runners.submitter.submitter_factory.get_submitter(name: Optional[str] = None, argument_dict: Optional[Dict[str, Any]] = None)bout_runners.submitter.abstract_submitter.AbstractSubmitter[source]

Return a Submitter object.

Parameters
namestr or None

Name of the submitter to use If None the submitter will be inferred

argument_dictdict

Dict containing positional and keyword arguments

Returns
submitterAbstractSubmitter

The implemented submitter class

Other Parameters
The following parameters can be given argument_dict
processor_splitProcessorSplit or None

Object containing the processor split Used for all submitters

run_pathPath or str or None

Positional argument Directory to run the command from Used in LocalSubmitters

job_namestr or None

Positional argument Name of the job Used for cluster submitters

store_directorypath or None

Keyword agrument Directory to store the scripts Used for cluster submitters

submission_dictNone or dict of str of None or str

Keyword agrument Dict containing optional submission options One the form

>>> {'walltime': None or str,
...  'account': None or str,
...  'queue': None or str,
...  'mail': None or str}

These options will not be used if the submission_dict is None Used for cluster submitters

Raises
ValueError

If the input does not match the desired submitter

NotImplementedError

If the name is not a supported submitter class

bout_runners.submitter.submitter_factory.infer_submitter() → Tuple[str, Dict[str, Any]][source]

Infer the submitter and return appropriate positional and keyword arguments.

Returns
namestr

Name of the submitter type

argument_dictdict

Dict containing positional and keyword arguments

bout_runners.submitter.submitter_factory.pbs_is_available() → bool[source]

Check if the PBS system is available.

Returns
pbs_availablebool

True if PBS is available

bout_runners.submitter.submitter_factory.slurm_is_available() → bool[source]

Check if the SLURM system is available.

Returns
slurm_availablebool

True if SLURM is available