Skip to main content

slurmwatch

Live, per-process CPU / memory / GPU telemetry for a running Slurm job — with a plain-language efficiency verdict.

CI PyPI Python 3.10+ MIT License Ruff

slurmwatch live TUI dashboard: per-process CPU, memory, and GPU telemetry for a Slurm job. The status banner flips from a green ALL HEALTHY line to a red MEMORY — OOM RISK alarm as working-set memory climbs, while flagging an idle GPU (1 of 2 active).

Features

  • Answer-first dashboard — a status banner states the worst problem in plain language (MEMORY 91% — OOM RISK, 1 OF 2 GPUS IDLE) and an efficiency block spells out the fix. One color rule: bars show magnitude, status dots ( healthy / warning / critical) show health. Tall history charts fill the rest of the screen so trends (memory climbing toward the limit) are visible at a glance.
  • Per-process GPU attribution — NVML sees only your PIDs, so a neighbor's job never inflates your numbers.
  • Honest memory — working set (RSS minus reclaimable cache) with a configurable OOM guard.
  • Works anywhere — full live telemetry on the node; auto-falls back to Slurm accounting (sstat) from a login node.
  • Zero configslurmwatch <jobid> auto-discovers jobs, cgroup v1/v2, and whether it's on the node. No flags to memorize.

Install

pip install slurmwatch

Requires Python 3.10+ and Linux with cgroup v1 or v2. One install works across a mixed cluster: GPU monitoring (NVIDIA, via pynvml) auto-activates on GPU nodes and is silently skipped on CPU-only nodes. Works with pipx / uv too — e.g. uv tool install slurmwatch.

Usage

slurmwatch                       # auto-discover and attach to your running job
slurmwatch 12345                 # attach to a job (array: 12345_3, het: 12345+1)
slurmwatch --demo                # try the live TUI right now — no Slurm needed
slurmwatch 12345 --once --json   # one machine-readable snapshot, then exit
slurmwatch 12345 --log run.jsonl # headless logging (JSON Lines or CSV)

Run it from anywhere: on a login node, slurmwatch automatically attaches to the job's compute node (via srun --overlap) to show the live dashboard — no manual srun needed. If it can't attach, it falls back to an sstat summary (peak memory + CPU time + allocation); GPU utilization isn't available that way, since Slurm tracks GPU count, not per-device util. Set SLURMWATCH_NO_HOP=1 to skip the hop and always get the summary. (The attached view runs inside the job's allocation, so it counts against the job's resources.)

TUI keys: c/m/g open a CPU / memory / GPU detail view — the memory view breaks down working set vs. cache and the headroom to the OOM line, and the GPU view shows this job's per-device share (JOB% / JOB VRAM), each over a full-height history graph. Arrows/PgUp/PgDn scroll and q quits. Mouse capture is off so you can select and copy text normally; set SLURMWATCH_MOUSE=1 to enable mouse/wheel support instead.

Exit codes: 0 success · 1 runtime failure · 2 bad config. Errors go to stderr, so piped --once/--log output stays clean.

See slurmwatch --help for the full flag list. Behavior is also tunable via SLURMWATCH_* environment variables — e.g. SLURMWATCH_OOM_WARN, SLURMWATCH_GPU_IDLE_PCT, SLURMWATCH_POLL_INTERVAL (plus ASCII mode and more).

Library

import asyncio
from slurmwatch import TelemetryCollector, resolve_job_context

async def sample(job_id: str):
    collector = TelemetryCollector(resolve_job_context(job_id))
    await collector.start()
    try:
        print((await collector.next_snapshot()).to_json())
    finally:
        await collector.stop()

asyncio.run(sample("12345"))

Limitations

  • NVIDIA-only GPU support (no AMD/ROCm).
  • Single-node view — multi-node jobs show data for the node you're on.
  • Live GPU utilization and working-set memory require running on the job's node.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slurmwatch-0.2.3.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slurmwatch-0.2.3-py3-none-any.whl (58.9 kB view details)

Uploaded Python 3

File details

Details for the file slurmwatch-0.2.3.tar.gz.

File metadata

  • Download URL: slurmwatch-0.2.3.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for slurmwatch-0.2.3.tar.gz
Algorithm Hash digest
SHA256 77e6a7a384d054640d374f0f36f30a676dcede3e1e1d942bc98c35ba95bfff96
MD5 eed84956659b6339f045c2a32bd89179
BLAKE2b-256 4dfb6e6a4ea05d94e70c39c0b313ac807cd6c0a7e01b03d147b9404cbdf2d75a

See more details on using hashes here.

Provenance

The following attestation bundles were made for slurmwatch-0.2.3.tar.gz:

Publisher: release.yml on PursuitOfDataScience/slurmwatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file slurmwatch-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: slurmwatch-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 58.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for slurmwatch-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c2f6f562faf3e509716b18137431e6ba3736b79dd2b6b3fe36f0beae28734d94
MD5 35ee1dfa1280d551527b23094f4b63a0
BLAKE2b-256 44be478c50200c226860b9e3d109cb91d90aabf146f349e93939a27e48f2797e

See more details on using hashes here.

Provenance

The following attestation bundles were made for slurmwatch-0.2.3-py3-none-any.whl:

Publisher: release.yml on PursuitOfDataScience/slurmwatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.1.1

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

0.10.1

2 files

0.10.0

2 files

0.9.9

2 files

0.9.8

2 files

0.9.7

2 files

0.9.6

2 files

0.9.5

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

This release

0.2.3 This release

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page