seamm_slurm
A small library that wraps the SLURM command-line tools (sbatch, squeue,
sacct, scancel) behind one interface, SlurmBackend, with two transports:
LocalSlurm-- runs the SLURM CLI directly on the current host (the host running the code is itself a SLURM submit host, e.g. a cluster head/login node).SshSlurm-- runs the same commands on a remote host over passwordless SSH (the host running the code is not a SLURM submit host).
Both transports share the same submit/poll/cancel logic and SLURM-version
handling (some clusters support squeue --json/sacct --json, others only
have plain columnar output -- this library prefers JSON when available and
falls back to --parsable2/--format= text parsing otherwise, transparently
to the caller).
submit() takes the full script text (shebang, #SBATCH directives,
payload) and feeds it to sbatch --parsable on stdin -- it never needs the
script to exist as a file on the target host, so submission works identically
whether the caller and the SLURM cluster share a filesystem or not.
seamm_slurm.script.build_script() is a small helper for building that
script text from a directives dict (partition/account/qos/nodes/ntasks/time/
mem/gpus/...) plus a payload command, matching the
<root>/<jobserver-name>.ini config shape used by seamm_jobserver.
poll_many() takes a batch of SLURM job IDs (not one call per job) and
returns a JobStatus per ID, merging live state from squeue with
historical/terminal state from sacct -- sacct is the source of truth once
a job has left the live queue.
seamm_slurm.config reads a JobServer's <root>/<jobserver-name>.ini
(load_slurm_config/SlurmSection) -- the same system/machine config file
seamm_jobserver itself uses, moved here so any dependency-light consumer
(a future job-submission UI, for instance) can read and validate it without
pulling in the rest of the SEAMM stack. Includes an optional
[<section>.limits] companion section and SlurmSection.merge_overrides(),
for sites that want to let a job override some of the section's defaults
(cores, memory, walltime, ...) within enumerated choices or numeric/size/
time bounds -- secure by default, nothing is overridable unless a site's
.limits section says so.
This package intentionally has no SEAMM-core/molsystem/dashboard
dependency and no notion of SEAMM's own job-status vocabulary -- it only
speaks SLURM's. seamm_jobserver's whole-flowchart SLURM submission mode is
the first consumer, validated end-to-end against a real cluster; a future
seamm_exec Slurm executor (per-step submission) is expected to reuse the
same backend rather than duplicating the SLURM-CLI handling.
See docs/developer_guide/campaigns/2026-08-06/index.rst in this repo, and
seamm_jobserver's own docs/developer_guide/campaigns/2026-08-05/ (the
full cross-repo SLURM-integration campaign, moved there from a
workspace-level scratch doc), for the design rationale.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file seamm_slurm-2026.8.11.tar.gz.
File metadata
- Download URL: seamm_slurm-2026.8.11.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e82133f62c975b2ec115131a45a000545827cba79c61fee79dd7bd6e4002f191
|
|
| MD5 |
c2a0f7b685480f53d753c1336a1ae16b
|
|
| BLAKE2b-256 |
25d14c3e5393f4547646af10ffd2ab28e22821f86f4c82c75e95533de9ec2c16
|
File details
Details for the file seamm_slurm-2026.8.11-py3-none-any.whl.
File metadata
- Download URL: seamm_slurm-2026.8.11-py3-none-any.whl
- Upload date:
- Size: 27.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc9c972ad0fd391ebb964a68b8c3200ebdea17fa589f151ec160239aa8c95650
|
|
| MD5 |
d4a871902b3791468ae2ed2a5bf3cf10
|
|
| BLAKE2b-256 |
a75f6bec6feefa3e6affa92206c9f9a5533a25900ec1c2ce70ec5040844d7878
|