hpc-runner
Submit HPC jobs by tool name, not by scheduler flag.
hpc run xrun -f top.f turns into the right qsub/qrsh call for your
site, with the queue, slots, memory, licences and Environment Modules that
the config file says an Xcelium run needs. Everyone gets the same module
versions, so a flow that works for one user works for all of them.
Full documentation: https://sjalloq.github.io/hpc-runner/
Features
- One CLI and one Python API in front of the scheduler's own commands.
- Config by tool or job type: queue, cpu, mem, time, modules and
resources keyed on the command's first word, or on a
-ttype for makefiles and scripts. - Reproducible environments: every job script runs
module purgeand loads the configured versions. - Dependencies, arrays and pipelines, with
afterok/afternotokemulated on SGE. - Validated config: unknown keys and wrong types are errors with file, line and a "did you mean".
- A terminal monitor,
hpc monitor, for watching your jobs.
Scheduler compatibility
| Scheduler | Status | Notes |
|---|---|---|
| Sun Grid Engine / Open Grid Scheduler | Supported | qsub, qrsh, qstat, qacct, qdel. Integration suite runs against gridengine 8.1.9 in CI. |
| Local | Supported | Runs the job on this machine with the same module environment; no scheduler needed. |
| Slurm | Planned | |
| PBS / Torque | Planned | |
| LSF | Planned |
A scheduler moves to Supported when the integration suite passes against
it. The scheduler is auto-detected; hpc --scheduler NAME or
HPC_SCHEDULER=NAME forces one.
Installation
pip install hpc-runner
hpc config init # starter hpc-runner.toml in the current directory
Python 3.10 or later.
Quick start
# Interactive on the cluster (the default): output streams here, hpc waits
hpc run xterm
# Batch job, return immediately; -t picks a job type from the config
hpc run --batch -t xcelium make sim
# Resources for one run, and block until it finishes
hpc run --batch --wait --cpu 4 --mem 16G --time 4:00:00 make sim
# Preview the generated script without submitting
hpc run --dry-run --cpu 8 make -j8
# Raw scheduler flags go in one quoted string
hpc run -S '-l gpu=1 -P proj' python train.py
The same three steps from Python: a JobSpec says what you want,
resolve() applies the config, a scheduler submits the frozen Job.
# doctest: local
from hpc_runner import Host, JobSpec, get_scheduler, load_config, resolve
config = load_config()
scheduler = get_scheduler(config=config)
job = resolve(JobSpec("python train.py", cpu=4, mem="16G"), config, Host.capture())
result = scheduler.submit(job)
print(result.wait(), result.returncode)
print(result.read_stdout())
Dependencies, array jobs, pipelines and reconnecting to a job by id are in the Python API guide.
Configuration
hpc-runner.toml at the git root is the project config; one in the current
directory overrides it. Settings layer from [defaults] through the tool
matched by the command (or the tools a -t type pulls in) to the command
line, and hpc config resolve CMD shows which layer set each value.
config_version = 1
[defaults]
cpu = 1
mem = "4G"
time = "1:00:00"
modules_path = ["/site/modulefiles"]
[schedulers.sge]
parallel_environment = "smp"
memory_resource = "mem_free"
[tools.xcelium]
commands = ["xrun", "xmvlog", "xmelab", "simvision"] # one entry, several executables
modules = ["xcelium/23.09"]
resources = [{ name = "xcelium_lic", value = 1 }]
[tools.slang]
modules = ["slang/0.9"]
[types.lint]
tools = ["xcelium", "slang"] # pulled in, in this order, then the keys below
cpu = 2
Every key, the merge rules, variable expansion and the SGE mapping are in the configuration reference and the SGE guide.
Documentation
Development
source sourceme # .venv with the dev extras
pytest # unit suite
hpc-testbed pytest --up # integration suite against SGE in Docker
See the development page for the layout, the testbed, golden scripts, docs and releases.
License
MIT License - see LICENSE file for details.
Metadata
Release files for hpc-runner 0.16.0
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 |
|---|---|---|---|---|
| hpc_runner-0.16.0.tar.gz | 439.1 kB | With provenance | Details for hpc_runner-0.16.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hpc_runner-0.16.0-py3-none-any.whl | Python 3 | none | any | Details for hpc_runner-0.16.0-py3-none-any.whl |
Total release size: 596.7 kB
Release files / hpc_runner-0.16.0.tar.gz
| Download URL | hpc_runner-0.16.0.tar.gz |
|---|---|
| Size | 439.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
632310443f1e097fcf7bd33b99e2b007f1a5c37bdb382d114c6116b289cb9cb8
|
|
BLAKE2b-256 checksum How to use checksums |
3c0725db57ac39f948e5b5107c202ef4b3345660ca7f75c584f8e60b2d22bde7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.
Transparency logRelease files / hpc_runner-0.16.0-py3-none-any.whl
| Download URL | hpc_runner-0.16.0-py3-none-any.whl |
|---|---|
| Size | 157.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0de52f2f32fd6f0da0e325a49fdcfe373b41ff2c0c43ebeed0b537177bd0c66a
|
|
BLAKE2b-256 checksum How to use checksums |
9491c52ecea5fa9ea07b1bdf11b9f5cee555efbb09a15aa4b33b5bc4f10da6e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.
Transparency logSecurity for hpc-runner 0.16.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for hpc_runner-0.16.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.
Transparency logA 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.