scitex-hpc
HPC batch dispatch across Slurm and TSUBAME Grid Engine, with persistent Slurm allocations.
Full Documentation · uv pip install scitex-hpc[all]
Problem and Solution
| # | Problem | Solution |
|---|---|---|
| 1 | Login nodes silently run compute — sysadmins kill stray processes, jobs die unannounced | Scheduler submissions place workloads on allocated compute nodes; login-shell SSH resolves the scheduler tools |
| 2 | Queue wait dominates iteration for short multi-agent / dev workflows | Reservation.book(..., persistent=True) — book a node once, exec() many short commands inside the same allocation; SIGUSR1 trap auto-resubmits at walltime |
| 3 | Per-cluster knob soup (partition, cpus, time, mem) repeated in every job script | Explicit scheduler profiles and portable batch requests, alongside the existing JobConfig configuration cascade |
Installation
pip install scitex-hpc
The scheduler examples below require scitex_hpc.scheduler. Older published
packages do not include this interface. To use the current source before its
next release, run this from a checkout of this repository:
uv pip install -e '.[all]'
Quick Start
The new scitex_hpc.scheduler interface provides ComputeClient,
BatchRequest, explicit HostProfile configuration, dry-run plans,
submission, conservative status interpretation, and cancellation for Slurm
and the TSUBAME Grid Engine dialect. Python, CLI, and FastMCP adapters share the same operations.
This is a single-node batch subset, not a claim of live site admission,
interactive Grid Engine leases, MPI, arrays, renewal, or Web API serving.
from scitex_hpc.scheduler import BatchRequest, ComputeClient, HostProfile
client = ComputeClient(HostProfile(host="my-slurm-alias", scheduler="slurm"))
request = BatchRequest(
argv=("python3", "analysis.py"),
working_directory="~/proj/my-project",
cpus=4,
memory_mib=4096,
walltime_seconds=60,
)
plan = client.plan(request) # Pure planning: no SSH or cluster submission.
Read the scheduler portability guide for profile examples, CLI commands, resource-bundle semantics, module setup, MCP operations, and uncertain submission outcomes. The same guide ships in the installed skills. Existing Slurm APIs and persistent leases remain available.
Architecture
flowchart LR
API[Python / CLI / MCP] --> Client[Batch compute operations]
Profiles[Configured host profiles] --> Client
Client --> Slurm[Slurm]
Client --> Grid[TSUBAME Grid Engine]
Leases[Existing persistent leases] --> Slurm
Slurm --> Compute[Allocated compute nodes]
Grid --> Compute
Site settings belong in ~/.scitex/hpc/config.yaml (relocatable through
SCITEX_DIR). Named scheduler profiles reference SSH aliases and verified
site resource mappings; they do not duplicate the Dev hosts registry or store
credentials. Compute runs inside scheduler allocations, not on login nodes.
1 Interfaces
Python API ⭐⭐⭐ (primary)
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",
)
sync(cfg) # 1. push local sources to the cluster
exit_code = srun(cfg) # 2a. blocking interactive run
job_id = sbatch(cfg) # 2b. async batch submission
print(poll_job(cfg, job_id)) # {'state': 'COMPLETED', 'exit_code': '0:0', ...}
fetch_result(cfg, job_id) # downloads the .out file
Reservations (book once, exec many)
from scitex_hpc import JobConfig, Reservation
res = Reservation.book(
JobConfig(project="dev-pool", host="spartan", partition="cascade",
cpus=8, mem="32G", time="7-0"),
persistent=True, # walltime auto-resubmit via SIGUSR1
)
res.exec("hostname")
res.exec(["python", "-m", "unittest", "discover"])
res.attach(cmd="bash") # interactive shell on the compute node
# Look up later by friendly name (state in ~/.scitex/hpc/leases/)
res = Reservation.get("dev-pool")
res.release() # scancel + clear state
CLI ⭐⭐
scitex-hpc lease book dev-pool --host spartan --cpus 8 --mem 32G --time 7-0 --persistent
scitex-hpc lease list
scitex-hpc lease exec dev-pool 'hostname'
scitex-hpc lease attach dev-pool
scitex-hpc lease cancel dev-pool
reservationsis a deprecated alias forlease— existingscitex-hpc reservations …callers keep working (with a one-line deprecation notice on stderr), butleaseis the documented name.
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.
Walltime auto-resubmit (persistent=True)
When persistent=True, scitex-hpc:
- Adds
#SBATCH --signal=B:USR1@3600so SLURM signals the script 1 h before walltime. - Wraps the sbatch body with a SIGUSR1 trap that calls
sbatch "$0"to resubmit itself. - The friendly name (
dev-pool) stays stable across resubmits; the SLURMjob_idchanges.
res = Reservation.get("dev-pool")
res.refresh() # squeue --user --name=dev-pool
res.exec("...") # uses the new job_id
SLURM's documented signaling mechanism — no custom daemon. Compatible with HPC policies that ban persistent user-space daemons. SSH ControlMaster pooling on the calling host amortizes per-exec() handshake cost.
Part of SciTeX
scitex-hpc is part of SciTeX. Install via
the umbrella with pip install scitex[hpc] to use as
scitex.hpc (Python) or scitex hpc ... (CLI).
Four Freedoms for Research
- The freedom to run your research anywhere — your machine, your terms.
- The freedom to study how every step works — from raw data to final manuscript.
- The freedom to redistribute your workflows, not just your papers.
- The freedom to modify any module and share improvements with the community.
AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.
Metadata
Release files for scitex-hpc 0.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scitex_hpc-0.9.1.tar.gz | 237.3 kB | Without provenance | Details for scitex_hpc-0.9.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scitex_hpc-0.9.1-py3-none-any.whl | Python 3 | none | any | Details for scitex_hpc-0.9.1-py3-none-any.whl |
Total release size: 544.0 kB
Release files / scitex_hpc-0.9.1.tar.gz
| Download URL | scitex_hpc-0.9.1.tar.gz |
|---|---|
| Size | 237.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b56ee0d3df9d5f89c91086a253481b7d0c611263db09bd1dbba30b59d64b9a9a
|
|
BLAKE2b-256 checksum How to use checksums |
bd4bf7c8e1bbb721afdbf5299466bf400e97f69e944a4fa0a05a6af20afe6273
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / scitex_hpc-0.9.1-py3-none-any.whl
| Download URL | scitex_hpc-0.9.1-py3-none-any.whl |
|---|---|
| Size | 306.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea8407fe35eaee0a928b1e63295383a7b3b2e434ead33eb77562c75ac046b11c
|
|
BLAKE2b-256 checksum How to use checksums |
32fd72f70fd7c32cf2e2e5da4729e9a241c6707edc58bfca9b890dbf7b2bee74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for scitex-hpc 0.9.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.