Skip to content

Commit e3dc8a6

Browse files
committed
Add test of ExpressReco to the online release validation (BII-8797)
1 parent 5c6cacc commit e3dc8a6

9 files changed

+135
-26
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
##########################################################################
4+
# basf2 (Belle II Analysis Software Framework) #
5+
# Author: The Belle II Collaboration #
6+
# #
7+
# See git log for contributors and copyright holders. #
8+
# This file is licensed under LGPL-3.0, see LICENSE.md. #
9+
##########################################################################
10+
11+
# Set number of processes and make sure we profile the execution
12+
PROCESSES="-p ${NCPUS}"
13+
PARENT="b2code-memoryusage -i 0.1 -m record -p ${OUTPUT_DIR}/beam_reco_monitor-hlt-memory.npz --"
14+
15+
# ... but change the settings if we run in debug mode
16+
if [ "$1" = "debug" ]; then
17+
PROCESSES="-p0 -n100"
18+
PARENT="gdb --args"
19+
fi
20+
21+
# Prepare the input file: the ROIs objects must be removed for the HLT validation
22+
INPUT_FILE_BASENAME=`basename ${VALIDATION_RAWDATA} .root`
23+
INPUT_FILE=${OUTPUT_ROOT_DIR}/${INPUT_FILE_BASENAME}-hlt.root
24+
b2file-mix -n 100 --exclude ROIs --keep-eventinfo -o ${INPUT_FILE} ${VALIDATION_RAWDATA}
25+
26+
# Run the HLT script
27+
${PARENT} basf2 ${PROCESSES} \
28+
${BELLE2_RELEASE_DIR}/hlt/operation/phase3/global/hlt/evp_scripts/beam_reco_monitor.py -- \
29+
UNUSED UNUSED 6666 \
30+
--input-file ${INPUT_FILE} \
31+
--output-file ${OUTPUT_ROOT_DIR}/beam_reco_monitor-hlt-out.root \
32+
--histo-output-file ${OUTPUT_ROOT_DIR}/beam_reco_monitor-hlt-dqm.root \
33+
--local-db-path cdb

hlt/tests/release_validation/automatic-01-reconstructrawdata.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
##########################################################################
4+
# basf2 (Belle II Analysis Software Framework) #
5+
# Author: The Belle II Collaboration #
6+
# #
7+
# See git log for contributors and copyright holders. #
8+
# This file is licensed under LGPL-3.0, see LICENSE.md. #
9+
##########################################################################
10+
11+
b2code-memoryusage -m plot --types=vps --no-legend -p ${OUTPUT_DIR}/beam_reco_monitor-hlt-memory.npz -o ${OUTPUT_DIR}/beam_reco_monitor-hlt-memory.pdf

hlt/tests/release_validation/automatic-02-memoryprofile.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
##########################################################################
4+
# basf2 (Belle II Analysis Software Framework) #
5+
# Author: The Belle II Collaboration #
6+
# #
7+
# See git log for contributors and copyright holders. #
8+
# This file is licensed under LGPL-3.0, see LICENSE.md. #
9+
##########################################################################
10+
11+
b2hlt_print_result.py --local-db-path cdb ${OUTPUT_ROOT_DIR}/beam_reco_monitor-hlt-out.root

