Created
June 24, 2023 16:44
-
-
Save MilesCranmer/17952c3e8f0b3db7014c952e1a3963ba to your computer and use it in GitHub Desktop.
Some useful slurm macros
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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