tardis.adapters.batchsystems.slurm module

SLURM Batch system Adapter

class tardis.adapters.batchsystems.slurm.SlurmAdapter[source]

Bases: BatchSystemAdapter

SlurmAdapter implements the TARDIS interface to dynamically integrate and manage opportunistic resources with the SLURM Batch System.

async disintegrate_machine(drone_uuid: str) None[source]

SLURM does not require any specific disintegration procedure (at least in Freiburg).

Parameters

drone_uuid (str) – Uuid of the worker node, for some sites corresponding to the host name of the drone.

Returns

None

async drain_machine(drone_uuid: str) None[source]

Drain a machine in the SLURM batch system, which means that no new jobs will be accepted

Parameters

drone_uuid (str) – Uuid of the worker node, for some sites corresponding to the host name of the drone.

Returns

None

async get_allocation(drone_uuid: str) float[source]

Get the allocation of a worker node in SLURM, which is defined as maximum of the ratios of requested over total resources (CPU, Memory, Disk, etc.).

Parameters

drone_uuid (str) – Uuid of the worker node, for some sites corresponding to the host name of the drone.

Returns

The allocation of a worker node as described above.

Return type

float

async get_machine_status(drone_uuid: str) MachineStatus[source]

Get the status of a worker node in SLURM (Available, Draining, Drained, NotAvailable)

Parameters

drone_uuid (str) – Uuid of the worker node, for some sites corresponding to the host name of the drone.

Returns

The machine status in SLURM (Available, Draining, Drained, NotAvailable)

Return type

MachineStatus

async get_resource_ratios(drone_uuid: str) Iterable[float][source]

Get the ratio of requested over total resources for a worker node in Slurm. The CPU ratio is calculated as allocated CPUs / total CPUs and the memory ratio is given by allocated memory / total memory.

Parameters

drone_uuid (str) – Uuid of the worker node, for some sites corresponding to the host name of the drone.

Returns

Iterable of float containing the ratios

Return type

Iterable[float]

async get_utilisation(drone_uuid: str) float[source]

Get the utilization of a worker node in Slurm, which is defined as minimum of the ratios of requested over total resources (CPU, Memory, Disk, etc.).

Parameters

drone_uuid (str) – Uuid of the worker node, for some sites corresponding to the host name of the drone.

Returns

The utilization of a worker node as described above.

Return type

float

async integrate_machine(drone_uuid: str) None[source]

SLURM does not require any specific integration procedure (if the Drones take care of it themselves)

Parameters

drone_uuid (str) – Uuid of the worker node, for some sites corresponding to the host name of the drone.

Returns

None

property machine_meta_data_translation_mapping: AttributeDict

The machine meta data translation mapping is used to translate units of the machine meta data in TARDIS to values expected by the Slurm batch system adapter.

Returns

Machine meta data translation mapping

Return type

AttributeDict

async tardis.adapters.batchsystems.slurm.slurm_status_updater(options: AttributeDict, attributes: AttributeDict, executor: Executor) dict[source]

Slurm status update.

Parameters
  • options (AttributeDict) – Additional parameters for the sinfo command

  • attributes (AttributeDict) – Formatting options for sinfo

Returns

Dictionary containing the output of the sinfo command

Return type

dict