idmtools_platform_slurm.platform_operations.experiment_operations module#

Here we implement the SlurmPlatform experiment operations.

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

class idmtools_platform_slurm.platform_operations.experiment_operations.SlurmPlatformExperimentOperations(platform: 'SlurmPlatform', platform_type: Type = <class 'idmtools_platform_slurm.platform_operations.utils.SlurmExperiment'>)[source]#

Bases: IPlatformExperimentOperations

platform: SlurmPlatform#
platform_type#

alias of SlurmExperiment

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

Gets an experiment from the Slurm platform. :param experiment_id: experiment id :param kwargs: keyword arguments used to expand functionality

Returns:

Slurm Experiment object

platform_create(experiment: Experiment, **kwargs) SlurmExperiment[source]#

Creates an experiment on Slurm Platform. :param experiment: idmtools experiment :param kwargs: keyword arguments used to expand functionality

Returns:

Slurm Experiment object created

get_children(experiment: SlurmExperiment, parent: Experiment | None = None, raw=True, **kwargs) List[Any][source]#

Fetch slurm experiment’s children. :param experiment: Slurm experiment :param raw: True/False :param parent: the parent of the simulations :param kwargs: keyword arguments used to expand functionality

Returns:

List of slurm simulations

get_parent(experiment: SlurmExperiment, **kwargs) SlurmSuite[source]#

Fetches the parent of an experiment. :param experiment: Slurm experiment :param kwargs: keyword arguments used to expand functionality

Returns:

The Suite being the parent of this experiment.

platform_run_item(experiment: Experiment, dry_run: bool = False, **kwargs)[source]#

Run experiment. :param experiment: idmtools Experiment :param dry_run: True/False :param kwargs: keyword arguments used to expand functionality

Returns:

None

send_assets(experiment: Experiment, **kwargs)[source]#

Copy our experiment assets. Replaced by self.platform._assets.dump_assets(experiment) :param experiment: idmtools Experiment :param kwargs: keyword arguments used to expand functionality

Returns:

None

list_assets(experiment: Experiment, **kwargs) List[Asset][source]#

List assets for an experiment. :param experiment: Experiment to get assets for :param kwargs:

Returns:

List[Asset]

get_assets_from_slurm_experiment(experiment: SlurmExperiment) AssetCollection[source]#

Get assets for a comps experiment. :param experiment: Experiment to get asset collection for.

Returns:

AssetCollection if configuration is set and configuration.asset_collection_id is set.

to_entity(slurm_exp: SlurmExperiment, parent: Suite | None = None, children: bool = True, **kwargs) Experiment[source]#

Convert a SlurmExperiment to idmtools Experiment. :param slurm_exp: simulation to convert :param parent: optional experiment object :param children: bool :param kwargs:

Returns:

Experiment object

refresh_status(experiment: Experiment, **kwargs)[source]#

Refresh status of experiment. :param experiment: idmtools Experiment :param kwargs: keyword arguments used to expand functionality

Returns:

Dict of simulation id as key and working dir as value

create_sim_directory_map(experiment_id: str) Dict[source]#

Build simulation working directory mapping. :param experiment_id: experiment id

Returns:

Dict of simulation id as key and working dir as value

platform_delete(experiment_id: str) None[source]#

Delete platform experiment. :param experiment_id: platform experiment id

Returns:

None

platform_cancel(experiment_id: str, force: bool = True) None[source]#

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

Returns:

Any

post_run_item(experiment: Experiment, **kwargs)[source]#

Trigger right after commissioning experiment on platform.

Parameters:
  • experiment – Experiment just commissioned

  • kwargs – keyword arguments used to expand functionality

Returns:

None

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