From bc6f9dd990b553aeca753e7d0e2f31e6e52233b1 Mon Sep 17 00:00:00 2001 From: giordano <domenico.giordano@cern.ch> Date: Thu, 19 Sep 2019 17:34:14 +0200 Subject: [PATCH] apply new json structure --- atlas/sim/atlas-sim/parseResults.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/atlas/sim/atlas-sim/parseResults.sh b/atlas/sim/atlas-sim/parseResults.sh index 63756e69..1cf651ee 100644 --- a/atlas/sim/atlas-sim/parseResults.sh +++ b/atlas/sim/atlas-sim/parseResults.sh @@ -1,7 +1,7 @@ parseResultsDir=$(cd $(dirname ${BASH_SOURCE}); pwd) # needed to locate parseResults.py function generateSummary(){ - echo -e "{\"copies\":$NCOPIES , \"threads_per_copy\":$NTHREADS , \"events_per_thread\" : $NEVENTS_THREAD , \"CPU_score\": $resJSON , \"log\": \"${s_msg}\", \"app\":`cat $BMKDIR/version.json` }" > ${APP}_summary.json + echo -e "{\"copies\":$NCOPIES , \"threads_per_copy\":$NTHREADS , \"events_per_thread\" : $NEVENTS_THREAD , $resJSON , \"log\": \"${s_msg}\", \"app\":`cat $BMKDIR/version.json` }" > ${APP}_summary.json cat ${APP}_summary.json } @@ -32,11 +32,11 @@ function parseResults(){ #----------------------- # Parse results (python) #----------------------- - echo "[parseResults] python parser starting" + #echo "[parseResults] python parser starting" export BASE_WDIR=`pwd` - python ${parseResultsDir}/parseResults.py # same directory as parseResults.sh + #python ${parseResultsDir}/parseResults.py # same directory as parseResults.sh pystatus=$? - echo "[parseResults] python parser completed (status=$pystatus)" + #echo "[parseResults] python parser completed (status=$pystatus)" #----------------------- # Parse results (bash) #----------------------- @@ -51,8 +51,9 @@ function parseResults(){ median=a[(n + 1) / 2]; } else { median=(a[(n / 2)] + a[(n / 2) + 1]) / 2.0; - }; printf "{\"score\": %.4f, \"avg\": %.4f, \"median\": %.4f, \"min\": %.4f, \"max\": %.4f, \"count\": %d}", sum, sum/count, median, amin, amax , count - }' || (echo "\"[ERROR] Something went wrong in parsing the CPU score\""; exit 1)` + }; +printf "\"wl-scores\": {\"sim\": %.4f} , \"wl-stats\": {\"score\": %.4f, \"avg\": %.4f, \"median\": %.4f, \"min\": %.4f, \"max\": %.4f}", sum, sum, sum/count, median, amin, amax + }' || (echo "\"wl-scores\":{}"; exit 1)` shstatus=$? [ "$shstatus" != "0" ] && s_msg="ERROR in parsing" echo "[parseResults] bash parser completed (status=$shstatus)" -- GitLab