Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hep-workloads
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HEP-Benchmarks
hep-workloads
Commits
937dc991
Commit
937dc991
authored
5 years ago
by
Domenico Giordano
Browse files
Options
Downloads
Plain Diff
Merge branch '
BMK-150
' into 'qa'
Resolve
BMK-150
Closes
BMK-150
See merge request
!252
parents
c1c5b399
3f13428e
No related branches found
No related tags found
2 merge requests
!255
Author list
,
!252
Resolve BMK-150
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/digi/cms-digi/cms-digi-bmk.sh
+30
-0
30 additions, 0 deletions
cms/digi/cms-digi/cms-digi-bmk.sh
cms/digi/cms-digi/parseResults.sh
+14
-14
14 additions, 14 deletions
cms/digi/cms-digi/parseResults.sh
with
44 additions
and
14 deletions
cms/digi/cms-digi/cms-digi-bmk.sh
+
30
−
0
View file @
937dc991
...
...
@@ -36,6 +36,25 @@ function doOne(){
return
$status
}
function
getEvents
(){
export
CMSSW_RELEASE
=
CMSSW_10_2_9
export
VO_CMS_SW_DIR
=
/cvmfs/cms.cern.ch
source
$VO_CMS_SW_DIR
/cmsset_default.sh
export
SCRAM_ARCH
=
slc6_amd64_gcc700
[[
!
-e
${
CMSSW_RELEASE
}
]]
&&
scram project CMSSW
${
CMSSW_RELEASE
}
&> /dev/null
(
pushd
${
CMSSW_RELEASE
}
;
eval
`
scramv1 runtime
-sh
`
;
popd
)
&> /dev/null
ln
-s
${
BMKDIR
}
/data/
*
.root
.
evts
=
`
python
-c
"import ROOT;f=ROOT.TFile.Open('gensim.root');print f.Get('Events').GetEntries();"
`
STATUS
=
$?
rm
-rf
${
CMSSW_RELEASE
}
rm
-f
gensim.root
if
[[
$STATUS
!=
0
]]
;
then
return
0
else
return
$evts
fi
}
# Optional function validateInputArguments may be defined in each benchmark
# If it exists, it is expected to set NCOPIES, NTHREADS, NEVENTS_THREAD
# (based on previous defaults and on user inputs USER_NCOPIES, USER_NTHREADS, USER_NEVENTS_THREADS)
...
...
@@ -59,6 +78,17 @@ function validateInputArguments(){
fi
# Number of events per thread
if
[
"
$USER_NEVENTS_THREAD
"
!=
""
]
;
then
NEVENTS_THREAD
=
$USER_NEVENTS_THREAD
;
fi
# Extract number of events in input file
getEvents
evts
=
$?
if
[[
$evts
==
0
]]
;
then
s_msg
=
"[ERROR] Cannot extract number of events from input file"
return
1
fi
if
[[
$((
NEVENTS_THREAD
*
NTHREADS
))
-gt
$evts
]]
;
then
s_msg
=
"[ERROR] Requested number of events (
$((
NEVENTS_THREAD
*
NTHREADS
))
) exceeds number of input events (
$evts
)"
return
1
fi
# Return 0 if input arguments are valid, 1 otherwise
# Report any issues to parseResults via s_msg
export
s_msg
=
"ok"
...
...
This diff is collapsed.
Click to expand it.
cms/digi/cms-digi/parseResults.sh
+
14
−
14
View file @
937dc991
function
generateSummary
(){
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
echo
-e
"{
\"
copies
\"
:
$NCOPIES
,
\"
threads_per_copy
\"
:
$NTHREADS
,
\"
events_per_thread
\"
:
$
nevt_thr
,
\"
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
}
...
...
@@ -33,23 +33,23 @@ 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
"{}"
;
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
"{}"
;
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 "{\"digi\": %.4f}", sum
}'
nevt
=
$NEVENTS_THREAD
nthread
=
$NTHREADS
||
(
echo
"{}"
;
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
"{}"
;
return
1
)
`
STATUS_2
=
$?
#Duplicating above parsing, as quick and dirty. Should 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 "{\"digi\": %.4f}", sum}'
||
(
echo
"{}"
;
return
1
)
`
STATUS_3
=
$?
# 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@.*
\s
Total 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
"{}"
;
return
1
)
`
STATUS_2
=
$?
[[
"
$STATUS_1
"
==
"0"
]]
&&
[[
"
$STATUS_2
"
==
"0"
]]
res_cpu
=
`
grep
-H
-A2
"CPU Summary"
proc_
*
/out_
*
.log |
grep
"Total loop"
|
sed
-e
"s@.*
\s
Total 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
"{}"
;
return
1
)
`
STATUS_4
=
$?
[[
"
$STATUS_1
"
==
"0"
]]
&&
[[
"
$STATUS_2
"
==
"0"
]]
&&
[[
"
$STATUS_3
"
==
"0"
]]
&&
[[
"
$STATUS_4
"
==
"0"
]]
STATUS
=
$?
[[
"
$STATUS
"
!=
"0"
]]
&&
export
s_msg
=
"ERROR"
echo
"[parseResults] parsing completed (status=
$STATUS
)"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment