A job manager for Slurm. Submit, monitor, and automatically recover large batches of jobs from a single terminal.
- Why
- Job State Machine
- How It Compares
- Features
- Requirements
- Installation
- Quick Start
- Configuration
- Auto-Scaling
- The Dashboard
- Platform
- Contributing
- Disclaimer
- License
- Contact
- TODO
Slurm commands are designed for cluster administrators. For researchers running batch experiments, common tasks require long commands and manual bookkeeping.
If you run large parameter sweeps on Slurm, you know these problems:
- Array job limits. Most clusters cap job arrays at 1000 tasks. If you have 5,000 parameter combinations, you need workarounds.
- Preempted jobs vanish. On shared partitions, jobs get preempted. Finding which job disappeared and resubmitting them is manual work.
- No global progress view.
squeueshows what is running right now. It does not tell you "3,200 of 5,000 jobs are done." - State is lost between sessions. Close your terminal, and you lose track of what completed, what failed, and why.
slurmigo handles all of this. One command, one dashboard, automatic recovery.
Every job managed by slurmigo moves through these states:
stateDiagram-v2
[*] --> NOT_SUBMITTED
NOT_SUBMITTED --> PENDING : sbatch succeeds
PENDING --> RUNNING : squeue reports RUNNING
PENDING --> FAILED : vanished from squeue,<br>sacct reports failure
RUNNING --> COMPLETED : sacct reports COMPLETED
RUNNING --> FAILED : sacct reports TIMEOUT /<br>OOM / PREEMPTED / other
FAILED --> PENDING_RESUBMISSION : retryable reason<br>AND retries < max
FAILED --> FAILED_PERMANENTLY : non-retryable reason<br>OR retries >= max
PENDING_RESUBMISSION --> PENDING : resubmitted<br>(with scaled resources if timeout/oom)
COMPLETED --> [*]
FAILED_PERMANENTLY --> [*]
- Preempted jobs are resubmitted with the same resources.
- Timed-out jobs are resubmitted with more wall time (configurable multiplier).
- Out-of-memory jobs are resubmitted with more memory (configurable multiplier).
- Code errors (non-zero exit code, segfault, etc.) are not retried.
TUI tools don't manage. Management tools don't have TUIs.
| Tool | Live TUI | Auto-Resubmit | Exceed Array Limit | Batch Orchestration |
|---|---|---|---|---|
| turm | Yes | No | No | No |
| stui | Yes | No | No | No |
| SlurmCommander | Yes | No | No | No |
| submitit (Meta) | No | Yes | Yes | Yes |
| SEML | No | Yes | No | Yes |
| slurmigo | Yes | Yes | Yes | Yes |
Unlike submitit and SEML, slurmigo works with any existing sbatch script. You do not need to rewrite your code or wrap it in a Python API.
- Live dashboard -- a color-coded grid shows the status of every job at a glance
- Automatic resubmission -- preempted jobs are detected and resubmitted, up to a configurable limit
- Auto-scaling -- wall time and memory are scaled up automatically on timeout or OOM failures
- No array size limit -- manages any number of tasks by submitting individual jobs from a parameter file
- Per-partition throttling -- submits jobs up to your cluster's limits, no more
- Persistent state -- stop and restart at any time; progress is saved to disk
- Lightweight -- one dependency (
rich)
- Python 3.9+
richlibrary (installed automatically)- Access to Slurm commands:
sbatch,squeue,sacct
pip install git+https://github.com/hainingpan/slurmigo.gitOr for development:
git clone https://github.com/hainingpan/slurmigo.git
cd slurmigo
pip install -e .One line per job. Each line contains the parameters for one run.
alpha=0.1 beta=0.5
alpha=0.2 beta=0.5
alpha=0.3 beta=1.0
alpha=0.4 beta=1.0
You can have any number of lines. There is no array limit.
Parameters from each line of your parameter file are automatically available as environment variables inside the job.
#!/bin/bash
#SBATCH --partition=main
#SBATCH --time=01:00:00
#SBATCH --mem=4G
#SBATCH --output=logs/job_%j.out
# Parameters are automatically available as environment variables
python my_experiment.py --alpha $alpha --beta $betaThe simplest way to start:
slurmigo --params params.txt --script run.shThis submits your jobs, tracks their progress, resubmits preempted ones, and shows a live dashboard. Press Ctrl+C to stop at any time. Run the command again to resume -- all progress is saved.
If you want to customize settings (check interval, max retries, partition limits, scaling multipliers), create a slurmigo.toml file in your working directory. See Configuration below. Once a config file exists, you can run with just:
slurmigoCommand-line options always override config file settings.
Each parameter file is tracked as a separate session. You can run multiple parameter files without interference:
slurmigo --params sweep_v1.txt --script run.sh # session 1
slurmigo --params sweep_v2.txt --script run.sh # session 2 (independent)If you modify a parameter file and run again, slurmigo detects the content change (by hash) and asks whether to continue the previous session or start fresh. To skip the prompt and always start a new session:
slurmigo --fresh --params params.txt --script run.shCreate a slurmigo.toml file in your working directory. All fields are optional -- slurmigo uses sensible defaults for anything you omit. Command-line flags (e.g., --interval, --max-resubmits) override the corresponding config file settings.
# Required: path to your parameter file (one set of params per line)
params_file = "params.txt"
# Required: path to your sbatch submission script
script = "run.sh"
# Seconds between each poll cycle (default: 60)
check_interval = 60
# Maximum retry attempts per job (default: 3)
max_resubmits = 3
# Wall time multiplier on TIMEOUT resubmission (default: 1.5)
timeout_multiplier = 1.5
# Memory multiplier on OUT_OF_MEMORY resubmission (default: 1.5)
oom_multiplier = 1.5
# Maximum concurrent jobs per partition
[max_jobs_per_partition]
default = 150
main = 500
gpu = 150| Parameter | Default | Description |
|---|---|---|
params_file |
(required) | Path to the parameter file, one line per job |
script |
(required) | Path to your sbatch submission script |
check_interval |
60 |
Seconds between status checks |
max_resubmits |
3 |
Maximum retry attempts per failed job |
timeout_multiplier |
1.5 |
Wall time multiplier applied on TIMEOUT resubmission |
oom_multiplier |
1.5 |
Memory multiplier applied on OUT_OF_MEMORY resubmission |
max_jobs_per_partition |
{"default": 150} |
Maximum concurrent jobs per Slurm partition |
When a job exceeds its wall time limit (TIMEOUT), slurmigo resubmits it with the wall time multiplied by timeout_multiplier (default: 1.5). When a job runs out of memory (OUT_OF_MEMORY), it is resubmitted with memory multiplied by oom_multiplier (default: 1.5).
Both types of resubmission are given priority over new jobs.
The live terminal dashboard shows:
- Progress bar -- overall completion percentage
- Status grid -- each block represents one job, colored by status:
- Green: completed
- Cyan: running
- Yellow: pending or queued
- Red: failed
- Gray: not yet submitted
- Detail tables -- running jobs with elapsed time, pending jobs, recent completions, and failures with reasons
For large campaigns (thousands of jobs), the grid automatically zooms to show the active region.
Tested on Amarel HPC (Rutgers University). Should work on any cluster running Slurm with standard commands (sbatch, squeue, sacct).
Contributions are welcome.
For local development, clone the repo and install in editable mode:
git clone https://github.com/hainingpan/slurmigo.git
cd slurmigo
pip install -e .Or with uv:
git clone https://github.com/hainingpan/slurmigo.git
cd slurmigo
uv sync-
Code logic (no Slurm required):
pytest
-
Job submission scenarios (requires Slurm, will submit real test jobs):
pytest tests/integration/ -v -s
For bug reports, questions, or feature requests, please open an issue on GitHub.
- Fork the repository
- Create a branch for your changes
- Ensure tests pass (
pytest) - Submit a pull request
Use at your own risk. Consult your cluster administrator before use. Do not set aggressive options (very short check intervals, very high job limits). Be a good neighbor on shared resources.
BSD 3-Clause License
Copyright (c) 2025, Haining Pan
See LICENSE for details.
Author: Haining Pan -- hnpan@terpmail.umd.edu
- GPU-aware auto-scaling
- Interactive controls (cancel jobs, pause submission from the dashboard)
