Created
July 6, 2022 03:35
-
-
Save Stfort52/4addce2c5402383f18c23596af9df196 to your computer and use it in GitHub Desktop.
More on slurm
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
#!/bin/bash | |
# Print the biggest computing chunk | |
smax () | |
{ | |
max_node="N/A"; | |
max_cores=0; | |
for node in `sinfo --Node $*| awk 'BEGIN {FS=" "} {if(NR > 1) print $1}' | uniq`; | |
do | |
idle=`sinfo -o%C --nodes $node | awk 'BEGIN {FS="/"} {if(NR == 2) print $2}'`; | |
if [ $idle -gt $max_cores ]; then | |
max_cores=$idle; | |
max_node=$node; | |
fi; | |
done; | |
echo "$max_cores@$max_node" | |
} | |
# Print the core statuses of nodes | |
snodes () | |
{ | |
for node in `sinfo --Node $*| awk 'BEGIN {FS=" "} {if(NR > 1) print $1}' | uniq`; | |
do | |
echo -en "$node : "; | |
sinfo -o%C --nodes $node; | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment