Platforms API reference
Platform implementations for different compute environments.
Overview
The platform packages provide implementations for running simulations on various compute platforms including COMPS, Slurm, Docker containers, and local execution.
Platform factory
Platform
Factory for creating platform instances:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Factory Methods:
Platform(name, **kwargs)- Create platform instanceget_platform(name)- Get platform class
COMPS platform
COMPSPlatform
IDM's on premises based and cloud based platform implementation:
1 2 3 4 5 6 7 8 9 | |
Constructor Parameters:
endpoint(str) - COMPS server URLenvironment(str) - Environment name (Calculon(on premises), Nibbler(Azure cloud), SLURMStage, etc.)priority(str) - Job priority (Lowest, BelowNormal, Normal, AboveNormal, Highest)num_cores(int) - CPU cores per simulationnode_group(str) - Target node groupmax_workers(int) - Max concurrent operations
Key Methods:
platform.get_item(exp_id, item_type=ItemType.EXPERIMENT)- Get experiment by idplatform.get_item(exp_id, item_type=ItemType.SIMULATION)- Get simulation by idplatform._experiments.platform_cancel(experiment.id)- Cancel running experiment
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
SSMT work items
1 2 3 4 5 6 7 8 9 | |
Slurm platform
SlurmPlatform
HPC cluster implementation:
1 2 3 4 5 6 | |
Constructor Parameters:
host(str) - Slurm head node hostnameusername(str) - SSH usernamejob_directory(str) - Working directory on clusterpartition(str) - Default partition/queueaccount(str) - Account to chargetime_limit(str) - Default time limit- ...
Example:
1 2 3 4 5 6 7 8 9 10 | |
Container platform
ContainerPlatform attributes
| Attribute | Description |
|---|---|
job_directory |
The directory where job data is stored. |
docker_image |
The Docker image to run the container. |
extra_packages |
Additional packages to install in the container. |
data_mount |
The data mount point in the container. |
user_mounts |
User-defined mounts for additional volume bindings. |
container_prefix |
Prefix for container names. |
force_start |
Flag to force start a new container. |
new_container |
Flag to start a new container. |
include_stopped |
Flag to include stopped containers in operations. |
debug |
Flag to enable debug mode. |
container_id |
The ID of the container being used. |
max_job |
The maximum number of jobs to run in parallel. |
retries |
The number of retries to attempt for a job. |
ntasks |
Number of MPI processes. If greater than 1, it triggers mpirun. |
1 2 3 4 5 6 7 | |
Platform configuration
Configuration file
Example ~/.idmtools/idmtools.ini:
1 2 3 4 | |
See also
- Core API - Core interfaces and classes
- Models API - Task implementations
- Platform Guides - Platform-specific documentation
- Tutorials - Hands-on examples