Skip to content

Fix how nevents is extracted for MG jO

Spyros Argyropoulos requested to merge fixlp into master

Description of bug

From @ewelina

File "scripts/", line 488, in main
 File "scripts/", line 271, in madgraphChecks
ValueError: invalid literal for int() with base 10: '11000.'

This is because log.generate contains the following printouts

22:32:58 Py:MadGraphUtils     INFO Setting nevents = 11000.
22:33:05 Py:MadGraphUtils     INFO "nevents" = 11000

and logParser takes the first instead of the second.

Changes introduced

  • Take nevents from line containing INFO "nevents" (with quotes)
  • The first occurrence of this line is used so if a file contains
22:33:05 Py:MadGraphUtils     INFO "nevents" = 5000
22:33:05 Py:MadGraphUtils     INFO "nevents" = 9000

the code would use 5000. It is not clear whether this would ever happen and what we would want to do in this case; @zmarshal @mcfayden can comment


Test on the problematic case reported by Ewelina

Works ok

Test on the case reported in !372 (merged)


Note that log.generate there contained the following line:

05:18:48 Py:MadGraphUtils     INFO "nevents" = 10000

and the jO is not setting nevents. I am not sure how MG knows to set nevents to 10000 (probably through NEventsPerJob?) but since MG was indeed generating 10k events I think the behaviour of logParser is correct in this case.

Multiple occurrences of nevents

If I hack the log.generate file to contain:

22:33:05 Py:MadGraphUtils     INFO "nevents" = 5000
22:33:05 Py:MadGraphUtils     INFO "nevents" = 11000

logParser gives:

Issues resolved

Closes #107 (closed)

Merge request reports