Madevent fails

Asked by Dyson Kennedy

Hello,
I am working on a cluster using ubuntu 20.04, ROOT6.30.06, and madgraph v3.6.0. I have a virtual python environment using python 3.11.7
I have been working on getting madgraph to work again after the cluster updated. I can run ROOT and ./bin/mg5_aMC just fine. I can generate events manually there. However, after generating a process and trying to generate events through that script, I get the following

```
(venv2) dkennedy_umass_edu@login1:~/LNV/MG5_aMC_v3_5_4$ /work/pi_mjrm_umass_edu/LNV_collider/Generated/LNVF/bin/madevent ./MyFiles/LFVLNV/GenerationFiles/LNVF_run.dat
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.6.0 2024-09-30 *
* *
* 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 "/work/pi_mjrm_umass_edu/LNV_collider/Generated/LNVF/bin/madevent", line 199, in <module>
    cmd_line = launch_interface(force_run=True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/pi_mjrm_umass_edu/LNV_collider/Generated/LNVF/bin/internal/madevent_interface.py", line 2089, in __init__
    CmdExtended.__init__(self, me_dir, options, *completekey, **stdin)
  File "/work/pi_mjrm_umass_edu/LNV_collider/Generated/LNVF/bin/internal/madevent_interface.py", line 205, in __init__
    super(CmdExtended, self).__init__(me_dir, options, *arg, **opt)
  File "/home/dkennedy_umass_edu/LNV/MG5_aMC_v3_5_4/madgraph/interface/common_run_interface.py", line 707, in __init__
    if os.path.isabs(me_dir):
       ^^^^^^^^^^^^^^^^^^^^^
  File "<frozen posixpath>", line 62, in isabs
TypeError: expected str, bytes or os.PathLike object, not NoneType
```
I haven't found similar situation on the forum so far. The closest to my situation that I've found is:
https://stackoverflow.com/questions/75792995/how-to-fix-typeerror-expected-str-bytes-or-os-pathlike-object-not-nonetype
however, unlike in the link the files in my error are not ones I've edited or anything. So i don't want to remove `import os` from madevent_interface.py or common_run_interface.py unless someone more knowledgeable tells me that that is an ok thing to do.

Thanks,
Dyson

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Dyson Kennedy
Solved:
Last query:
Last reply:
Revision history for this message
Sihyun Jeon (shjeon) said (last edit ):
#1

what is the content of ./MyFiles/LFVLNV/GenerationFiles/LNVF_run.dat
normally you would just execute madevent without any other file plugged in

Revision history for this message
Dyson Kennedy (dysontravis) said :
#2

Thanks for your response. Here's the content:

```
generate_events

shower=Pythia8
detector=Delphes

set use_syst False

set MF1 1000
set MS1 1500
set MS2 1500
set ge 0.1
set gqd 0.1
set gqu 0.0

set WS1 Auto
set WS2 Auto
set WF1 Auto

set xqcut 20
set ptj 20
set ptb 20
set ptl 20
set etaj 2.8
set etal 2.5
set ebeam1 7000
set ebeam2 7000
set nevents 600
set iseed 1

set JetMatching:nJetMax 3
```

Revision history for this message
Dyson Kennedy (dysontravis) said :
#3

I believe I fixed it by making the command be totally absolute paths.
`/work/pi_mjrm_umass_edu/LNV_collider/Generated/LNVF/bin/madevent
 /home/dkennedy_umass_edu/LNV/MG5_aMC_v3_5_4/MyFiles/LFVLNV/GenerationFiles/LNVF_run.dat`

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#4

So the exact issue here is that you launch from the madgraph directory, an executable which is in the local directory.
And the code is confused if he has to be running the madgraph code or the madevent code.

Not sure how to fix that in a clean way, what I will do is to detect in madevent if madgraph is in the pythonpath and put a clean crash with useful information.

So the code runs like this:

Running MG5 in debug mode
ERROR: Looks like you do have madgraph in your PYTHONPATH (or you run this executable from the main MG5aMC directory). This executable will likely not work in such case.
************************************************************
* *
* 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 2.9.21 2024-09-26 *
* *
* 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 "/Users/omattelaer/Documents/git_workspace/LTS/./PROC_sm_87/bin/madevent", line 212, in <module>
    cmd_line = cmd_interface.MadEventCmdShell(force_run=True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/omattelaer/Documents/git_workspace/LTS/PROC_sm_87/bin/internal/madevent_interface.py", line 2110, in __init__
    CmdExtended.__init__(self, me_dir, options, *completekey, **stdin)
  File "/Users/omattelaer/Documents/git_workspace/LTS/PROC_sm_87/bin/internal/madevent_interface.py", line 206, in __init__
    super(CmdExtended, self).__init__(me_dir, options, *arg, **opt)
  File "/Users/omattelaer/Documents/git_workspace/LTS/madgraph/interface/common_run_interface.py", line 643, in __init__
    if os.path.isabs(me_dir):
       ^^^^^^^^^^^^^^^^^^^^^
  File "<frozen posixpath>", line 62, in isabs
TypeError: expected str, bytes or os.PathLike object, not NoneType

Thanks,

Olivier

PS: change are here: https://github.com/mg5amcnlo/mg5amcnlo/commit/a90385c0afeaa3300f998f9949e84f1c2aacbf95

Revision history for this message
Dyson Kennedy (dysontravis) said :
#5

Thanks Olivier!
I've been able to get it running with `/work/pi_mjrm_umass_edu/LNV_collider/Generated/LNVF/bin/madevent
 /home/dkennedy_umass_edu/LNV/MG5_aMC_v3_5_4/MyFiles/LFVLNV/GenerationFiles/LNVF_run.dat` as well.