Generic SLURM dispatch (srun, sbatch, sync, poll, fetch) for the SciTeX ecosystem — login nodes never run compute
Project description
scitex-hpc
Generic SLURM dispatch for the SciTeX ecosystem — srun / sbatch / sync / poll_job / fetch_result with sane defaults for spartan/sapphire and override knobs for any other cluster.
Login nodes never run compute — every command is wrapped in srun or sbatch via a login-shell SSH so the SLURM module loads correctly.
Install
pip install scitex-hpc
Usage
from scitex_hpc import JobConfig, srun, sbatch, sync, poll_job, fetch_result
cfg = JobConfig(
project="scitex-dsp",
command="pip install -e '.[dev]' -q && python -m pytest tests/ -n 16",
host="spartan",
partition="sapphire",
cpus=16,
time="00:30:00",
mem="64G",
)
# 1. Sync local sources to the cluster.
sync(cfg)
# 2a. Blocking interactive run via srun.
exit_code = srun(cfg)
# 2b. Async batch submission via sbatch.
job_id = sbatch(cfg)
print(poll_job(cfg, job_id)) # {'state': 'COMPLETED', 'exit_code': '0:0', 'elapsed': '00:01:23'}
fetch_result(cfg, job_id) # downloads the .out file
Defaults & overrides
Every JobConfig field has a SCITEX_HPC_* env-var override:
| Field | Default | Env override |
|---|---|---|
host |
spartan |
SCITEX_HPC_HOST |
partition |
sapphire |
SCITEX_HPC_PARTITION |
cpus |
16 |
SCITEX_HPC_CPUS |
time |
00:20:00 |
SCITEX_HPC_TIME |
mem |
128G |
SCITEX_HPC_MEM |
remote_base |
~/proj |
SCITEX_HPC_REMOTE_BASE |
Resolution priority: explicit JobConfig field → env var → built-in default.
Status
Standalone module from the SciTeX ecosystem. Public API surfaces in
scitex.hpc (via the umbrella package's sys.modules alias) so you can
write from scitex.hpc import srun from any consumer.
License
AGPL-3.0-only.
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
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 scitex_hpc-0.1.0.tar.gz.
File metadata
- Download URL: scitex_hpc-0.1.0.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1826ee6dc0adfd8e189726e2af6c87b50a769197b38d4a687582bec30645abf7
|
|
| MD5 |
e4275b2e5977a7b44cd1f11db1936a74
|
|
| BLAKE2b-256 |
a03b70729a2c5d10da117f967204702a56d59962d504206aca760e227363cd18
|
File details
Details for the file scitex_hpc-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scitex_hpc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b86a34db418753f4a7b12e1818b5ee9e5b5b78fa00c1ab7a88948d893e7350cd
|
|
| MD5 |
049b36bdb560b922e15f23fb1a2db96d
|
|
| BLAKE2b-256 |
c445586cd0b70829a06b85fd6bac2b44f625955acdc263d0aa7b7258905021eb
|