idmtools_platform_comps.comps_platform module

idmtools COMPSPlatform.

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

class idmtools_platform_comps.comps_platform.COMPSPriority(value)

Bases: Enum

An enumeration.

Lowest = 'Lowest'
BelowNormal = 'BelowNormal'
Normal = 'Normal'
AboveNormal = 'AboveNormal'
Highest = 'Highest'
class idmtools_platform_comps.comps_platform.COMPSPlatform(*args, **kwargs)

Bases: IPlatform, CacheEnabled

Represents the platform allowing to run simulations on COMPS.

MAX_SUBDIRECTORY_LENGTH = 35
endpoint: str = 'https://comps2.idmod.org'
environment: str = 'Bayesian'
priority: str = 'Lowest'
simulation_root: str = '$COMPS_PATH(USER)\\output'
node_group: str = None
num_retries: int = 0
num_cores: int = 1
max_workers: int = 16
batch_size: int = 10
min_time_between_commissions: int = 15
exclusive: bool = False
docker_image: str = None
post_setstate()

Function called after restoring the state if additional initialization is required.

get_username()
is_windows_platform(item: Optional[IEntity] = None) bool

Returns is the target platform is a windows system.

validate_item_for_analysis(item: object, analyze_failed_items=False)

Check if item is valid for analysis.

Parameters:
  • item – which item to flatten

  • analyze_failed_items – bool

Returns: bool

get_files(item: Union[Simulation, WorkItem, AssetCollection], files: Union[Set[str], List[str]], output: Optional[str] = None, **kwargs) Union[Dict[str, Dict[str, bytearray]], Dict[str, bytearray]]

Get files for a platform entity.

Parameters:
  • item – Item to fetch files for

  • files – List of file names to get

  • output – save files to

  • kwargs – Platform arguments

Returns:

For simulations, this returns a dictionary with filename as key and values being binary data from file or a dict.

For experiments, this returns a dictionary with key as sim id and then the values as a dict of the simulations described above

flatten_item(item: object, raw=False, **kwargs) List[object]

Flatten an item: resolve the children until getting to the leaves.

For example, for an experiment, will return all the simulations. For a suite, will return all the simulations contained in the suites experiments.

Parameters:
  • item – Which item to flatten

  • raw – bool

  • kwargs – extra parameters

Returns:

List of leaves

__init__(_uid: ~uuid.UUID = None, _IItem__pre_creation_hooks: ~typing.List[~typing.Callable[[IItem, IPlatform], None]] = <factory>, _IItem__post_creation_hooks: ~typing.List[~typing.Callable[[IItem, IPlatform], None]] = <factory>, _platform_defaults: ~typing.List[~idmtools.entities.iplatform_default.IPlatformDefault] = <factory>, _config_block: str = None, endpoint: str = 'https://comps2.idmod.org', environment: str = 'Bayesian', priority: str = 'Lowest', simulation_root: str = '$COMPS_PATH(USER)\\output', node_group: str = None, num_retries: int = 0, num_cores: int = 1, max_workers: int = 16, batch_size: int = 10, min_time_between_commissions: int = 15, exclusive: bool = False, docker_image: str = None, _skip_login: bool = False) None