Created
February 6, 2018 19:28
-
-
Save MattHarrington/53f18048603aee7155d0f1ee6698353f to your computer and use it in GitHub Desktop.
Display SGE statistics
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/sh | |
# | |
# Probably written by someone in the Shoichet lab. Maybe Teague? | |
# Save and then run with "sh sgestat.sh" or "chmod +x sgestat.sh" and | |
# then "./sgestat.sh". -MH 06-Feb-2018 | |
# | |
# This file is not located here on hook (sgehead) at UofT. | |
# | |
#if [ ! -e "/opt/sge" ]; then | |
# echo ssh to sgehead; | |
# exit; | |
#fi | |
echo -n "Nodes alive: " | |
qhost | grep -v -e ' - ' -e '-----' -e 'HOSTNAME' | wc -l | |
qhost | grep -v -e ' - ' -e '-----' -e 'HOSTNAME' | awk 'BEGIN{X=0}{X+=strtonum($3)}END{print "CPUs: " X}' | |
qhost | grep -v -e ' - ' -e '-----' -e 'HOSTNAME' | awk 'BEGIN{X=0}{X+=strtonum($4)}END{print "Total Load: " X}' | |
echo "Nodes dead: " | |
qhost | grep ' - ' | grep -v -e '-----' -e 'HOSTNAME' -e global | awk '{print $1}' | |
echo "Running per user: " | |
#qstat | awk '{print $4}' | sort | grep -v -e '^$' -e user | uniq -c | sort -n | |
qstat -u '*' -g d | awk '{print $4,$5}' | sort | grep -v -e '^ $' -e user | grep 'r$' | uniq -c | sort -nr | |
echo "Queued per user: " | |
qstat -u '*' -g d | awk '{print $4,$5}' | sort | grep -v -e '^ $' -e user | grep 'qw$' | uniq -c | sort -nr | |
echo "Other per user: " | |
qstat -u '*' -g d | awk '{print $4,$5}' | sort | grep -v -e '^ $' -e user | grep -v -e 'qw$' -e 'r$' | uniq -c | sort -nr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment