Skip to content

Instantly share code, notes, and snippets.

@vishnuexe
Last active August 11, 2023 05:38
Show Gist options
  • Save vishnuexe/b381536a2a1903f81bd5569e816d4eb0 to your computer and use it in GitHub Desktop.
Save vishnuexe/b381536a2a1903f81bd5569e816d4eb0 to your computer and use it in GitHub Desktop.

Slrum template:

#!/bin/bash
#SBATCH --job-name=myjob # create a short name for your job
#SBATCH --nodes=1 # node count
#SBATCH --ntasks=1 # total number of tasks across all nodes
#SBATCH --cpus-per-task=4 # cpu-cores per task (>1 if multi-threaded tasks)
#SBATCH --mem-per-cpu=4G # memory per cpu-core (4G per cpu-core is default)
#SBATCH --time=00:05:00 # total run time limit (HH:MM:SS)
#SBATCH --gres=gpu:1 # number of gpus per node
nvidia-smi

Slrum template for singularity run:

#!/bin/bash
#SBATCH --job-name=myjob # create a short name for your job
#SBATCH --nodes=1 # node count
#SBATCH --ntasks=1 # total number of tasks across all nodes
#SBATCH --cpus-per-task=4 # cpu-cores per task (>1 if multi-threaded tasks)
#SBATCH --mem-per-cpu=4G # memory per cpu-core (4G per cpu-core is default)
#SBATCH --time=00:05:00 # total run time limit (HH:MM:SS)
#SBATCH --gres=gpu:1 # number of gpus per node
#SBATCH --mail-type=begin # send email when job begins
#SBATCH --mail-type=end # send email when job ends
#SBATCH --mail-user=<YourNetID>@domain.edu
module purge
singularity exec --nv ./tensorflow_21.08-tf2-py3.sif python3 mnist_classify.py

For interactive session on gpu run this while you are in master/cpu node:

srun --partition=gpu01 --nodes=1 --time=00:30:00 --pty /bin/bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment