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'>)[source]#

Bases: IPlatformSimulationOperations

platform: SlurmPlatform#
platform_type#

alias of SlurmSimulation

get(simulation_id: str, **kwargs) Dict[source]#

Gets a 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[source]#

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[source]#

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)[source]#

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)[source]#

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][source]#

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][source]#

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: Experiment | None = None, **kwargs) Simulation[source]#

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)[source]#

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

create_sim_directory_map(simulation_id: str) Dict[source]#

Build simulation working directory mapping. :param simulation_id: simulation id

Returns:

Dict of simulation id as key and working dir as value

platform_delete(sim_id: str) None[source]#

Delete platform simulation. :param sim_id: platform simulation id

Returns:

None

__init__(platform: SlurmPlatform, platform_type: ~typing.Type = <class 'idmtools_platform_slurm.platform_operations.utils.SlurmSimulation'>) None#
platform_cancel(sim_id: str, force: bool = False) Any[source]#

Cancel platform simulation’s slurm job. :param sim_id: simulation id :param force: bool, True/False

Returns:

Any