Skip to main content

Simple Python 3 package to get information when running Python programs in slurm

Project description

slurmee

Build Status

Simple Python 3 package to get information when running Python programs in slurm.

Usage

import slurmee

print(f"Slurm job id: {slurmee.get_job_id()}")
print(f"Slurm job name: {slurmee.get_job_name()}")
print(f"Slurm submit dir: {slurmee.get_submit_dir()}")
print(f"Slurm job nodelist: {slurmee.get_job_nodelist()}")
print(f"Slurm submit host: {slurmee.get_submit_host()}")
print(f"Slurm job num_nodes: {slurmee.get_job_num_nodes()}")
print(f"Slurm cpus on node: {slurmee.get_cpus_on_node()}")
print(f"Slurm ntasks: {slurmee.get_ntasks()}")
print(f"Slurm nodeid: {slurmee.get_nodeid()}")

Methods return None if not running inside of slurm. It can be used to check this condition e.g.

if slurmee.get_job_id():
    print("Running inside of slurm!")

Development

This package has no external runtime dependencies. The tests can be run via

make test

To install the dependencies for generating the docs and releasing the package, in a virtual environment, run

pip install -e ".[test,dev,doc]"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for slurmee, version 0.1.0rc3
Filename, size File type Python version Upload date Hashes
Filename, size slurmee-0.1.0rc3.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page