Skip to main content

seamm_slurm

GitHub Actions Build Status

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

seamm_slurm-2026.8.13.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

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

seamm_slurm-2026.8.13-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file seamm_slurm-2026.8.13.tar.gz.

File metadata

  • Download URL: seamm_slurm-2026.8.13.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for seamm_slurm-2026.8.13.tar.gz
Algorithm Hash digest
SHA256 85b23408fbf7896a60077093e844c0e2c07f4146eb201285a96e063bba646495
MD5 4db68a1ed64eafd94b78b2646c929c4b
BLAKE2b-256 80d911b1a86d1b30caaef8f2b2cae388bce67d1ee24d8f12c28693115b62848f

See more details on using hashes here.

File details

Details for the file seamm_slurm-2026.8.13-py3-none-any.whl.

File metadata

File hashes

Hashes for seamm_slurm-2026.8.13-py3-none-any.whl
Algorithm Hash digest
SHA256 c55c362ec40478a06211a3859a305b1cc038918779bf14afe337ef3cead17d5e
MD5 eb20631d4c18a7b6ff06fb31bc2f93bf
BLAKE2b-256 93819b7260c2ee6245b1cf17258327bbcd006aa9df65add346025aba35112e74

See more details on using hashes here.

Supported by

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