Code: batch_systems

Batch Systems define a limited interface to various batch job systems (e.g. SLURM). Objects of this class can be used on their own, or can be attached to other objects, e.g. a SetUp

In the top-level of the module, a basic skeleton class which defines the guarenteed interfaces offered by a BatchSystem object is defined. It needs to have the following:

  1. Attributes defining the:

    • The submitter (which command is needed to send a script to the queue)
    • Flags for the submitter
    • The launcher (which command is needed to start an executable on the compute node)
    • Flags for the launcher
    • The status command (which command is needed to check the queue)
    • The resource account (if you buy computer time, this is used to assign your simulation to a specific account)
  2. Methods to check the full queue and your own jobs

  3. Method to construct submitter and launcher commands and flags

names of these attributes and methods are summarized below.


class pyesm.core.batch_systems.BatchSystem[source]

Bases: object

Skeleton class to define interface of a batch system

Parameters:host (Host, optional) – Default None. If the optional argument host remains None, the configuration for the computing host you are currently working on is loaded. This is attached to the BatchSystem object as self._account

The following additional attributes are defined upon initialization:

submitter

The command name used to submit jobs to the batch system.

Type:str
launcher

The command used to run jobs

Type:str
status_command

The command used to check the queue

Type:str
account

The resource account

Type:str
submitter_flags

Contains keys used to configure the submitter. Values of type str, int, float are then put to str in the form: key=value. Values of the type bool have their value removed and simply pass the key to the submitter_flags string which appended after the submitter command.

Type:dict
launcher_flags

As submitter_flags, but is sent to the launcher command.

Type:dict
check_full_queue()[source]

Checks the computing queue for this BatchSystem including all users

check_my_queue()[source]

Checks the computing queue for this BatchSystem including only your user

construct_submitter_flags()[source]

Constructs appropriate submitter flags for this BatchSystem

version = '0.1'

Submodules

batch_systems.slurm

batch_systems.moab

Note

Not yet implemented.