Skip to content

Python wrapper for the creation and execution of batch scripts on a slurm-based HPC cluster

Notifications You must be signed in to change notification settings

LadnerLab/py-slurmscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Py-SlurmScript

Python wrapper for batch scripts to be executed on a slurm-based HPC cluster. Provides support for modules, dependencies, multiple job-steps, and any number of slurm arguments.

API

API Documentation can be found here

Example

import slurm_script

script = slurm_script.SlurmScript( "test_script", "echo $(PWD)", 
                                   [ '--time=20:00', '-c 1', '--mem=4G' ], 
								   dependency_mode = "afterok" 
								 )

script.add_modules( [ 'python/3.latest', 'blast+' ] )
script.add_module( 'usearch' )

script.write()
job_number = script.run()

The resulting script looks like

#!/bin/sh 
#SBATCH --time=20:00
#SBATCH -c 1
#SBATCH --mem=4G
module load python/3.latest
module load blast+
module load usearch
srun echo $(PWD)

About

Python wrapper for the creation and execution of batch scripts on a slurm-based HPC cluster

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages