Three ways to use slurm on a high performance computer (HPC) (CC130)

July 21, 2021 • PD Schloss • 1 min read

Slurm scripts

interactive.slurm

#!/bin/bash

srun --account=pschloss1 --partition=standard --time=02:00:00 --ntasks=1 --cpus-per-task=1 --nodes=1 --mem=6GB --pty /bin/bash

single.slurm

#!/bin/bash
#SBATCH --mail-user=you@umich.edu
#SBATCH --mail-type=BEGIN,END
#SBATCH --cpus-per-task=16
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --mem-per-cpu=4g
#SBATCH --time=2:00:00
#SBATCH --account=pschloss1
#SBATCH --partition=standard
#SBATCH --output=%x.o%A_%a

make -j 16 processed_data/l2_genus_pooled_performance.tsv

array.slurm

#!/bin/sh
#SBATCH --mail-user=you@umich.edu
#SBATCH --mail-type=BEGIN,END
#SBATCH --cpus-per-task=1
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --mem-per-cpu=4g
#SBATCH --time=24:00:00
#SBATCH --account=pschloss1
#SBATCH --partition=standard
#SBATCH --output=%x.o%A_%a
#SBATCH --array 1-100

SEED=$((SLURM_ARRAY_TASK_ID))
echo $SEED

make processed_data/l2_genus_$SEED.Rds

Code

You can browse the state of the demo at the

Installations

If you haven’t been following along, you can get caught up by doing the following:

comments powered by Disqus