diff --git a/cms/gen-sim/cms-gen-sim/jobs/good_1/cms-gen-sim_summary.json b/cms/gen-sim/cms-gen-sim/jobs/good_1/cms-gen-sim_summary.json index 8ae5fbce53d57e482ba5a0940c73201bb8f5acbe..fbf3f56231c34795ee7b995305a0d38645eae002 100644 --- a/cms/gen-sim/cms-gen-sim/jobs/good_1/cms-gen-sim_summary.json +++ b/cms/gen-sim/cms-gen-sim/jobs/good_1/cms-gen-sim_summary.json @@ -1 +1 @@ -{"copies":1 , "threads_per_copy":4 , "events_per_thread" : 2 , "throughput_score": {"score": 0.0666, "avg": 0.0666, "median": 0.0666, "min": 0.0666, "max": 0.0666} , "CPU_score": {"score": 0.0254, "avg": 0.0254, "median": 0.0254, "min": 0.0254, "max": 0.0254} , "log": "ok", "app": {"version":"v0.16","description":"CMS GEN-SIM of ttbar events, based on CMSSW_10_2_9","cvmfs_checksum":"c8e29b993587c7e92411afb219787e65","bmkdata_checksum":"9035578520013c3a5faac30bc36e30e0","bmk_checksum":"a3299c240b48e19a7547d8a865fb7233"} } +{"copies":1 , "threads_per_copy":4 , "events_per_thread" : 2 , "wl-scores": {"gen-sim" :0.0666} , "wl-stats": {"throughput_score": {"score": 0.0666, "avg": 0.0666, "median": 0.0666, "min": 0.0666, "max": 0.0666} , "CPU_score": {"score": 0.0254, "avg": 0.0254, "median": 0.0254, "min": 0.0254, "max": 0.0254} }, "log": "ok", "app": {"version":"v0.16","description":"CMS GEN-SIM of ttbar events, based on CMSSW_10_2_9","cvmfs_checksum":"c8e29b993587c7e92411afb219787e65","bmkdata_checksum":"9035578520013c3a5faac30bc36e30e0","bmk_checksum":"a3299c240b48e19a7547d8a865fb7233"} } diff --git a/cms/gen-sim/cms-gen-sim/parseResults.sh b/cms/gen-sim/cms-gen-sim/parseResults.sh index e6714283baabbed2f638bfbbbf5e9ee0b63f9ab5..915748df09ff905508ebd925e93d6a5be18d0396 100644 --- a/cms/gen-sim/cms-gen-sim/parseResults.sh +++ b/cms/gen-sim/cms-gen-sim/parseResults.sh @@ -1,5 +1,5 @@ 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\" : $NEVENTS_THREAD , \"wl-scores\": $res_score, \"wl-stats\": {\"throughput_score\": $res_thr , \"CPU_score\": $res_cpu }, \"log\": \"${s_msg}\", \"app\": `cat $BMKDIR/version.json` }" > ${APP}_summary.json cat ${APP}_summary.json } @@ -21,6 +21,7 @@ function parseResults(){ echo "[parseResults] current directory: $(pwd)" export res_cpu='""' export res_thr='""' + export res_score='""' export s_msg="ok" if [ "$1" -ne 0 ]; then echo "Previous steps failed: skip parsing, go to generateSummary" @@ -35,12 +36,18 @@ function parseResults(){ # 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)` +}' nevt=$NEVENTS_THREAD nthread=$NTHREADS || (echo "{}"; return 1)` STATUS_1=$? + + #Duplicating above parsing, as quick and dirty. SHoudl be replaced by a python parser + res_score=`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 "{\"gen-sim\" :%.4f} ", sum +}' nevt=$NEVENTS_THREAD nthread=$NTHREADS || (echo "{}"; return 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)` +}' nevt=$NEVENTS_THREAD nthread=$NTHREADS || (echo "{}"; return 1)` STATUS_2=$? [[ "$STATUS_1" == "0" ]] && [[ "$STATUS_2" == "0" ]] STATUS=$?