slurm_script_generator.clusters#

Per-cluster presets for slurm-template’s --cluster flag.

Each preset fills in the handful of pragmas that are specific to one HPC system’s SLURM configuration — mainly --partition and --qos, chosen separately for CPU-only and GPU jobs — without touching anything the caller already set explicitly. It also points at that system’s own documentation, since partition/QOS naming and limits are the kind of thing that changes over time and should be double-checked there, not trusted blindly from here.

Functions

apply_cluster(name, overrides, uses_gpu)

Fill cluster-specific partition/QOS defaults into overrides, in place.

Classes

ClusterPreset(doc_url, cpu_partition, ...)

Typical partition/QOS defaults for one HPC system.

class slurm_script_generator.clusters.ClusterPreset(doc_url: str, cpu_partition: str | None = None, cpu_qos: str | None = None, gpu_partition: str | None = None, gpu_qos: str | None = None, notes: ~typing.List[str] = <factory>)[source]#

Bases: object

Typical partition/QOS defaults for one HPC system.

cpu_partition: str | None = None#
cpu_qos: str | None = None#
doc_url: str#
gpu_partition: str | None = None#
gpu_qos: str | None = None#
notes: List[str]#
slurm_script_generator.clusters.apply_cluster(name: str, overrides: Dict[str, object], uses_gpu: bool) None[source]#

Fill cluster-specific partition/QOS defaults into overrides, in place.

Only sets a key that’s still None, so a value the caller already passed explicitly (e.g. an explicit --partition) always wins over the preset.

Parameters:
  • name (str) – A key in CLUSTERS.

  • overrides (dict) – The in-progress overrides dict to update in place.

  • uses_gpu (bool) – Whether the job requests a GPU, to pick the GPU vs CPU partition/QOS.

Raises:

KeyError – If name is not a known cluster.