Skip to main content

HPC utility functions

Project description

hpc_funcs

Python utilities for interacting with HPC clusters — shell execution, environment management, LMOD module system, and UGE scheduler.

Install

pip install hpc_funcs

Usage

LMOD

Want to use LMOD to load modules within a python environment? For example in a notebook?

from hpc_funcs import lmod

# Load a module and apply env changes to current process
lmod.use("/folder/with/modules")
lmod.load("program")

UGE (Univa Grid Engine)

UGE is not the most popular scheduler, so having pythonic interface is very convenient.

from hpc_funcs.schedulers.uge import submission, qstat, qacct, qdel

# Generate and submit a job script
script = submission.generate_script(
    cmd="python run.py",
    name="myjob",
    cores=8,
    mem="16G",
    hours=4,
)
script_path = submission.write_script(script, directory="/tmp/jobs")
job_id = submission.submit_script(script_path)

# Monitor status
jobs = qstat.get_qstat_json()

# Fetch accounting info after completion
info = qacct.get_job_accounting(job_id)

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_funcs-1.0.5.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

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

hpc_funcs-1.0.5-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file hpc_funcs-1.0.5.tar.gz.

File metadata

  • Download URL: hpc_funcs-1.0.5.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for hpc_funcs-1.0.5.tar.gz
Algorithm Hash digest
SHA256 7e4780c72239fd0d91d23f9e2545e2df98d886573486e3d4e9e2c8cef5acd6f2
MD5 6d17d2c1e0fee9c2b6f61e54f42dd9e5
BLAKE2b-256 d10041efc09c95e3bef3aed04b87f35e7c0853f38968bc7a094a87ff3b04c9fc

See more details on using hashes here.

File details

Details for the file hpc_funcs-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: hpc_funcs-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for hpc_funcs-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f10ee06b3d880e2f9bc0f53f4e9343fa79ee3713a828b9f6a661f90b04da711b
MD5 f38290f8b7792a3d7e87efdfd82dddd6
BLAKE2b-256 51da9386c8729b66f555d2518889e72a02076911a5ae9353a487597dbf7e1482

See more details on using hashes here.

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