Skip to main content

scontrol_topology

Overview

Collects Slurm topology from scontrol show topo once per hour. Run one instance per cluster, on the same controller-side host as scontrol.service.

The collector supports block topology (BlockName, BlockIndex, and BlockSize) and switch topology (SwitchName, Level, LinkSpeed, and Switches). Slurm hostlists are expanded into the Nodes tag set, and node_count records the full number of nodes before the 10,000-entry safety limit is applied.

Data Type: DataType.LOG, Schema: ScontrolTopology

Execution Scope

Single node in the cluster. The host must have permission to run scontrol show topo.

Output Schema

The collector publishes one record per block or switch returned by Slurm. Fields that do not apply to the cluster's topology plugin are omitted.

{
"cluster": str, # Cluster identifier
"derived_cluster": str | None, # Derived identifier for heterogeneous clusters

# Block topology
"BlockName": str | None,
"BlockIndex": int | None,
"BlockSize": int | None,

# Switch topology
"SwitchName": str | None,
"Level": int | None,
"LinkSpeed": int | None,
"Switches": str | None, # Child switch expression

"Nodes": list[str] | None, # Expanded Slurm hostlist
"node_count": int, # Number of nodes before truncation
}

Node lists longer than 10,000 entries are truncated to protect the collector; node_count still contains the untruncated count.

Packaged Service

The packaged scontrol_topology.service runs the collector with the settings from the [gcm.scontrol_topology] section of /etc/fb-gcm/config.toml. The packaged configuration uses the OpenTelemetry exporter; configure its endpoint and resource attributes for your observability backend before enabling the service.

systemctl enable --now scontrol_topology.service
systemctl status scontrol_topology.service

Only enable the service on one monitoring host per cluster to avoid duplicate rows.

Command-Line Options

OptionTypeDefaultDescription
--clusterStringAuto-detectedCluster identifier
--sinkStringstdoutSink destination; see Exporters
--sink-optMultiple-Sink-specific option in OmegaConf dot-list syntax
--log-levelChoiceINFOLogging verbosity
--log-folderPathsacct_running_logsParent directory for collector logs
--stdoutFlagFalseWrite collector logs to standard output
--heterogeneous-cluster-v1FlagFalseCompute a derived cluster identifier
--intervalInteger3600Seconds between collection cycles
--onceFlagFalseCollect once and exit
--retriesInteger2Maximum sink write retries
--dry-runFlagFalsePublish records to standard output
--chunk-sizeInteger1MMaximum sink write chunk size in bytes

Values in /etc/fb-gcm/config.toml override these command-line defaults for the packaged service.

Usage Examples

One-Time Collection

Inspect a snapshot without sending it to a remote backend:

gcm scontrol_topology --once --sink stdout

OpenTelemetry Export

Publish through an OTLP-compatible backend:

gcm scontrol_topology --once \
--sink otel \
--sink-opt otel_endpoint=http://localhost:4318 \
--sink-opt "log_resource_attributes={'service.name': 'gcm'}"

Custom Collection Interval

Collect every five minutes and publish to a file:

gcm scontrol_topology \
--interval 300 \
--sink file \
--sink-opt filepath=/tmp/slurm-topology.jsonl