Skip to content
Snippets Groups Projects

Resolve BMK-150

Merged Andrea Sciaba requested to merge BMK-150 into qa
1 file
+ 9
10
Compare changes
  • Side-by-side
  • Inline
function generateSummary(){
echo -e "{\"copies\":$NCOPIES , \"threads_per_copy\":$NTHREADS , \"events_per_thread\" : $NEVENTS_THREAD , \"throughput_score\": $res_thr , \"CPU_score\": $res_cpu , \"log\": \"${s_msg}\", \"app\": `cat $BMKDIR/version.json` }" > ${APP}_summary.json
echo -e "{\"copies\":$NCOPIES , \"threads_per_copy\":$NTHREADS , \"events_per_thread\" : $nevt_thr , \"throughput_score\": $res_thr , \"CPU_score\": $res_cpu , \"log\": \"${s_msg}\", \"app\": `cat $BMKDIR/version.json` }" > ${APP}_summary.json
cat ${APP}_summary.json
}
@@ -32,17 +32,16 @@ function parseResults(){
#-----------------------
echo "[parseResults] parsing results from" proc_*/out_*.log
# Documentation of cmssw time report at https://github.com/cms-sw/cmssw/blob/09c3fce6626f70fd04223e7dacebf0b485f73f54/FWCore/Services/plugins/Timing.cc#L240
# Parsing Event Throughput: xxxx ev/s
res_thr=`grep -H "Event Throughput" proc_*/out_*.log | sed -e "s@[^:]*: Event Throughput: \([ 0-9\.]*\) ev/s@\1@" | awk 'BEGIN{amin=1000000;amax=0;count=0;} { val=$1; a[count]=val; count+=1; sum+=val; if(amax<val) amax=val; if(amin>val) amin=val} END{n = asort(a); if (n % 2) { 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
}' nevt=$NEVENTS_THREAD nthread=$NTHREADS || (echo "\"[ERROR] Something went wrong in parsing the Event Throughput\""; return 1)`
# Parsing Number of Events
nevt_thr=`grep -h "Number of Events" proc_*/out_*.log | sed -e "s@.*:\([ 0-9\.]*\).*@\1@" | awk 'BEGIN{n=0; count=0;} {n+=$1; count+=1} END{print n/count/nthreads}' nthreads=$NTHREADS || (echo "\"[ERROR] Something went wrong in parsing the Number of Events\""; return 1)`
STATUS_1=$?
# Parsing CPU Summary: \n- Total loop:: xxxx seconds of all CPUs
res_cpu=`grep -H -A2 "CPU Summary" proc_*/out_*.log | grep "Total loop" | sed -e "s@.*\sTotal loop: \([ 0-9\.]*\)@\1@" | awk 'BEGIN{amin=1000000;amax=0;count=0;} { val=nevt*nthread/$1; a[count]=val; count+=1; sum+=val; if(amax<val) amax=val; if(amin>val) amin=val} END{n = asort(a); if (n % 2) {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
}' nevt=$NEVENTS_THREAD nthread=$NTHREADS || (echo "\"[ERROR] Something went wrong in parsing the CPU score\""; return 1)`
# Parsing Event Throughput: xxxx ev/s
res_thr=`grep -H "Event Throughput" proc_*/out_*.log | sed -e "s@[^:]*: Event Throughput: \([ 0-9\.]*\) ev/s@\1@" | awk 'BEGIN{amin=1000000;amax=0;count=0;} { val=$1; a[count]=val; count+=1; sum+=val; if(amax<val) amax=val; if(amin>val) amin=val} END{n = asort(a); if (n % 2) { 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 Event Throughput\""; return 1)`
STATUS_2=$?
[[ "$STATUS_1" == "0" ]] && [[ "$STATUS_2" == "0" ]]
# Parsing CPU Summary: \n- Total loop:: xxxx seconds of all CPUs
res_cpu=`grep -H -A2 "CPU Summary" proc_*/out_*.log | grep "Total loop" | sed -e "s@.*\sTotal loop: \([ 0-9\.]*\)@\1@" | awk 'BEGIN{amin=1000000;amax=0;count=0;} { val=nevt*nthreads/$1; a[count]=val; count+=1; sum+=val; if(amax<val) amax=val; if(amin>val) amin=val} END{n = asort(a); if (n % 2) {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}' nevt=$nevt_thr nthreads=$NTHREADS || (echo "\"[ERROR] Something went wrong in parsing the CPU score\""; return 1)`
STATUS_3=$?
[[ "$STATUS_1" == "0" ]] && [[ "$STATUS_2" == "0" ]] && [[ "$STATUS_2" == "0" ]]
STATUS=$?
[[ "$STATUS" != "0" ]] && export s_msg="ERROR"
echo "[parseResults] parsing completed (status=$STATUS)"
Loading