Skip to content

Instantly share code, notes, and snippets.

@MilesCranmer
Created June 24, 2023 16:44
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 MilesCranmer/17952c3e8f0b3db7014c952e1a3963ba to your computer and use it in GitHub Desktop.
Save MilesCranmer/17952c3e8f0b3db7014c952e1a3963ba to your computer and use it in GitHub Desktop.
Some useful slurm macros
# Apply a function to any slurm job matching a regexp.
# For example, `son 'my_job_32.*' scancel {}` would run `scancel <job>` on any
# job matching the regexp.
function son {
squeue -u $USER --format="%i %j" | awk "/${1}/"' {print $1}' | xargs -I {} ${@:2}
}
# Watch a detailed `squeue` output (from Siavash Golkar)
function sqw {
watch -n 1 -- "squeue -u $USER -o '%.10i %.4P %.25j %.5t %.10M %.20R %.13L' ${@} | tail -n 33"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment