Created
May 30, 2018 17:23
-
-
Save ultimatile/31bfb0e3d49fb867bfce2a5de97447a4 to your computer and use it in GitHub Desktop.
get available node information
This file contains 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 | |
declare -A nplist | |
nplist["node12"]=8;nplist["node13"]=8;nplist["node14"]=8;nplist["node15"]=8 | |
nplist["node16"]=12;nplist["node17"]=12;nplist["node18"]=12 | |
nplist["node19"]=12;nplist["node20"]=12;nplist["node21"]=12 | |
nplist["node22"]=12;nplist["node23"]=12;nplist["node24"]=12;nplist["node25"]=12 | |
nplist["node26"]=24;nplist["node27"]=24 | |
nplist["node28"]=28;nplist["node29"]=28 | |
nplist["node30"]=44;nplist["node31"]=44;nplist["node32"]=44;nplist["node33"]=44 | |
for i in {12..33} | |
do | |
anode=$(qstat -n|sed -e "s/+/\n/g"|grep -c node${i}) | |
if [ "${anode}" = ${nplist["node${i}"]} ]; then | |
echo "node$i ${anode}/${nplist["node${i}"]} job-exclusive!" | |
else | |
echo "node$i ${anode}/${nplist["node${i}"]}" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment