slurm scripts detect DOWN nodes

This commit is contained in:
ville rantanen
2014-06-17 10:32:25 +03:00
parent f80cae9b16
commit be94225406
2 changed files with 2 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ NODERUNS=( )
for e in ${NODELIST[@]}
#do NODERUNS+=( $( squeue | grep $e | wc -l ) )
do NODERUNS+=( $( scontrol show node $e | grep CPUAlloc | sed 's,.*CPUAlloc=\([0-9]\+\).*,\1,' ) )
scontrol -o show node ${NODELIST[$i]} | grep State=DOWN > /dev/null && NODERUNS[$i]=9999
done
MIN=${NODERUNS[0]}
INDEX=0

View File

@@ -34,6 +34,7 @@ do
INDEX=0
for (( i=0; i<${#NODERUNS[@]}; i++ ))
do NODERUNS[$i]=$(( $( scontrol -o show node ${NODELIST[$i]} | sed 's,.*CPUAlloc=\([0-9]\+\).*CPUTot=\([0-9]\+\).*,\2-\1 ,' ) ))
scontrol -o show node ${NODELIST[$i]} | grep State=DOWN > /dev/null && NODERUNS[$i]=-1
echo -n "${NODELIST[$i]}:${NODERUNS[$i]} "
[ ${NODERUNS[$i]} -gt $MAX ] && {
MAX=${NODERUNS[$i]}