Cannot get pythia8 to run on MG5 events (using MG installed pythia)

Asked by Martin

Hi,

I am generating gg > a a events at NLO using the HC model, and everything works fine until the pythia step, at which point it hangs.

If I go to this directory:

PROC_HC_NLO_X0_UFO_1/Events/run_01/PY8_parallelization/split_0

and try to run:

/MG5aMC_PY8_interface PY8Card.dat

I see the problem, which is that pythia claims it is not initialised properly. This is after installing Delphes and Pythia 8 within Madgraph itself, and trying to run with Delphes and pythia 8 on (using Madgraph v2.5.1).

What is strange is that this works fine on my desktop machine, but it breaks on our local cluster (so it may be some weird environment issue). One possible difference is that I could not install LHAPDF due to it not finding my more recent BOOST version but I can't see how that would affect it if I'm using built in PDFs.

I have put a tarball of the split_0 directory here in case you can spot anything wrong (but the origin must be somewhere higher up the chain).

https://dl.dropboxusercontent.com/u/52286446/split_0.tgz

Cheers,

Martin

Question information

Language:
English Edit question
Status:
Needs information
For:
MadGraph5_aMC@NLO Edit question
Assignee:
Stefan Prestel Edit question
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi Martin,

First let me stress that g g > a a [QCD] is at LO computation and not a NLO computation.
Second, can you put the bug report/crash/… that you face?
This will help us since as you said this is a machine dependent problem.

Cheers,

Olivier

> On Nov 18, 2016, at 11:17, Martin <email address hidden> wrote:
>
> New question #404194 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/404194
>
> Hi,
>
> I am generating gg > a a events at NLO using the HC model, and everything works fine until the pythia step, at which point it hangs.
>
> If I go to this directory:
>
> PROC_HC_NLO_X0_UFO_1/Events/run_01/PY8_parallelization/split_0
>
> and try to run:
>
> /MG5aMC_PY8_interface PY8Card.dat
>
> I see the problem, which is that pythia claims it is not initialised properly. This is after installing Delphes and Pythia 8 within Madgraph itself, and trying to run with Delphes and pythia 8 on (using Madgraph v2.5.1).
>
> What is strange is that this works fine on my desktop machine, but it breaks on our local cluster (so it may be some weird environment issue). One possible difference is that I could not install LHAPDF due to it not finding my more recent BOOST version but I can't see how that would affect it if I'm using built in PDFs.
>
> I have put a tarball of the split_0 directory here in case you can spot anything wrong (but the origin must be somewhere higher up the chain).
>
> https://dl.dropboxusercontent.com/u/52286446/split_0.tgz
>
> Cheers,
>
> Martin
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Valentin Hirschi (valentin-hirschi) said :
#2

A couple points about your issue and PY8 parallelization in the latest 2.5.1 public release of MG5aMC:

a) You can also install LHAPDF6 from MG5aMC directly now. I boost is giving you trouble I should also mention that you can install boost locally from within MG5aMC as well. That is:

MG5_aMC> install boost
MG5_aMC> install lhapdf6
MG5_aMC> install pythia8 (<- this re-installation is just so that pythia8 is then linked to the local lhapdf6 version installed by MG5_aMC)

However, I don't think this is the problem here.

b) During Pythia8 initialization, Pythia8 unfortunately needs to access some XML resources in its installation prefix so that these must be accessible from the nodes running Pythia8 during the parallelization.
So, if you are running on multi-core or on typical LSF clusters where all nodes have access to the central disk, then it is ok.
However if you are running on a CONDOR type of cluster, then Pythia8 will crash if it cannot find these XML resources.
This is an issue that we are looking to resolve now, in collaboration with Stefan Prestel, but there is yet no cure for now.
Please let me know if this is your situation.

c) Also, the 'C' entry of the HEPMC file created by MG5_aMC+PY8 is wrong when (and only when) the PY8 parallelization is activated.
This entry is supposed to be the cumulative cross-section up to this point in the HEPMC (which is an insanely stupid quantity to store in an hepmc even record, but I'll refrain from further rant here) is sometimes used by some (badly designed) RIVET analysis where the 'C' entry of the last HEPMC event is used for normalizing plots.
So make sure that this is not a problem for you (or overwrite the last 'C' entry of the resulting HEPMC file with the cross-section of your liking).
This is another issue for which we are investigating solutions.

Revision history for this message
Martin (martin-white) said :
#3

Hi,

Olivier- you are right of course. It is a box diagram, but at LO. Also,

Unfortunately there wasn't a clean crash report. It simply hangs at the Pythia step, and I had to poke into the Pythia logs to see what it was doing (and it was simply refusing to generate events due to not being initialised properly). The failure is seen even when running interactively, not just in the batch system.

I have now installed boost, lhapdf6 and pythia8 within Madgraph, but this seems to have introduced a new error. Trying to run the same process with delphes=ON gives me the following traceback (which I suspect is independent of the use of Pythia and Delphes):

Traceback (most recent call last):
  File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/madgraph/interface/extended_cmd.py", line 1412, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/madgraph/interface/extended_cmd.py", line 1367, in onecmd_orig
    return func(arg, **opt)
  File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/madgraph/interface/madevent_interface.py", line 2076, in do_generate_events
    postcmd=False)
  File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/madgraph/interface/extended_cmd.py", line 1439, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/madgraph/interface/extended_cmd.py", line 1367, in onecmd_orig
    return func(arg, **opt)
  File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/madgraph/interface/madevent_interface.py", line 2862, in do_survey
    self.configure_directory()
  File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/madgraph/interface/madevent_interface.py", line 5143, in configure_directory
    self.do_treatcards('')
  File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/madgraph/interface/madevent_interface.py", line 2839, in do_treatcards
    self.exec_cmd('initMadLoop -r -f')
  File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/madgraph/interface/extended_cmd.py", line 1439, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/madgraph/interface/extended_cmd.py", line 1367, in onecmd_orig
    return func(arg, **opt)
  File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/madgraph/interface/madevent_interface.py", line 2202, in do_initMadLoop
    subproc_prefix='PV', MG_options=self.options, interface=self)
  File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/madgraph/interface/madevent_interface.py", line 6547, in init_MadLoop
    %(max_mult*n_PS))
