Error within JRandomEventRunByRun.sh don't lead to a return status != 0
This issue is actually about 2 problem. First, I face an error in JRandomEventRunByRun.sh
. This error wasn't caught by Snakemake, has the script produce a valid file anyway, with a return status of 0.
The error can be seen here:
# Setting environment variables for Jpp software.
Auxiliary program to write time slices with random data.
usage: JRandomTimesliceWriter
-h "help"
-h! "help with print of default and possible values"
-v "print revision"
-- "end of options; remainder will be discarded"
--! "end of options with print of actual values"
-B <rates_Hz> = 5200 568 49.1 5.48 0.48
-F <fast> = 0
-N <recycling> = 10 1e+06
-P <pmtParameters> = # $63d6a7d2-41be-4def-8cb3-2a4caf25cadd$
[Don't show the full PMT paramter file]
-C <selector> = JDAQTimesliceL0
-a <detectorFile> = "00000049/00011156/detector/KM3NeT_00000049_00011156_online.detx"
-c <clock> = 1
-d <debug> = 2
-f <inputFile> = .//cEX22u/pipe.dat
-n <numberOfEvents> = 0 9223372036854775807
-o <outputFile> = .//cEX22u/trigger_processor.root
See also: https://common.pages.km3net.de/jpp#JTriggerProcessor
WARNING: Run-by-run simulation discards singles rate [Hz] 10400
terminate called after throwing an instance of 'JLANG::JIndexOutOfRange'
what(): /builds/common/jpp/software/JTools/JHashMap.hh:173
JHashMap::get(): invalid key 806451572
Elapsed time 5.003 s.
(full log are available KM3NeT_00000049_00011156.mc.pure_noise.jterbr.v9.0.logs)
However, even if this step failed, JTriggerProcessor is run anyway, producing an empty but valid file.
I put everything to reproduce in Lyon, in this path: /sps/km3net/users/vpestel/git_issues/Jpp_465_JRandomEventRunByRun_error
and running:
BASE_DIR="/sps/km3net/users/vpestel/git_issues/Jpp_465_JRandomEventRunByRun_error"
export RANDOMEVENT_DEBUG=2
export RANDOMEVENT_FACTOR=0.5
export RANDOMEVENT_RECYCLING="10 1e6"
N_SLICES=$(JPrintTree -f $BASE_DIR/00000049/00011156/trigger/KM3NeT_00000049_00011156.data.v9.0.root | awk '/KM3NETDAQ::JDAQSummaryslice/ {{print $3}}')
export RANDOMEVENT_SLICES=$(perl -e "print int($N_SLICES * 0.1)")
echo $RANDOMEVENT_SLICES
JRandomEventRunByRun.sh $BASE_DIR/00000049/00011156/detector/KM3NeT_00000049_00011156_online.detx test.root $BASE_DIR/00000049/00011156/trigger/KM3NeT_00000049_00011156.data.v9.0.root $BASE_DIR/00000049/00011156/detector/KM3NeT_00000049_00011156_PMT_parameters.txt
EDIT: something fun, when running it interactively at Lyon (and not in the container) it return a non-zero status with the following message:
See also: https://common.pages.km3net.de/jpp#JTriggerProcessor
terminate called after throwing an instance of 'JLANG::JIndexOutOfRange'
what(): /pbs/throng/km3net/src/Jpp/v18.5.0/software/JTools/JHashMap.hh:173
JHashMap::get(): invalid key 806451572
Error in <TFile::TFile>: file test.root already exists
terminate called after throwing an instance of 'JLANG::JException'
what(): Mon Oct 30 16:05:18 2023
/pbs/throng/km3net/src/Jpp/v18.5.0/software/JROOT/JRootFile.hh:265
Error opening file test.root
Elapsed time 5.798 s.
test.root
terminate called after throwing an instance of 'JLANG::JException'
what(): Mon Oct 30 16:05:20 2023
/pbs/throng/km3net/src/Jpp/v18.5.0/software/JROOT/JRootFile.hh:171
Error recovery file test.root disabled
So the error recovery must be turned on in the container ?
Edited by Valentin Pestel