Comment 17 for bug 1674341

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote : Re: [Bug 1674341] Re: Pythia8 shower failed since it did not accept any event from the MG5aMC event file

Hi,

> There seems to be something wrong at line 173. So I modified it myself by adding
>
>
> if path.endswith('.gz') and mode == 'w' and\
> isinstance(self, EventFileNoGzip):
> path = path[:-3]

You did not have to add those lines at all.
That part of the patch was changing an empty line by another. It is completely irrelevant actually.

If you added those lines, I guess that they were not yet present.
They are related to another bug related to version 2.6 of python.
If you use that version, this explains why it was so difficult for Valentin and I reproduce this bug. It was only triggered with python 2.6
Due to the missing of support for zip file in that version of the code.

So my first advise, would be to remove the above line, to see if this helps.
If not, try with python2.7 (if available).
If this still not work, then the only way is to go to the development version of the code.

Cheers,

Olivier

> On 3 Aug 2017, at 07:49, Tao Xu <email address hidden> wrote:
>
> Hi Olivier,
>
> I tried the patch you provided for the same problem and got the
> following:
>
>
> [xutao@localhost various]$ patch lhe_parser.py empty_file.patch
> patching file lhe_parser.py
> Hunk #1 FAILED at 173.
> Hunk #2 succeeded at 229 (offset -4 lines).
> Hunk #3 succeeded at 252 (offset -4 lines).
> Hunk #4 succeeded at 2597 (offset -4 lines).
> 1 out of 4 hunks FAILED -- saving rejects to file lhe_parser.py.rej
>
>
> There seems to be something wrong at line 173. So I modified it myself by adding
>
>
> if path.endswith('.gz') and mode == 'w' and\
> isinstance(self, EventFileNoGzip):
> path = path[:-3]
>
>
> Then I made a simple test by performing PS in p p > j j process with matching, but got the following errors:
>
>
> INFO: Running Pythia8 [arXiv:1410.3012]
> No user-defined value for Pythia8 parameter 'JetMatching:nJetMax'. Setting it automatically to 2.
> Splitting .lhe event file for PY8 parallelization...
> Command "generate_events run_01" interrupted with error:
> IOError : [Errno 2] No such file or directory: '/home/xutao/HEP/MG5_aMC_v2_5_5/bin/PROC_sm_1/Events/run_01/unweighted_events.lhe_0.lhe.gz'
> Please report this bug on https://bugs.launchpad.net/mg5amcnlo
> More information is found in '/home/xutao/HEP/MG5_aMC_v2_5_5/bin/PROC_sm_1/run_01_tag_1_debug.log'.
> Please attach this file to your report.
> INFO: storing files of previous run
> gzipping output file: unweighted_events.lhe
> INFO: Done
>
>
> I do have "unweighted_events.lhe_0.lhe" in that path, but not the .gz file. In "run_01_tag_1_debug.log", I find the following message:
>
>
> generate_events run_01
> Traceback (most recent call last):
> File "/home/xutao/HEP/MG5_aMC_v2_5_5/madgraph/interface/extended_cmd.py", line 1430, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/home/xutao/HEP/MG5_aMC_v2_5_5/madgraph/interface/extended_cmd.py", line 1384, in onecmd_orig
> return func(arg, **opt)
> File "/home/xutao/HEP/MG5_aMC_v2_5_5/madgraph/interface/madevent_interface.py", line 2130, in do_generate_events
> self.exec_cmd('shower --no_default', postcmd=False, printcmd=False)
> File "/home/xutao/HEP/MG5_aMC_v2_5_5/madgraph/interface/extended_cmd.py", line 1457, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/home/xutao/HEP/MG5_aMC_v2_5_5/madgraph/interface/extended_cmd.py", line 1384, in onecmd_orig
> return func(arg, **opt)
> File "/home/xutao/HEP/MG5_aMC_v2_5_5/madgraph/interface/madevent_interface.py", line 3441, in do_shower
> postcmd=False, printcmd=False)
> File "/home/xutao/HEP/MG5_aMC_v2_5_5/madgraph/interface/extended_cmd.py", line 1457, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/home/xutao/HEP/MG5_aMC_v2_5_5/madgraph/interface/extended_cmd.py", line 1384, in onecmd_orig
> return func(arg, **opt)
> File "/home/xutao/HEP/MG5_aMC_v2_5_5/madgraph/interface/madevent_interface.py", line 4058, in do_pythia8
> pjoin(parallelization_dir,split_files[-1]))
> File "/usr/lib64/python2.6/shutil.py", line 260, in move
> copy2(src, real_dst)
> File "/usr/lib64/python2.6/shutil.py", line 95, in copy2
> copyfile(src, dst)
> File "/usr/lib64/python2.6/shutil.py", line 50, in copyfile
> with open(src, 'rb') as fsrc:
> IOError: [Errno 2] No such file or directory: '/home/xutao/HEP/MG5_aMC_v2_5_5/bin/PROC_sm_1/Events/run_01/unweighted_events.lhe_0.lhe.gz'
> Related File: /home/xutao/HEP/MG5_aMC_v2_5_5/bin/PROC_sm_1/Events/run_01/unweighted_events.lhe_0.lhe.gz
>
>
> I'm not sure if I used the patch right. Can you help me with this?
>
> Many thanks,
> Tao Xu
>
> --
> You received this bug notification because you are subscribed to
> MadGraph5_aMC@NLO.
> https://bugs.launchpad.net/bugs/1674341
>
> Title:
> Pythia8 shower failed since it did not accept any event from the
> MG5aMC event file
>
> Status in MadGraph5_aMC@NLO:
> New
>
> Bug description:
> Hi,
>
> I'm trying to generate a matched jet sample using pythia8 and MG
> 2.5.3, but I'm getting the following error:
>
> Command "generate_events run_01" interrupted with error:
> InvalidCmd : Pythia8 shower failed since it did not accept any event from the MG5aMC event file.
>
> I'm doing the following for the generation:
>
> generate p p > z, z > e+ e- @0
> add process p p > z j, z > e+ e- @1
> add process p p > z j j, z > e+ e- @2
> output ~/mgoutput2/zjj_matched_MG253
> launch
> shower=pythia8
> detector=delphes
> set run_card ickkw 1
> set run_card auto_ptj_mjj True
> set run_card xqcut 20
> set pythia8_card JetMatching:qCut 30
>
> The same process with MG 2.3.3 and pythia 6 works fine.
>
> I'm attaching the end of one of the log files
> (Events/run_01/PY8_parallelization/split_0/PY8_log.txt). If I don't do
> matching, the showering with pythia8 is working fine.
>
> Thanks in advance,
>
>
> Nicolas.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mg5amcnlo/+bug/1674341/+subscriptions