Add your description here
Project description
nanoslurm
nanoslurm is a zero-dependency Python wrapper for SLURM job submission and monitoring.
It uses a tiny POSIX-compatible shell script to call sbatch and related commands, avoiding any heavy Python dependencies.
Features
- Submit jobs from Python without
pyslurmor other packages - Monitor status (
PENDING,RUNNING,COMPLETED, etc.) - Cancel jobs
- Tail job logs
- Get detailed info via
scontrol - Respects working directory at runtime (
sbatch -D)
Requirements
- SLURM cluster with
sbatch,squeue, and optionallysacct/scontrol - Python ≥ 3.9
Quickstart
import nanoslurm
job = nanoslurm.submit(
command=["python", "train.py", "--epochs", "10"],
name="my_job",
cluster="gpu22",
time="01:00:00",
cpus=4,
memory=16,
gpus=1,
stdout_file="./slurm_logs/%j.txt",
stderr_file="./slurm_logs/%j.err",
signal="SIGUSR1@90",
workdir="."
)
print(job) # Job(id=123456, name='my_job_2025-08-08_09-12-33.123', ...)
print(job.status) # "PENDING", "RUNNING", ...
print(job.is_running()) # True / False
print(job.is_finished()) # True / False
print(job.info()) # Detailed dict from scontrol
job.tail(10) # Last 10 lines of stdout
job.wait(poll_interval=5) # Wait until completion
job.cancel() # Cancel job
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nanoslurm-0.1.0.tar.gz
(9.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
nanoslurm-0.1.0-py3-none-any.whl
(10.1 kB
view details)
File details
Details for the file nanoslurm-0.1.0.tar.gz.
File metadata
- Download URL: nanoslurm-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4367e5ec824ca487f6284978032f35d291e5be3a7a33dd9c4eff4dd9878c396f
|
|
| MD5 |
b2e9e78ae2b0b8e0c5a61ba7c00c5dc1
|
|
| BLAKE2b-256 |
9f39372b4e68379268566f28b7c764d3ed262cacb42b2f38d010eda8a42e1ff1
|
File details
Details for the file nanoslurm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nanoslurm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d3b1fe243f528221599191ed4bb219a6aef64428452aa85f4b9a1a2e51efc4a
|
|
| MD5 |
9eac86354a4f735358927fcf0240b8e8
|
|
| BLAKE2b-256 |
9270eb9ab8453d1220435acdaf35c40efbb15d6de086aac9bf72a65ee7074f8c
|