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

applying new json schema

parent 72f9211c
No related branches found
No related tags found
No related merge requests found
{"copies":2 , "threads_per_copy":1 , "events_per_thread" : 1 , "CPU_score": "" , "log": "[ERROR] There is at least one job not finished properly", "app": {"version":"v0.15","description":"ALICE pp GEN-SIM","cvmfs_checksum":"9986a9a83745b416a510788e1f35d807","bmkdata_checksum":"b94489e16c0a77f2a0a9aaf333260a96","bmk_checksum":"6c5c2fd1379388c9b1cbd3888e5ecbd3"} }
{"copies":2 , "threads_per_copy":1 , "events_per_thread" : 1 , "wl-scores":{} , "log": "[ERROR] There is at least one job not finished properly", "app": {"version":"v0.15","description":"ALICE pp GEN-SIM","cvmfs_checksum":"9986a9a83745b416a510788e1f35d807","bmkdata_checksum":"b94489e16c0a77f2a0a9aaf333260a96","bmk_checksum":"6c5c2fd1379388c9b1cbd3888e5ecbd3"} }
{"copies":4 , "threads_per_copy":1 , "events_per_thread" : 1 , "CPU_score": {"score": 0.0606, "avg": 0.0152, "median": 0.0152, "min": 0.0152, "max": 0.0152} , "log": "ok", "app": {"version":"v0.15","description":"ALICE pp GEN-SIM","cvmfs_checksum":"9986a9a83745b416a510788e1f35d807","bmkdata_checksum":"b94489e16c0a77f2a0a9aaf333260a96","bmk_checksum":"6c5c2fd1379388c9b1cbd3888e5ecbd3"} }
{"copies":4 , "threads_per_copy":1 , "events_per_thread" : 1 , "wl-scores": {"gen-sim": 0.0606} , "wl-stats": {"score": 0.0606, "avg": 0.0152, "median": 0.0152, "min": 0.0152, "max": 0.0152} , "log": "ok", "app": {"version":"v0.15","description":"ALICE pp GEN-SIM","cvmfs_checksum":"9986a9a83745b416a510788e1f35d807","bmkdata_checksum":"b94489e16c0a77f2a0a9aaf333260a96","bmk_checksum":"6c5c2fd1379388c9b1cbd3888e5ecbd3"} }
#!/bin/bash
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
}
......@@ -21,7 +21,7 @@ function parseResults(){
if [ "$1" == "" ] || [ "$2" != "" ]; then echo "[parseresults] ERROR! Invalid arguments '$@' to parseResults"; return 1; fi
echo "[parseResults] parse results and generate summary (previous status: $1)"
echo "[parseResults] current directory: $(pwd)"
export resJSON='""'
export resJSON='"wl-scores":{}'
export s_msg="ok"
#-----------------------
# Parse results
......@@ -36,15 +36,16 @@ 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}", sum, sum/count, median, amin, amax
}' || (echo "\"[ERROR] Something went wrong in parsing the CPU score\""; exit 1)`
};
printf "\"wl-scores\": {\"gen-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)`
STATUS=$?
echo "[parseResults] checking that all job are completed correctly from" proc_*/out_*.log
ALL_JOBS_SUCCEED=`grep -c -h -m1 "finished with the expected exit code" proc_*/out_*.log | awk 'BEGIN{sum=0;count=0}{sum+=$1;count+=1}END{print sum==count}'`
if [ "$ALL_JOBS_SUCCEED" != 1 ]; then
STATUS=1
s_msg="[ERROR] There is at least one job not finished properly"
resJSON='""'
resJSON='"wl-scores":{}'
grep -c "finished with the expected exit code" proc_*/out_*.log
fi
#-----------------------
......
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