Weird output on the screen at "Merging results from the split PY8 runs..."

Asked by Jakub Salko on 2020-03-09

Hey!

Recently I updated madgraph to version 2.7 (running on Ubuntu 18.4) and I noticed that when I run pythia8 everything works fine until "Merging results from the split PY8 runs..." when I get my screen swamped with output that looks something like this

ControlSwitchR�R�RvR�RLR�RSRIR^tAskforEditCardtnningR�R
                                                      version_infoR<optparset
                                                                             OptionParserRdRftparsert
add_optiont
           parser_errorRR�RtargvR�t
parse_argsR&R�Retlogging.configtinternal.coloring_loggingR
RR%R0RMtconfigt
fileConfigtrootsetLevelR"R6cmd_lineR3R@trun_cmdR9(((s>/home/jakub/.madgraph/madgraph/interface/madevent_interface.py<module>sV
                                                                                                                                       
....

There is a lot of it and I cannot even scroll back to the output that was on screen before the pythia run. The text that appears between all the random symbols comes from madevent_interface.py file. I traced the problem to the for loop on line 4661 in madevent_interface.py. I commented lines 4664-4669 and 4676-4678 and added if sys.platform == 'darwin': on line 4664. This fixed the wierd pythia behaviour but I am not sure what are the consequences of this fix.
I want to ask if you have any suggestions for a better fix.

Best regards,
Jakub Salko

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
2020-03-09
Last query:
2020-03-09
Last reply:
2020-03-09

Hi,

Thanks a lot, someone else was reporting the same issue but since this is machine specific I was not able to figure it out.
Thanks to your help, I was able to put the correct fix in place.

Thanks,

Olivier

PS the correct patch is this one (but yours is also fine)
=== modified file 'madgraph/interface/madevent_interface.py'
--- madgraph/interface/madevent_interface.py 2020-03-09 09:27:32 +0000
+++ madgraph/interface/madevent_interface.py 2020-03-09 15:43:37 +0000
@@ -4672,13 +4672,7 @@
                                 # sed on MAC has slightly different synthax than on
                                 os.system(' '.join(['sed','-i',"''","'%s;$d'"%
                                         (';'.join('%id'%(i+1) for i in range(n_head))),hepmc_file]))
- else:
-
-
- os.system('head -n -1')
- os.system(' '.join(['head','-n','-1',hepmc_file,'|','tail','-n','+'+str(n_head),'>','tmpfile']))
- os.system(' '.join(['mv','tmpfile',hepmc_file]))
-
+ else:
                                 # other UNIX systems
                                 os.system(' '.join(['sed','-i']+["-e '%id'"%(i+1) for i in range(n_head)]+
                                                                             ["-e '$d'",hepmc_file]))

Jakub Salko (jasalko) said : #2

Thanks Olivier Mattelaer, that solved my question.