Cluster Interface

vivarium_cluster_tools.psimulate.cluster.interface.validate_cluster_environment()[source]
Return type:

None

class vivarium_cluster_tools.psimulate.cluster.interface.NativeSpecification(job_name, project, queue, peak_memory, max_runtime, hardware, NUM_THREADS)[source]
Parameters:
job_name: str

Alias for field number 0

project: str

Alias for field number 1

queue: str

Alias for field number 2

peak_memory: float

Alias for field number 3

max_runtime: str

Alias for field number 4

hardware: list[str]

Alias for field number 5

NUM_THREADS: int

Alias for field number 6

to_jobmon_spec(worker_logging_root)[source]

Build the Jobmon compute resources dict from this NativeSpecification.

Return type:

dict[str, Any]

Parameters:

worker_logging_root (Path) – Root directory for worker logs.

Returns:

Dictionary of compute resources for Jobmon.

Notes

  • memory is passed in GB because the Jobmon SLURM plugin performs its own GB → MB conversion internally.

  • constraints is a pipe-separated string of SLURM feature names (e.g. "r650|r650v2"), included only when hardware is requested.

  • standard_output and standard_error route 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.psimulate.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:

int | None

Returns:

Remaining time in seconds (with buffer subtracted), or None if 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.