idmtools_platform_slurm.platform_operations.simulation_operations module

Here we implement the SlurmPlatform simulation operations.

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

class idmtools_platform_slurm.platform_operations.simulation_operations.SlurmPlatformSimulationOperations(platform: 'SlurmPlatform', platform_type: Type = <class 'idmtools_platform_slurm.platform_operations.utils.SlurmSimulation'>)

Bases: IPlatformSimulationOperations

platform: SlurmPlatform
platform_type

alias of SlurmSimulation

get(simulation_id: Union[str, UUID], **kwargs) Dict

Gets an simulation from the Slurm platform. :param simulation_id: Simulation id :param kwargs: keyword arguments used to expand functionality

Returns:

Slurm Simulation object

platform_create(simulation: Simulation, **kwargs) SlurmSimulation

Create the simulation on Slurm Platform. :param simulation: Simulation :param kwargs: keyword arguments used to expand functionality

Returns:

Slurm Simulation object created.

get_parent(simulation: SlurmSimulation, **kwargs) SlurmExperiment

Fetches the parent of a simulation. :param simulation: Slurm Simulation :param kwargs: keyword arguments used to expand functionality

Returns:

The Experiment being the parent of this simulation.

platform_run_item(simulation: Simulation, **kwargs)

For simulations on slurm, we let the experiment execute with sbatch :param simulation: idmtools Simulation :param kwargs: keyword arguments used to expand functionality

Returns:

None

send_assets(simulation: Simulation, **kwargs)

Send assets. Replaced by self.platform._metas.dump(simulation) :param simulation: idmtools Simulation :param kwargs: keyword arguments used to expand functionality

Returns:

None

get_assets(simulation: Simulation, files: List[str], **kwargs) Dict[str, bytearray]

Get assets for simulation. :param simulation: idmtools Simulation :param files: files to be retrieved :param kwargs: keyword arguments used to expand functionality

Returns:

Dict[str, bytearray]

list_assets(simulation: Simulation, **kwargs) List[Asset]

List assets for simulation. :param simulation: idmtools Simulation :param kwargs: keyword arguments used to expand functionality

Returns:

List[Asset]

to_entity(slurm_sim: SlurmSimulation, parent: Optional[Experiment] = None, **kwargs) Simulation

Convert a SlurmSimulation object to idmtools Simulation.

Parameters:
  • slurm_sim – simulation to convert

  • parent – optional experiment object

  • kwargs – keyword arguments used to expand functionality

Returns:

Simulation object

refresh_status(simulation: Simulation, **kwargs)

Refresh simulation status: we actually don’t really refresh simulation’ status directly. :param simulation: idmtools Simulation :param kwargs: keyword arguments used to expand functionality

Returns:

None

__init__(platform: SlurmPlatform, platform_type: ~typing.Type = <class 'idmtools_platform_slurm.platform_operations.utils.SlurmSimulation'>) None