Skip to content

Instantly share code, notes, and snippets.

@Colelyman
Created December 9, 2017 07:15
Show Gist options
  • Save Colelyman/3e866d344201903365aeda3ca71721de to your computer and use it in GitHub Desktop.
Save Colelyman/3e866d344201903365aeda3ca71721de to your computer and use it in GitHub Desktop.
Some tricks for doing cool things with sbatch scripts.
# start a job after another job succeeds
JOBID=$(sbatch --parsable job1.sh) && sbatch --dependency=afterok:$JOBID job2.sh
# start a job after another job fails
JOBID=$(sbatch --parsable job1.sh) && sbatch --dependency=afternotok:$JOBID job2.sh
# get the time and memory of a running node
sstat --format="CPUTime,Elapsed,MaxRSS" -j $SLURM_JOB_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment