hpc_connect: lightweight HPC submission and launching interfaces
Project description
hpc_connect
hpc_connect provides Python interfaces for HPC backends (local, Slurm, PBS, Flux, …) and launch (MPI-style mpiexec/mpirun, Slurm srun, etc.). Backends are provided via plugins; configuration selects a backend and optionally overrides its defaults.
Install
python3 -m pip install hpc-connect
Python usage
import hpc_connect
# Select by backend instance name or backend type (see config below)
backend = hpc_connect.get_backend("slurm")
If you have multiple configured backends, pass an explicit name/type or set hpc_connect.backend in YAML.
Configuration
Config is YAML under the hpc_connect: key.
Minimal config
hpc_connect:
backend: slurm
Full config shape
hpc_connect:
debug: false
# Optional default backend selector for CLI / get_backend() with no argument
backend: this-site
backends:
- name: this-site # optional instance name
type: slurm # required backend type (plugin id)
config: {} # backend-specific settings (plugin-defined)
# optional: launch settings for this backend instance
launch:
type: srun # e.g. "mpi" or "srun"
exec: srun # optional; adapter may provide a default
numproc_flag: -n
default_options: []
pre_options: []
variables: {} # string->string map (if adapters use it)
mpmd:
global_options: []
local_options: []
# optional: submit/poll tuning (backend-defined semantics)
submit:
default_options: []
polling_interval: 2.0
Backend selection rules
get_backend("X") selects:
- a backend entry with name == "X", else
- a backend entry with type == "X", else
- treats "X" as a backend type with no per-entry overrides.
If no argument is provided, it uses hpc_connect.backend if set; otherwise, if exactly one backend entry exists, it selects that; else it errors (ambiguous).
hpc-launch (CLI)
hpc-launch runs an application using the selected backend and its launch configuration:
hpc-launch [launcher-options] <application> [application-options]
The command line is constructed roughly as:
<exec> <default_options> [launcher-options] <pre_options> <application> [application-options]
MPMD is supported via launch.mpmd.* when enabled by the launcher type.
Examples
Local + MPICH-style -np
hpc_connect:
backend: local
backends:
- type: local
launch:
type: mpi
exec: mpiexec
numproc_flag: -np
Slurm + srun
hpc_connect:
backend: slurm
backends:
- type: slurm
launch:
type: srun
exec: srun
Project details
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 hpc_connect-26.3.26.tar.gz.
File metadata
- Download URL: hpc_connect-26.3.26.tar.gz
- Upload date:
- Size: 48.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cb9ab0afb9f6fa78eb8c01d05bb7faf78216a85f55e0a3b1452e335bc190550
|
|
| MD5 |
fd8e9369e8715a2a4c96939b9207f2ee
|
|
| BLAKE2b-256 |
88ff94cd5f1622fc8b164ee1c0338cff282ebf2792f4222dd9de3ab616058abe
|
Provenance
The following attestation bundles were made for hpc_connect-26.3.26.tar.gz:
Publisher:
publish.yml on sandialabs/hpc-connect
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hpc_connect-26.3.26.tar.gz -
Subject digest:
5cb9ab0afb9f6fa78eb8c01d05bb7faf78216a85f55e0a3b1452e335bc190550 - Sigstore transparency entry: 1186701436
- Sigstore integration time:
-
Permalink:
sandialabs/hpc-connect@615854abdf5661eccf3bf369051657d09f8df6d9 -
Branch / Tag:
refs/tags/release/26.03.26 - Owner: https://github.com/sandialabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@615854abdf5661eccf3bf369051657d09f8df6d9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hpc_connect-26.3.26-py3-none-any.whl.
File metadata
- Download URL: hpc_connect-26.3.26-py3-none-any.whl
- Upload date:
- Size: 50.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a6edbb6d84eb16a8fa4e00856d715586bd74b9640e776d7ae64075b5312ad1e
|
|
| MD5 |
48f887ef56782e6560137dff4209ba32
|
|
| BLAKE2b-256 |
750087907f633be614a96b739117f4012f101ff26eb63f3455a52f09b1854586
|
Provenance
The following attestation bundles were made for hpc_connect-26.3.26-py3-none-any.whl:
Publisher:
publish.yml on sandialabs/hpc-connect
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hpc_connect-26.3.26-py3-none-any.whl -
Subject digest:
6a6edbb6d84eb16a8fa4e00856d715586bd74b9640e776d7ae64075b5312ad1e - Sigstore transparency entry: 1186701445
- Sigstore integration time:
-
Permalink:
sandialabs/hpc-connect@615854abdf5661eccf3bf369051657d09f8df6d9 -
Branch / Tag:
refs/tags/release/26.03.26 - Owner: https://github.com/sandialabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@615854abdf5661eccf3bf369051657d09f8df6d9 -
Trigger Event:
push
-
Statement type: