Skip to main content

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 -t type for makefiles and scripts.
  • Reproducible environments: every job script runs module purge and loads the configured versions.
  • Dependencies, arrays and pipelines, with afterok/afternotok emulated 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 before --, the command after
hpc run -q gpu.q -l gpu=1 -- 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
make -C testbed sge-up sge-test   # 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.15.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hpc-runner 0.15.1
File Size Uploaded Provenance Actions
hpc_runner-0.15.1.tar.gz 328.4 kB With provenance Details for hpc_runner-0.15.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hpc-runner 0.15.1
File Interpreter ABI Platform Actions
hpc_runner-0.15.1-py3-none-any.whl Python 3 none any Details for hpc_runner-0.15.1-py3-none-any.whl

Total release size: 459.6 kB

Release files / hpc_runner-0.15.1.tar.gz

Download URL hpc_runner-0.15.1.tar.gz
Size 328.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ba867c534482cf3e078883a8edd2735a2cefff63a06d24af3d47165324b5176b
BLAKE2b-256 checksum
How to use checksums
ff88043c4a18f9c334e95dfe4bbc1bf0c2abbc53f86ae09da6aeefcb8120dbb2
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 Oct 30, 2026.

Transparency log

Release files / hpc_runner-0.15.1-py3-none-any.whl

Download URL hpc_runner-0.15.1-py3-none-any.whl
Size 131.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50e00148d1c2212e29f40b1e19e3158a6df59d127ef0905996df26504fcb9dc3
BLAKE2b-256 checksum
How to use checksums
c5b160b533259690834c4b5e1a13ea4f69bb08ca982b7c388234a5a0bcf6bcd7
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 Oct 30, 2026.

Transparency log

Security for hpc-runner 0.15.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hpc_runner-0.15.1.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 Oct 30, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.15.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page