Skip to main content

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

hpc_connect-26.5.10.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hpc_connect-26.5.10-py3-none-any.whl (51.7 kB view details)

Uploaded Python 3

File details

Details for the file hpc_connect-26.5.10.tar.gz.

File metadata

  • Download URL: hpc_connect-26.5.10.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hpc_connect-26.5.10.tar.gz
Algorithm Hash digest
SHA256 a1eefd9e454131fd3b3605338ce2d3679944dac788c0cdefd9e26cb8486d15fb
MD5 5796710c5e4c588a156a4d96286dd2ef
BLAKE2b-256 32027361bfb2baeba8607cde2b832884fefb6264444f11f8a1f7056481848b5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for hpc_connect-26.5.10.tar.gz:

Publisher: publish.yml on sandialabs/hpc-connect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hpc_connect-26.5.10-py3-none-any.whl.

File metadata

  • Download URL: hpc_connect-26.5.10-py3-none-any.whl
  • Upload date:
  • Size: 51.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hpc_connect-26.5.10-py3-none-any.whl
Algorithm Hash digest
SHA256 67ac30e7de676a3469463374806c892e31e3093e52febb05bb8013c5254b84f5
MD5 d9626133d08602c3a99d573a316b6ad0
BLAKE2b-256 8aacf8f6e7617c7ca4767aadcd220914e5fa81256acaa99d7343643e7288d24e

See more details on using hashes here.

Provenance

The following attestation bundles were made for hpc_connect-26.5.10-py3-none-any.whl:

Publisher: publish.yml on sandialabs/hpc-connect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page