Skip to content

Commit c7883d8

Browse files
committed
Test with many generators
1 parent 50b1310 commit c7883d8

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

MC/config/PWGHF/external/generator/generator_pythia8_embed_hf.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,3 +420,4 @@ FairGenerator * GeneratorPythia8EmbedHFCharmAndBeauty(bool usePtHardBins = false
420420
return myGen;
421421
}
422422

423+

MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,3 +438,4 @@ FairGenerator *GeneratorPythia8GapHF(int inputTriggerRatio, float yQuarkMin = -1
438438

439439
return myGen;
440440
}
441+

test/run_generator_tests.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@ exec_test()
109109
local ini_path=${1}
110110
local generator=${2} # for now one of "Pythia8" or "External", at this point we know that settings for the generator are defined in this ini
111111
local generator_lower=$(echo "${generator}" | tr '[:upper:]' '[:lower:]')
112+
local test_id=${3} # DPL session ID
112113
# TODO Potentially, one could run an external generator that derives from GeneratorPythia8 and so could probably use configuration for TriggerPythia8
113-
local trigger=${3:+-t ${generator_lower}}
114-
local trigger_dpl=${3:+--trigger ${generator_lower}}
114+
local trigger=${4:+-t ${generator_lower}}
115+
local trigger_dpl=${4:+--trigger ${generator_lower}}
115116
local RET=0
116117
# this is how our test script is expected to be called
117118
local test_script=$(get_test_script_path_for_ini ${ini_path})
@@ -124,8 +125,9 @@ exec_test()
124125
echo "### Testing DPL-eventgen ###" >> ${LOG_FILE_SIM}
125126
# run the event generation using the dpl-eventgen executable.
126127
# This is a basic running test, however it's important because the system running on Hyperloop
127-
# is largely used for MCGEN productions and is currently tested only locally
128-
o2-sim-dpl-eventgen --generator ${generator_lower} ${trigger_dpl} --nEvents ${nev} --configFile ${ini_path} --configKeyValues "GeneratorPythia8.includePartonEvent=true" -b >> ${LOG_FILE_SIM} 2>&1
128+
# is largely used for MCGEN productions and is currently tested only locally.
129+
# Using unique session labels to prevent channel binding conflicts in parallel execution
130+
o2-sim-dpl-eventgen --session test_${test_id} --generator ${generator_lower} ${trigger_dpl} --nEvents ${nev} --configFile ${ini_path} --configKeyValues "GeneratorPythia8.includePartonEvent=true" -b >> ${LOG_FILE_SIM} 2>&1
129131
RET=${?}
130132
[[ "${RET}" != "0" ]] && { remove_artifacts ; return ${RET} ; }
131133
# run the simulation, fail if not successful
@@ -189,7 +191,7 @@ check_generators()
189191
# Run test in background
190192
(
191193
cd ${test_dir}
192-
exec_test ${ini_path} ${g} ${has_trigger}
194+
exec_test ${ini_path} ${g} ${test_num} ${has_trigger}
193195
exit $?
194196
) &
195197
local pid=$!
@@ -387,11 +389,11 @@ print_usage()
387389

388390
# whether or not to exit after first test has failed
389391
fail_immediately=
390-
[[ "${1}" == "--fail_immediately" ]] && fail_immediately=1
392+
[[ "${1}" == "--fail-immediately" ]] && fail_immediately=1
391393

392394
while [ "$1" != "" ] ; do
393395
case $1 in
394-
--fail_immediately ) shift
396+
--fail-immediately ) shift
395397
fail_immediately=1
396398
;;
397399
--keep-artifacts ) shift

0 commit comments

Comments
 (0)