Cluster Interface
- class vivarium.cluster_tools.core.cluster.interface.NativeSpecification(job_name, project, queue, peak_memory, max_runtime, hardware, cores, requires_archive_node)[source]
- Parameters:
-
requires_archive_node:
bool Whether the task must land on a node tagged with the SLURM
archivefeature.
- to_jobmon_spec(worker_logging_root)[source]
Build the Jobmon compute resources dict from this NativeSpecification.
- Return type:
- Parameters:
worker_logging_root (Path) – Root directory for worker logs.
- Returns:
Dictionary of compute resources for Jobmon.
Notes
memoryis passed in GB because the Jobmon SLURM plugin performs its own GB → MB conversion internally.constraintsis a SLURM--constraintexpression built fromhardwareandrequires_archive_node. The hardware group is always parenthesized and pipe-joined (OR);archiveis AND-joined when required. Examples:"(r650)","(r650|r650v2)","(r650)&archive","(r650|r650v2)&archive","archive". The key is omitted when neither is set.standard_outputandstandard_errorroute SLURM stdout/stderr to the cluster logs directory. The Jobmon SLURM plugin appends the task name and SLURM job ID to these paths automatically.
- vivarium.cluster_tools.core.cluster.interface.get_workflow_timeout_seconds()[source]
Get jobmon workflow’s timeout in seconds.
The result includes a small buffer so that the workflow can shut down gracefully before SLURM terminates the runner node.
- Return type:
- Returns:
Remaining time in seconds (with buffer subtracted), or
Noneif there is no SLURM allocation (in which case Jobmon’s built-in default timeout is used).- Raises:
RuntimeError – If the remaining time is less than the safety buffer, or the remaining time cannot be determined from
squeue.