Skip to content
Snippets Groups Projects
Commit db31d832 authored by Domenico Giordano's avatar Domenico Giordano
Browse files

apply new json structure

parent ba95b1d4
No related branches found
No related tags found
3 merge requests!255Author list,!244Apply new json schema and descriptions,!243including parsing tests, changing json format
parseResultsDir=$(cd $(dirname ${BASH_SOURCE}); pwd) # needed to locate parseResults.py parseResultsDir=$(cd $(dirname ${BASH_SOURCE}); pwd) # needed to locate parseResults.py
function generateSummary(){ 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 cat ${APP}_summary.json
} }
...@@ -26,11 +26,11 @@ function parseResults(){ ...@@ -26,11 +26,11 @@ function parseResults(){
#----------------------- #-----------------------
# Parse results (python) # Parse results (python)
#----------------------- #-----------------------
echo "[parseResults] python parser starting" #echo "[parseResults] python parser starting"
export BASE_WDIR=`pwd` export BASE_WDIR=`pwd`
python ${parseResultsDir}/parseResults.py # same directory as parseResults.sh #python ${parseResultsDir}/parseResults.py # same directory as parseResults.sh
pystatus=$? pystatus=$?
echo "[parseResults] python parser completed (status=$pystatus)" #echo "[parseResults] python parser completed (status=$pystatus)"
#----------------------- #-----------------------
# Parse results (bash) # Parse results (bash)
#----------------------- #-----------------------
...@@ -45,8 +45,9 @@ function parseResults(){ ...@@ -45,8 +45,9 @@ function parseResults(){
median=a[(n + 1) / 2]; median=a[(n + 1) / 2];
} else { } else {
median=(a[(n / 2)] + a[(n / 2) + 1]) / 2.0; median=(a[(n / 2)] + a[(n / 2) + 1]) / 2.0;
}; printf "{\"score\": %.4f, \"avg\": %.4f, \"median\": %.4f, \"min\": %.4f, \"max\": %.4f}", sum, sum/count, median, amin, amax };
}' || (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=$?
[ "$shstatus" != "0" ] && s_msg="ERROR" [ "$shstatus" != "0" ] && s_msg="ERROR"
#----------------------- #-----------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment