Last active
June 29, 2017 18:18
-
-
Save parsa/62bcfef7e383d170d47b93f40c48bd90 to your computer and use it in GitHub Desktop.
Acquire an Interactive Session on a SLURM cluster
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
| function idev() { | |
| local nodes="1" | |
| if [[ "$(sinfo -h -o "%P")" =~ .*^$1$.* ]]; then | |
| local partition="$1" | |
| shift | |
| fi | |
| if [[ "$1" =~ [0-9]+ ]]; then | |
| nodes="$1" | |
| shift | |
| fi | |
| echo "Starting interactive job, ${partition+Partition: \"${partition}\", }Number of nodes: \"${nodes}\""${@:+, Arguments: \"${@}\"} | |
| srun ${partition+-p} $partition -N ${nodes} --pty "/bin/bash" -l "${@}" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment