From 0fe2b192c1e3da8e859ff3040c8f720e59d1f827 Mon Sep 17 00:00:00 2001 From: Hans Pabst Date: Thu, 14 Sep 2023 13:19:30 +0200 Subject: [PATCH] Minor improvement of info script (CP2K). --- config/cp2k/info.sh | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/config/cp2k/info.sh b/config/cp2k/info.sh index 68b0ea5..a091149 100755 --- a/config/cp2k/info.sh +++ b/config/cp2k/info.sh @@ -10,16 +10,15 @@ # Hans Pabst (Intel Corp.) ############################################################################### -BC=$(which bc 2> /dev/null) PATTERN="*.txt" BEST=0 if [ "-best" = "$1" ]; then - SORT="sort -k2,2n -k6,6n | sort -u -k2,2n" + SORT="sort -k2,2g -k6,6g | sort -u -k2,2g" BEST=1 shift else - SORT="sort -k2,2n -k6,6n" + SORT="sort -k2,2g -k6,6g" fi if [ "-depth" = "$1" ]; then @@ -42,24 +41,19 @@ if [ "0" = "${NUMFILES}" ]; then PATTERN="*" fi -FILES=$(find ${FILEPATH} -maxdepth ${DEPTH} -type f -name "${PATTERN}" | grep -v "..*\.sh") -FILE0=$(echo "${FILES}" | head -n1) -PRINTFLOPS=0 +FILES=$(find ${FILEPATH} -maxdepth ${DEPTH} -type f -name "${PATTERN}" | grep -v "..*\.sh\|CMakeLists\.txt") +FILE0=$(head -n1 <<<"${FILES}") NUMFILES=0 if [ "" != "${FILE0}" ]; then - NUMFILES=$(echo "${FILES}" | wc -l) + NUMFILES=$(wc -l <<<"${FILES}") PROJECT=$(grep "GLOBAL| Project name" "${FILE0}" | sed -n "s/..*\s\s*\(\w\)/\1/p" | head -n1) if [ "PROJECT" = "${PROJECT}" ]; then PROJECT=$(grep "GLOBAL| Method name" "${FILE0}" | sed -n "s/..*\s\s*\(\w\)/\1/p" | head -n1) fi - if [ "" != "${BC}" ]; then - if [ "LIBTEST" = "${PROJECT}" ] || [ "TEST" = "${PROJECT}" ]; then - PRINTFLOPS=1 - fi - fi + NUMACCDEVS=$(grep " DBCSR| ACC: Number of devices/node" "${FILE0}" | sed -n "s/..*\s\s*\(\w\)/\1/p" | head -n1) echo -e -n "$(printf %-23.23s "${PROJECT}")\tNodes\tR/N\tT/R\tCases/d\tSeconds" - if [ "0" != "${PRINTFLOPS}" ]; then - echo -e -n "\tGFLOPS/s" + if [ "${NUMACCDEVS}" ]; then + echo -e -n "\t\tDevices" fi echo fi @@ -73,8 +67,8 @@ for FILE in ${FILES}; do if [ "" = "${RANKS}" ]; then RANKS=1; fi fi if [ "" = "${NODERANKS}" ]; then - for TOKEN in $(echo "${BASENAME}" | tr -s "[=_=][=-=]" " "); do - NODES=$(echo "${TOKEN}" | sed -n "s/^\([0-9][0-9]*\)\(x[0-9][0-9]*\)*$/\1/p;s/^\([0-9][0-9]*\)n$/\1/p;s/^n\([0-9][0-9]*\)$/\1/p") + for TOKEN in $(tr -s "[=_=][=-=]" " " <<<"${BASENAME}"); do + NODES=$(sed -n "s/^\([0-9][0-9]*\)\(x[0-9][0-9]*\)*$/\1/p;s/^\([0-9][0-9]*\)n$/\1/p;s/^n\([0-9][0-9]*\)$/\1/p" <<<"${TOKEN}") if [ "" != "${NODES}" ]; then break fi @@ -92,17 +86,19 @@ for FILE in ${FILES}; do if [ "" = "${TPERR}" ] || [ "0" = "${TPERR}" ]; then TPERR=1; fi fi DURATION=$(grep "CP2K 1" "${FILE}" | tr -s "\n" " " | tr -s " " | cut -d" " -f7) - TWALL=$(echo "${DURATION}" | cut -d. -f1 | sed -n "s/\([0-9][0-9]*\)/\1/p") + TWALL=$(cut -d. -f1 <<<"${DURATION}" | sed -n "s/\([0-9][0-9]*\)/\1/p") if [ "" != "${TWALL}" ] && [ "0" != "${TWALL}" ]; then echo -e -n "$(printf %-23.23s "${BASENAME}")\t${NODES}\t${RANKS}\t${TPERR}" echo -e -n "\t$((86400/TWALL))\t${DURATION}" - if [ "0" != "${PRINTFLOPS}" ]; then - FLOPS=$(sed -n "s/ marketing flops\s\s*\(..*\)$/\1/p" "${FILE}" | sed -e "s/[eE]+*/\*10\^/") - TBCSR=$(sed -n "s/ dbcsr_multiply_generic\s\s*\(..*\)$/\1/p" "${FILE}" | tr -s " " | rev | cut -d" " -f1 | rev) - if [ "" != "${FLOPS}" ] && [ "" != "${TBCSR}" ]; then - GFLOPS=$(echo "scale=3;((${FLOPS})/(${TBCSR}*10^9))" | ${BC}) - echo -e -n "\t${GFLOPS}" + NDEVS=$(grep " DBCSR| ACC: Number of devices/node" "${FILE}" | sed -n "s/..*\s\s*\(\w\)/\1/p" | head -n1) + if [ "${NUMACCDEVS}" ]; then + if [ "${NDEVS}" ]; then + echo -e -n "\t\t${NDEVS}" + else + echo -e -n "\t\t-" fi + elif [ "${NDEVS}" ]; then + echo -e -n "\t\tACC" fi echo elif [ "0" != "${NUMFILES}" ] && [ "0" = "${BEST}" ]; then