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
Merge requests
!794
Resolve
BMK-1146
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve
BMK-1146
BMK-1146
into
qa-build-hello-world-ma
Overview
0
Commits
5
Pipelines
0
Changes
4
Merged
Domenico Giordano
requested to merge
BMK-1146
into
qa-build-hello-world-ma
2 years ago
Overview
0
Commits
5
Pipelines
0
Changes
4
Expand
Closes
BMK-1146
0
0
Merge request reports
Compare
qa-build-hello-world-ma
qa-build-hello-world-ma (base)
and
latest version
latest version
fc49af0a
5 commits,
2 years ago
4 files
+
45
−
107
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
common/template/common-template/common-template-bmk.sh deleted
100755 → 0
+
0
−
88
Options
#!/bin/bash
# Copyright 2019-2020 CERN. See the COPYRIGHT file at the top-level
# directory of this distribution. For licensing information, see the
# COPYING file at the top-level directory of this distribution.
#set -x # enable debug printouts
#set -e # immediate exit on error
# Function parseResults must be defined in each benchmark (or in a separate file parseResults.sh)
# [NB: if a separate function generateSummary exists, it must be internally called by parseResults]
# Input argument $1: status code <fail> from validateInputArguments and doOne steps:
# - <fail> < 0: validateInputArguments failed
# - <fail> > 0: doOne failed (<fail> processes failed out of $NCOPIES)
# - <fail> = 0: OK
# Return value: please return 0 if parsing was successful, 1 otherwise
# The following variables are guaranteed to be defined and exported: NCOPIES, NTHREADS, NEVENTS_THREAD, BMKDIR, DEBUG
# Logfiles have been stored in process-specific working directories <basewdir>/proc_<1...NCOPIES>
# The function is started in the base working directory <basewdir>:
# please store here the overall json summary file for all NCOPIES processes combined
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
)"
local
score
=
1
# hardcoded (dummy)
local
msg
=
"OK"
local
app
=
"
\"
UNKNOWN
\"
"
local
json
=
common-template_summary.json
echo
-e
"{
\"
copies
\"
:
$NCOPIES
,
\"
threads_per_copy
\"
:
$NTHREADS
,
\"
events_per_thread
\"
:
$NEVENTS_THREAD
,
\"
throughput_score
\"
:
$score
,
\"
log
\"
:
\"
$msg
\"
,
\"
app
\"
:
${
app
}
}"
>
${
json
}
&&
cat
${
json
}
# Return 0 if parsing was successful, 1 otherwise
return
0
}
# Function doOne must be defined in each benchmark
# Input argument $1: process index (between 1 and $NCOPIES)
# Return value: please return 0 if this workload copy was successful, 1 otherwise
# The following variables are guaranteed to be defined and exported: NCOPIES, NTHREADS, NEVENTS_THREAD, BMKDIR, DEBUG
# The function is started in process-specific working directory <basewdir>/proc_$1:
# please store here the individual log files for each of the NCOPIES processes
function
doOne
(){
if
[
"
$1
"
==
""
]
||
[
"
$2
"
!=
""
]
;
then
echo
"[doOne] ERROR! Invalid arguments '
$@
' to doOne"
;
return
1
;
fi
echo
"[doOne (
$1
)]
$(
date
)
starting in
$(
pwd
)
"
# Configure WL copy
# Execute WL copy
echo
"[doOne (
$1
)] do one! (process
$1
of
$NCOPIES
)"
for
i
in
$(
seq
$NTHREADS
)
;
do
echo
"HALLO WORLD
$i
"
;
done
status
=
0
echo
"[doOne (
$1
)]
$(
date
)
completed (status=
$status
)"
# Return 0 if this workload copy was successful, 1 otherwise
return
$status
}
# 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)
# Input arguments: none
# Return value: please return 0 if input arguments are valid, 1 otherwise
# The following variables are guaranteed to be defined: NCOPIES, NTHREADS, NEVENTS_THREAD
# (benchmark defaults) and USER_NCOPIES, USER_NTHREADS, USER_NEVENTS_THREADS (user inputs)
function
validateInputArguments
(){
if
[
"
$1
"
!=
""
]
;
then
echo
"[validateInputArguments] ERROR! Invalid arguments '
$@
' to validateInputArguments"
;
return
1
;
fi
echo
"[validateInputArguments] validate input arguments"
# Dummy version: accept user inputs as they are
if
[
"
$USER_NCOPIES
"
!=
""
]
;
then
NCOPIES
=
$USER_NCOPIES
;
fi
if
[
"
$USER_NTHREADS
"
!=
""
]
;
then
NTHREADS
=
$USER_NTHREADS
;
fi
if
[
"
$USER_NEVENTS_THREAD
"
!=
""
]
;
then
NEVENTS_THREAD
=
$USER_NEVENTS_THREAD
;
fi
# Return 0 if input arguments are valid, 1 otherwise
return
0
}
# Optional function usage_detailed may be defined in each benchmark
# Input arguments: none
# Return value: none
function
usage_detailed
(){
echo
"NCOPIES*NTHREADS may be lower or greater than nproc=
$(
nproc
)
"
}
# Default values for NCOPIES, NTHREADS, NEVENTS_THREAD must be set in each benchmark
NCOPIES
=
4
NTHREADS
=
2
# (do not use NTHREADS=1, to allow tests that this can be changed)
NEVENTS_THREAD
=
1
# Source the common benchmark driver
if
[
-f
$(
dirname
$0
)
/bmk-driver.sh
]
;
then
.
$(
dirname
$0
)
/bmk-driver.sh
else
.
$(
dirname
$0
)
/../../../common/bmk-driver.sh
fi
Loading