hlt/tests/release_validation/automatic-03-triggeroutput.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
##########################################################################
4+
# basf2 (Belle II Analysis Software Framework) #
5+
# Author: The Belle II Collaboration #
6+
# #
7+
# See git log for contributors and copyright holders. #
8+
# This file is licensed under LGPL-3.0, see LICENSE.md. #
9+
##########################################################################
10+
11+
# Set number of processes and make sure we profile the execution
12+
PROCESSES="-p ${NCPUS}"
13+
PARENT="b2code-memoryusage -i 0.1 -m record -p ${OUTPUT_DIR}/beam_reco_monitor-expressreco-memory.npz --"
14+
15+
# ... but change the settings if we run in debug mode
16+
if [ "$1" = "debug" ]; then
17+
PROCESSES="-p0 -n100"
18+
PARENT="gdb --args"
19+
fi
20+
21+
# Prepare the input file: we want to run just a quick validation for the ExpressReco,
22+
# since at this stage we know that HLT works fine
23+
INPUT_FILE_BASENAME=`basename ${VALIDATION_RAWDATA} .root`
24+
INPUT_FILE=${OUTPUT_ROOT_DIR}/${INPUT_FILE_BASENAME}-expressreco.root
25+
b2file-mix -n 100 --keep-eventinfo -o ${INPUT_FILE} ${VALIDATION_RAWDATA}
26+
27+
# Run the ExpressReco script
28+
${PARENT} basf2 ${PROCESSES} \
29+
${BELLE2_RELEASE_DIR}/hlt/operation/phase3/global/expressreco/evp_scripts/beam_reco.py -- \
30+
UNUSED UNUSED 6666 \
31+
--input-file ${INPUT_FILE} \
32+
--output-file ${OUTPUT_ROOT_DIR}/beam_reco_monitor-expressreco-out.root \
33+
--histo-output-file ${OUTPUT_ROOT_DIR}/beam_reco_monitor-expressreco-dqm.root \
34+
--local-db-path cdb
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
##########################################################################
4+
# basf2 (Belle II Analysis Software Framework) #
5+
# Author: The Belle II Collaboration #
6+
# #
7+
# See git log for contributors and copyright holders. #
8+
# This file is licensed under LGPL-3.0, see LICENSE.md. #
9+
##########################################################################
10+
11+
b2code-memoryusage -m plot --types=vps --no-legend -p ${OUTPUT_DIR}/beam_reco_monitor-expressreco-memory.npz -o ${OUTPUT_DIR}/beam_reco_monitor-expressreco-memory.pdf

hlt/tests/release_validation/run.sh

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
1+
#!/bin/bash
2+
3+
##########################################################################
4+
# basf2 (Belle II Analysis Software Framework) #
5+
# Author: The Belle II Collaboration #
6+
# #
7+
# See git log for contributors and copyright holders. #
8+
# This file is licensed under LGPL-3.0, see LICENSE.md. #
9+
##########################################################################
10+
111
echo $@ | grep -E -- "(^|\\s)(--help|-h)($|\\s)" &>/dev/null
212
if [ $? -eq 0 ]; then
313
cat <<EOT
4-
This script runs the (semi-)automated HLT release validation which will make sure
5-
the release can run on the real HLT system with raw data from the detector
6-
recorded in a previous run.
14+
This script runs the (semi-)automated online release validation which will make sure
15+
the release can run on the real online systems (HLT and ExpressReco) with raw data
16+
from the detector recorded in a previous run.
717
818
It has two optional arguments which are the stage of the validation to run and output
919
directory for the validation output. If not given it will run the automatic part and
1020
put the output in "${STAGE}_validation-${BELLE2_RELEASE:-head}".
1121
1222
`basename $0` [<stage>] [<output_directory>]
1323
14-
It will use as many cores as present on the system a provided by the nproc utility (nproc=$(nproc))
24+
It will use as many cores as present on the system a provided by the nproc utility
25+
(nproc=$(nproc)).
26+
27+
By default, the root files produced during the validation are removed at the end of
28+
the validation. If the root files must be kept for further studies, please set
29+
the environment variable "BELLE2_RELEASE_VALIDATION_KEEP_ROOT" to any values, e.g.:
30+
31+
export BELLE2_RELEASE_VALIDATION_KEEP_ROOT=1
1532
EOT
1633
exit 1;
1734
fi
@@ -66,6 +83,7 @@ fi
6683
export RELEASE=${BELLE2_RELEASE:-head}
6784
export NCPUS=$(nproc)
6885
export OUTPUT_DIR=$(realpath ${2:-${STAGE}-validation-${RELEASE}})
86+
export OUTPUT_ROOT_DIR=`mktemp -d tmp_XXXXX`
6987

7088
# yes, from here on out we want to exit on every error
7189
set -e
@@ -74,6 +92,18 @@ set -o pipefail
7492
# and make sure we replace non-matching patterns with null instead of keeping them unexpanded.
7593
shopt -s nullglob
7694

95+
# delete the output root files unless specified
96+
function cleanup() {
97+
echo "Deleting the output root files"
98+
rm -rf ${OUTPUT_ROOT_DIR}
99+
}
100+
if [ -z "$BELLE2_RELEASE_VALIDATION_KEEP_ROOT" ]; then
101+
trap cleanup EXIT
102+
else
103+
echo "The output root files will be stored in ${OUTPUT_ROOT_DIR}"
104+
fi
105+
106+
# setup the output directory
77107
mkdir -p ${OUTPUT_DIR}
78108

79109
# save the environment variables we have
@@ -93,5 +123,6 @@ function run_stage() {
93123

94124
# always run the setup first
95125
run_stage setup
126+
96127
# and then the real stage
97128
run_stage $STAGE

0 commit comments

Comments
 (0)