MadGraph5Error: Failed the initialization of loop-induced matrix element 'PV0_0_1_gg_aa' (trying with a maximum of 15 PS points).

Revision history for this message
Valentin Hirschi (valentin-hirschi) said :
#4

This is most likely a compilation issue.

> go in the PV0_0_1_gg_aa and (in your <PROC_OUTPUT_PATH>/SubProcesses) and
type 'make check'.

> Also, please make sure that a single standalone MadLoop output works,
just so as to make sure all the dependencies are correctly installed/linked.
You can do this with, for example:

./bin/mg5
MG5_aMC> generate u d~ > e+ ve [virt=QCD]
MG5_aMC> output MyStandaloneTest
MG5_aMC> launch -f

You should find the result of the evaluation of the loop Matrix Element of
this process for one particular PS point.

I expect something will fail in either/both of the two points above, so you
can report those findings.

On Fri, Nov 18, 2016 at 9:13 PM, Martin <
<email address hidden>> wrote:

> Question #404194 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/404194
>
> Status: Answered => Open
>
> Martin is still having a problem:
> Hi,
>
> Olivier- you are right of course. It is a box diagram, but at LO. Also,
>
> Unfortunately there wasn't a clean crash report. It simply hangs at
> the Pythia step, and I had to poke into the Pythia logs to see what it
> was doing (and it was simply refusing to generate events due to not
> being initialised properly). The failure is seen even when running
> interactively, not just in the batch system.
>
> I have now installed boost, lhapdf6 and pythia8 within Madgraph, but
> this seems to have introduced a new error. Trying to run the same
> process with delphes=ON gives me the following traceback (which I
> suspect is independent of the use of Pythia and Delphes):
>
> Traceback (most recent call last):
> File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_
> 1/madgraph/interface/extended_cmd.py", line 1412, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_
> 1/madgraph/interface/extended_cmd.py", line 1367, in onecmd_orig
> return func(arg, **opt)
> File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_
> 1/madgraph/interface/madevent_interface.py", line 2076, in
> do_generate_events
> postcmd=False)
> File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_
> 1/madgraph/interface/extended_cmd.py", line 1439, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_
> 1/madgraph/interface/extended_cmd.py", line 1367, in onecmd_orig
> return func(arg, **opt)
> File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_
> 1/madgraph/interface/madevent_interface.py", line 2862, in do_survey
> self.configure_directory()
> File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_
> 1/madgraph/interface/madevent_interface.py", line 5143, in
> configure_directory
> self.do_treatcards('')
> File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_
> 1/madgraph/interface/madevent_interface.py", line 2839, in do_treatcards
> self.exec_cmd('initMadLoop -r -f')
> File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_
> 1/madgraph/interface/extended_cmd.py", line 1439, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_
> 1/madgraph/interface/extended_cmd.py", line 1367, in onecmd_orig
> return func(arg, **opt)
> File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_
> 1/madgraph/interface/madevent_interface.py", line 2202, in do_initMadLoop
> subproc_prefix='PV', MG_options=self.options, interface=self)
> File "/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_
> 1/madgraph/interface/madevent_interface.py", line 6547, in init_MadLoop
> %(max_mult*n_PS))
> MadGraph5Error: Failed the initialization of loop-induced matrix element
> 'PV0_0_1_gg_aa' (trying with a maximum of 15 PS points).
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.
>

--
Valentin

Revision history for this message
Martin (martin-white) said :
#5

Hi,

Thanks for this- I have resolved the compilation error (there was a problem with the environment, so it was using different versions of gfortran during the initial compilation and during the later run).

This brings the pythia problem back. Unfortunately, the pythia log is not very revealing. It simply says:

 PYTHIA Abort from Pythia::init: Les Houches initialization failed

