Skip to content
Projects

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.

Attributes

NameDescription
CLUSTERSNo description.

Classes

NameDescription
ClusterPresetTypical partition/QOS defaults for one HPC system.

Functions

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

CLUSTERSattributemodule attribute#

CLUSTERS: Dict[str, ClusterPreset] = {
  'pitagora': ClusterPreset(
    doc_url='https://docs.hpc.cineca.it/hpc/pitagora.html#job-managing-and-slurm-partitions',
    cpu_partition='dcgp_fua_prod',
    cpu_qos='normal',
    gpu_partition='boost_fua_prod',
    gpu_qos='normal',
    notes=[
      'Production partitions on Pitagora need a budgeted --account; only ptgr_all_serial is budget-free.'
    ]
  )
}

ClusterPresetclassdataclass#

class ClusterPreset(doc_url: str, cpu_partition: Optional[str] = None, cpu_qos: Optional[str] = None, gpu_partition: Optional[str] = None, gpu_qos: Optional[str] = None, notes: List[str] = list())

Typical partition/QOS defaults for one HPC system.

cpu_partitionattributeclass attributeinstance attribute#

cpu_partition: Optional[str] = None

cpu_qosattributeclass attributeinstance attribute#

cpu_qos: Optional[str] = None

doc_urlattributeinstance attribute#

doc_url: str

gpu_partitionattributeclass attributeinstance attribute#

gpu_partition: Optional[str] = None

gpu_qosattributeclass attributeinstance attribute#

gpu_qos: Optional[str] = None

notesattributeclass attributeinstance attribute#

notes: List[str] = field(default_factory=list)

apply_clusterfunction#

def apply_cluster(name: str, overrides: Dict[str, object], uses_gpu: bool) -> None

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 :data: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.