Improve extraction of nEventsPerJob to replicate what is done in Prodsys
Description of bug
Since nEventsPerJob was not converted to int in jo_utils.py (as done in Prodsys) an expression involving evgenConfig.nEventsPerJob resulted in a crash of logParser:
- nEventsPerJob = runArgs.maxEvents*safefactorifrunArgs.maxEvents>0elsesafefactor*evgenConfig.nEventsPerJob
Traceback (most recent call last):
File "scripts/logParser.py", line 655, in <module>
main()
File "scripts/logParser.py", line 543, in main
tmp=CountHepMC if CountHepMC == int(nEventsPerJob) else int(nEventsPerJob)
ValueError: invalid literal for int() with base 10: 'runArgs.maxEvents*safefactorifrunArgs.maxEvents>0elsesafefactor*evgenConfig.nEventsPerJob'
Changes introduced
jo_utils tries to convert nEventsPerJob to an integer. If the conversion is not possible an exception is thrown and logParser sets the number of events to 10k. This exactly reproduces what is done in Prodsys.
Tests
After change:
WARNING: evgenConfig.nEventsPerJob is not defined in the jO. Will set to default: 10000
- nEventsPerJob = 10000
Issues resolved
Closes #
Edited by Spyros Argyropoulos