How can I tell if it is failing to find the xml files? Would it write that somewhere else (I'm looking in Events/run_01/PY8_parallelization/split_0/PY8_log.txt)?

Cheers,

Martin

Revision history for this message
Stefan Prestel (prestel) said :
#6

Hi Martin,

I don't think this sounds like an issue due to not finding the xml files. In order to understand the problem, it would be great if you could post (first 1000 lines of) the Les Houches file, and the Pythia input card that MG5 produced?

Thanks,
Stefan

Revision history for this message
Martin (martin-white) said :
#7

Hi,

I've put a tarball of my complete run directory here (in case you want to look at anything else):

https://dl.dropboxusercontent.com/u/52286446/test.tgz

Note that I killed the execution just after it got to the Pythia problem, which explains why it terminated (otherwise it just hangs). This was an interactive run on one node of the cluster.

Cheers,

Martin

Revision history for this message
Stefan Prestel (prestel) said :
#8

Hi Martin,

Thanks, that was helpful. It turns out that the name of the LHEF from which Pythia8 should read is incorrectly set in the Pythia card. That's why Pythia stalls - it waits for the file to arrive.

Olivier+Valentin, we should have a chat about this - I think it might be an issue in the code that writes the card.

Thanks, Martin, for finding this effect! We'll get back to you soon.

Cheers,
Stefan

Revision history for this message
Valentin Hirschi (valentin-hirschi) said :
#9

I could run the shower fine from the directories you sent, so the issue must somehow me related to your Pythia8 setup.

Could you try again to shower but this time turning off the parallelization (by setting the MG5aMC option 'nb_core' to 1).
If it fails again, you should be able to go to your '<PROCESS_OUTPUT>/Events/run_<xx>' directory and run the shower manually by executing:

'./run_shower.sh'

If it crashes again similarly, could you try to unzip the file 'unweighted_events.lhe.gz' and then change the following in the 'tag_<xx>_pythia8.cmd' card of your directory:

!
! Definition of subrun 0
!
Beams:LHEF=unweighted_events.lhe.gz

->

!
! Definition of subrun 0
!
Beams:LHEF=unweighted_events.lhe

Let us know if this helps.

Revision history for this message
Martin (martin-white) said :
#10

Hi,

Thanks for this. More digging has revealed more issues, but no definite answers:

1) If I try and run run_shower.sh, I get:

/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/HEPTools/MG5aMC_PY8_interface/MG5aMC_PY8_interface: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/HEPTools/MG5aMC_PY8_interface/MG5aMC_PY8_interface)
/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/HEPTools/MG5aMC_PY8_interface/MG5aMC_PY8_interface: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/HEPTools/MG5aMC_PY8_interface/MG5aMC_PY8_interface)

If I change the setting of LD_LIBRARY_PATH in this script to:

export LD_LIBRARY_PATH=/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/HEPTools/lib:$LD_LIBRARY_PATH
/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/HEPTools/MG5aMC_PY8_interface/MG5aMC_PY8_interface tag_1_pythia8_mjw.cmd

I solve the problem. So one issue might be that the script syntax isn't safe for all systems.

2) I then tried unzipping the zipped lhe file, and running on it directly. This works fine (if I use the above script modification).

3) If I try turning off parallelisation by using ./bin/generate_events --nb_core=1, I get the error above (i.e. the script apparently isn't setting the LD_LIBRARY_PATH path properly).

Cheers,

Martin

Revision history for this message
Valentin Hirschi (valentin-hirschi) said :
#11

Thanks for your feedback.

1) What was the original line? When you say that it isn't safe for all systems, you refer to the quotes?
We have indeed realized that this needs to be fixed and it will be so in the next release.
In the meantime, if you can pre-emptively put the path to 'HEPTools' already in your LD_LIBRARY_PATH and MG5aMC should normally then remove this problematic preamble.

2) You mean that it would still not work with the gzipped file but it then works if you unzip it and change the target in the PY8 cmd file? If so then this is likely to be a problem of your zlib installation.
I suggest that you install zlib with MG5aMC directly with

MG5_aMC> install zlib

the corresponding library will be placed along with the others in <path_to_HEPTools>/lib, so once you'll have added that first in your LD_LIBRARY_PATH (as suggested in step 1) it should be picked up at runtime and solve the problem.

3) Parallelization won't work because of the bug in the writing of the preamble in the run_showers.py used to steer the parallelization. However, the fix suggested in step 1 (direct modification of LD_LIBRARY_PATH by yourself) should solve the issue.

Let me know

Revision history for this message
Valentin Hirschi (valentin-hirschi) said :
#12

I forgot stress that what you should place *in front* of your LD_LIBRARY_PATH (DYLD_LIBRARY_PATH on macs) is:

LD_LIBRARY_PATH=<path_to_HEPTools_directory>/lib:$LD_LIBRARY_PATH

where '<path_to_HEPTools_directory>' refers in your case to '/imports/data/martin/InterferenceJobs/MG5_aMC_v2_5_1/HEPTools'.

Can you help with this problem?

Provide an answer of your own, or ask Martin for more information if necessary.

To post a message you must log in.