Crash when running madevent

Bug #2025061 reported by Nick Smith
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MadGraph5_aMC@NLO
New
Undecided
Unassigned

Bug Description

Hi all,

Hopefully it is fine that I turn this unanswered question into a bug report, as it appears to be a genuine bug in v3.4.2 that I also see.
Quoted question below:

Hi,

I am running Madgraph 3.4.2 on Ubuntu 22.04 and it is working well.

Here I take p p > e e as an example, it works if I generate p p > e e and launch inside Madgraph. However, if I want to run the madevent inside the process folder, it gives me some Python error, see below

$ ./ppee/bin/madevent
launch in debug mode
************************************************************
* *
* W E L C O M E to *
* M A D G R A P H 5 _ a M C @ N L O *
* M A D E V E N T *
* *
* * * *
* * * * * *
* * * * * 5 * * * * *
* * * * * *
* * * *
* *
* VERSION 3.4.2 2023-01-20 *
* *
* The MadGraph5_aMC@NLO Development Team - Find us at *
* https://server06.fynu.ucl.ac.be/projects/madgraph *
* *
* Type 'help' for in-line help. *
* *
************************************************************
Traceback (most recent call last):
  File "/home/yang/work/MG5_aMC_v3_4_2/bin/./ppee/bin/madevent", line 200, in <module>
    cmd_line = cmd_interface.MadEventCmdShell(force_run=True)
  File "/home/yang/work/MG5_aMC_v3_4_2/bin/ppee/bin/internal/madevent_interface.py", line 2091, in __init__
    CmdExtended.__init__(self, me_dir, options, *completekey, **stdin)
  File "/home/yang/work/MG5_aMC_v3_4_2/bin/ppee/bin/internal/madevent_interface.py", line 206, in __init__
    super(CmdExtended, self).__init__(me_dir, options, *arg, **opt)
  File "/home/yang/work/MG5_aMC/madgraph/interface/common_run_interface.py", line 690, in __init__
    if os.path.isabs(me_dir):
  File "/usr/lib/python3.10/posixpath.py", line 62, in isabs
    s = os.fspath(s)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Revision history for this message
Nick Smith (ncsmith-cern) wrote (last edit ):

I encountered this when trying to reweight some already-generated events with `./bin/madevent reweight run_01` inside the output directory. I can paste a full reproducer here if the above case is not enough.

To try investigating myself, I added some printouts on line 687 of common_run_interface, and found that MADEVENT is False so it never picks up the `root_path` which for me was set seemingly correctly `/usr/local/venv/MG5_aMC`

Revision history for this message
Yang Ma (mayangluon) wrote :

Hi Nick,

Thanks for touching base.

I have not tried other versions of Madgraph to reproduce it. Have you tried if this bug is also in other versions, e.g. v3.4.1? Or I will test it later.

Best,
Yang

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi,

I have tried with the latest LTS and the latest development version (3.5.1).
And in none of them, I faced the issue.

I guess that the issue is not in the version of MG5aMC but rather in the way you have installed it.
If you have MADEVENT set to False this means that the command "import madgraph" is working (while it is suppose to crash if you run from the process directory).

So I guess that the issue is that you have installed MG5aMC in a way to have it within the PYTHONPATH.
(or rather that you have edited your pythonpath to allow "import madgraph" to always work).

> so it never picks up the `root_path` which for me was set seemingly correctly `/usr/local/venv/MG5_aMC`

No this root_path is actually not correct since in your case the file read is in
/usr/local/venv/MG5_aMC/madgraph/interface/common_run_interface.py

while I would expect that when running ./bin/madevent the file read would be
./bin/internal/common_run_interface.py
and the correct root_path in that case being
./
which can be set to me_dir.

So my suggestion would be to remove /usr/local/venv/MG5_aMC from the PYTHONPATH.
(or never run something from the ./bin directory of the generated process)

Cheers,

Olivier

Revision history for this message
Nick Smith (ncsmith-cern) wrote :

Thanks Olivier for the explanation. After removing MG5aMC from PYTHONPATH the `bin/madevent` executable in the process area now works.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.