Skip to content

Instantly share code, notes, and snippets.

@jklymak
Created June 15, 2022 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jklymak/4cc97c043211f85492e4a96b1ffd877a to your computer and use it in GitHub Desktop.
Save jklymak/4cc97c043211f85492e4a96b1ffd877a to your computer and use it in GitHub Desktop.
Monitor script for cedar
#!/bin/bash
#SBATCH --account=def-jklymak
#SBATCH --mail-user=jklymak@gmail.com
#SBATCH --mail-type=ALL
#SBATCH --ntasks-per-node=1
#SBATCH --time=0-00:15
#SBATCH --mem=64G
cd ${SLURM_SUBMIT_DIR}
top=${SLURM_JOB_NAME}
source /home/jklymak/venvs/butewind/bin/activate
runagain=false
# plot_snap.py finds the latest data file and plots that...
if python plot_snap.py ${top}; then
runagain=true
fi
ssh boo.uvic.ca 'chmod a+rx Sites/ButeWinds/${SLURM_JOB_NAME}/Snaps;chmod a+rx Sites/ButeWinds/${SLURM_JOB_NAME}/Snaps/*.png'
if ${runagain}; then
sbatch --job-name=${SLURM_JOB_NAME} --exclude=cdr2098 --begin=now+1hour runMonitor.sh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment