Skip to content

larsbuntemeyer/enjoy-slurm

Repository files navigation

enjoy-slurm

CI codecov License:MIT pypi Documentation Status pre-commit.ci status

enjoy-slurm is a naive slurm control package for python. It does interact with Slurm exactly as any user would do, simply through the command line tools and arguments. That's why we call it naive. However, it should avoid having to rewrite some scripts required to submit and control many Slurm jobs on an HPC computer. This package is a successor of the retired HPC scheduler package.

Features

  • Use sbatch, sacct, scontrol etc. directly from python with a pythonic API.
  • Parse command outputs into python objects like pandas DataFrames or dictionaries.

Examples

import enjoy_slurm as slurm

jobid = slurm.sbatch("job.sh", partition="compute", account="my_account")
acct = slurm.sacct(jobid=jobid)

# run another job that depends on the first
jobid1 = slurm.sbatch(
    "another_job.sh", dependency=jobid, partition="shared", account="my_account"
)
acct1 = slurm.sacct(jobid=jobid1)

Related projects


Project based on the cookiecutter science project template.