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.1.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.1-py3-none-any.whl (58.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: slurmwatch-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 0335b90c14500a2849fb2a2d6c6bf84efc466e36077984fb33388488261dc701
MD5 dffdae8a1c11f8bf8701855fc92fbfbb
BLAKE2b-256 3c7c6096e5748316cd92db93ac93d953537c540903f6bc376246ecafd3fa9e37

See more details on using hashes here.

Provenance

The following attestation bundles were made for slurmwatch-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: slurmwatch-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 58.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c7a6505e678688d453bcf2f730d5c350b8dfbd1e5ecbe99a624a4a54c7048a3
MD5 2acf90df9713f8c16e4cc65db415c749
BLAKE2b-256 ccdeffb032f65f5facf0d8ae8281371a99b99ad59b095a0204f12cc8523c4e32

See more details on using hashes here.

Provenance

The following attestation bundles were made for slurmwatch-0.2.1-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

0.2.3

2 files

0.2.2

2 files

This release

0.2.1 This release

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