Skip to content
Snippets Groups Projects

Master

Merged Domenico Giordano requested to merge master into qa-build-juno-gen-sim-reco
13 files
+ 140
37
Compare changes
  • Side-by-side
  • Inline
Files
13
@@ -8,6 +8,14 @@
#set -e # immediate exit on error
# Variables used in both doOne and getEvents
inputdatadir=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests
inputdata=$inputdatadir/data17_13TeV.00330470.physics_Main.daq.RAW._lb0310._SFO-1._0001.data
release=23.0.3
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh -q
asetup Athena,${release} --tdaqarea=/cvmfs/atlas.cern.ch/repo/sw/tdaq
# 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
@@ -19,8 +27,6 @@ function doOne(){
echo "[doOne ($1)] $(date) starting in $(pwd)"
# Configure WL copy
inputdatadir=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests
inputdata=$inputdatadir/data17_13TeV.00330470.physics_Main.daq.RAW._lb0310._SFO-1._0001.data
#echo "multiplicants"
#echo ${NEVENTS_THREAD}
#echo ${NTHREADS}
@@ -29,10 +35,6 @@ function doOne(){
echo $maxEvents
# Extra ATLAS-specific setup
release=23.0.3
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh -q
asetup Athena,${release}
unset FRONTIER_SERVER
export ATHENA_CORE_NUMBER=$athenaCores # env variable for ATHENA threads/process number
@@ -59,6 +61,24 @@ function doOne(){
return $status
}
# Function that retrieves from the input file the number of events
# in order to check that there are enough events for the number of running threads
function getEvents(){
currentDir=`pwd`
[[ ! -e /tmp/getEvents ]] && mkdir /tmp/getEvents
cd /tmp/getEvents
acmd ath-dump $inputdata >& /dev/null
echo "[getEvents] Checking number of events in file $inputdata"
evts=`grep nentries athfile-infos.ascii | awk '{print $2}' | sed 's/,//'`
STATUS=$?
cd $currentDir
rm -rf /tmp/getEvents
[[ $STATUS != 0 ]] && evts=0
}
# 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)
@@ -69,8 +89,6 @@ function doOne(){
function validateInputArguments(){
if [ "$1" != "" ]; then echo "[validateInputArguments] ERROR! Invalid arguments '$@' to validateInputArguments"; return 1; fi
echo "[validateInputArguments] validate input arguments"
# Number of events per thread
if [ "$USER_NEVENTS_THREAD" != "" ]; then NEVENTS_THREAD=$USER_NEVENTS_THREAD; fi
# Number of copies and number of threads per copy
if [ "$USER_NTHREADS" != "" ] && [ "$USER_NCOPIES" != "" ]; then
NCOPIES=$USER_NCOPIES
@@ -82,6 +100,23 @@ function validateInputArguments(){
NCOPIES=$USER_NCOPIES
NTHREADS=$((`nproc`/$NCOPIES))
fi
# Number of events per thread
if [ "$USER_NEVENTS_THREAD" != "" ]; then NEVENTS_THREAD=$USER_NEVENTS_THREAD; fi
# Extract number of events in input file
declare -i evts=0
getEvents
echo "[validateInputArguments] number of events in input file is ${evts}"
if [[ $evts == 0 ]] ; then
echo "[ERROR] Cannot extract number of events from input file"
return 1
fi
if [[ $((NEVENTS_THREAD * NTHREADS)) -gt $evts ]] ; then
echo "[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"
Loading