SLURM utilities for Python
Project description
pyslurmutils
SLURM utilities for Python.
Demo
Get an access token on rnice
export SLURM_TOKEN=$(scontrol token lifespan=3600)
export SLURM_URL=...
export SLURM_USER=...
Run any of the example scripts
python3 scripts/examples.py
Run the tests (CI or locally)
python3 -m pytest .
When SLURM_TOKEN
, SLURM_URL
or SLURM_USER
is missing it will mock
the SLURM clients.
Execute a python function on SLURM
Execute a function on SLURM with an API similar to python's concurrent.futures
from pyslurmutils.concurrent.futures import SlurmRestExecutor
with SlurmRestExecutor(
url,
user_name,
token,
log_directory=log_directory, # for log files
data_directory=data_directory, # TCP when not provided
pre_script="module load ewoks", # load environment
python_cmd="python",
) as pool:
future = pool.submit(sum, [1, 1])
assert future.result() == 2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyslurmutils-0.1.0rc3.tar.gz
(19.2 kB
view details)
File details
Details for the file pyslurmutils-0.1.0rc3.tar.gz
.
File metadata
- Download URL: pyslurmutils-0.1.0rc3.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf3e3b1de46b7c345b3ea5b650d4b483a057a4c1d0e5489389ea6b0760328419 |
|
MD5 | 82b4706f01547ffa92ba44a8c0a15fc4 |
|
BLAKE2b-256 | ff98abea02f150fd7e0ed2a54486dc0082c16d5fc219f3635fed4579e7c3451b |