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.12.tar.gz (26.6 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.12-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: seamm_slurm-2026.8.12.tar.gz
  • Upload date:
  • Size: 26.6 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.12.tar.gz
Algorithm Hash digest
SHA256 1fadebaf4e9959f81e2c2c3564eb778bcb3b2efba0d10317a0b0f1caa5ba445b
MD5 9e307bef74bc42042987bfbeeb1c2b78
BLAKE2b-256 55a67753380634e54a770cac88281b498b423e71451bfa86050c53b4fe6458e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamm_slurm-2026.8.12-py3-none-any.whl
Algorithm Hash digest
SHA256 238c9d2330eaebcfa929cbd448f3c105803dedff2ced908b56377349ab5269b3
MD5 7516d362814c2187c2f401ba1bd3412b
BLAKE2b-256 4e042dd52aabdee8aa5009b1ca9b1831e7021b30e9fb6f3385f61740161f6b40

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