ImportError : No module named allmatrix2py

Asked by Roberto Franceschini

I am trying reweghting cards according to the pp>e+e- example
https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Reweight#ppee-cross-section
I am 2.7.2 and the generation of events is fine but the reweighting is not going through
```
Command "generate_events run_01" interrupted with error:
ImportError : No module named allmatrix2py
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/home/roberto/cernbox/Clusters/MG5_aMC_v2_7_2/ReweightTest/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
```
This module does not exist and I cannot import it from python 2.7.5 ipython console. I have tried to install it but is not on pip, should I find it somewhere in the MG5 source?

The only seemingly relevant file I can find are
./ReweightTest/rw_me/SubProcesses/allmatrix2py.cpython-37m-x86_64-linux-gnu.so
./ReweightTest/rw_me/SubProcesses/allmatrix3py.cpython-37m-x86_64-linux-gnu.so
but I am not sure it is the one intended to be imported.

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Roberto Franceschini (franceschini-roberto) said :
#1

It it probably worth mentioning that in MG 2.6.0 I do not get this module-related error. I just tried it out and it gets stuck, but with no errors.
It just stays for indefinitely on
INFO: Idle: 0, Running: 3, Completed: 1 [ 4.4s ]
after this output
```
urrent estimate of cross-section: 843.0 +- 2.13216029416
    P1_qq_ll
INFO: Idle: 0, Running: 0, Completed: 0 [ current time: 13h29 ]
INFO: Combining runs
INFO: finish refine
INFO: Combining Events
  === Results Summary for run: run_01 tag: tag_1 ===

     Cross-section : 843 +- 2.132 pb
     Nb of events : 10000

INFO: No version of lhapdf. Can not run systematics computation
store_events
INFO: Storing parton level results
INFO: End Parton
reweight -from_cards
INFO: split the event file in bunch of 2500 events
INFO: Idle: 4, Running: 0, Completed: 0 [ current time: 13h30 ]
INFO: Idle: 0, Running: 3, Completed: 1 [ 4.4s ]
```

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

HI Roberto,

This is a python module which is created by madgraph on the flight.
So this one is related to your UFO model and process that you are using.
So indeed this is not installable via pip.

> ./ReweightTest/rw_me/SubProcesses/allmatrix2py.cpython-37m-x86_64-linux-gnu.so
> ./ReweightTest/rw_me/SubProcesses/allmatrix3py.cpython-37m-x86_64-linux-gnu.so

This is indeed the library that we need to load as a python module.
However this library was created for python3.7 and since you are stating that you used MG5aMC,
you likely need to create it for python2.7 (or python2.6).

This likely means that your version of "f2py" by default is the one of python3 and not the one of python2.
The easiest fix is to go to 2.8.0 where we support (and this is the default) python3.
Otherwise you will need to specify the path to f2py executable related to python2.

Cheers,

Olivier

> On 10 Sep 2020, at 19:10, Roberto Franceschini <email address hidden> wrote:
>
> New question #692855 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/692855
>
> I am trying reweghting cards according to the pp>e+e- example
> https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Reweight#ppee-cross-section
> I am 2.7.2 and the generation of events is fine but the reweighting is not going through
> ```
> Command "generate_events run_01" interrupted with error:
> ImportError : No module named allmatrix2py
> Please report this bug on https://bugs.launchpad.net/mg5amcnlo
> More information is found in '/home/roberto/cernbox/Clusters/MG5_aMC_v2_7_2/ReweightTest/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
> ```
> This module does not exist and I cannot import it from python 2.7.5 ipython console. I have tried to install it but is not on pip, should I find it somewhere in the MG5 source?
>
> The only seemingly relevant file I can find are
> ./ReweightTest/rw_me/SubProcesses/allmatrix2py.cpython-37m-x86_64-linux-gnu.so
> ./ReweightTest/rw_me/SubProcesses/allmatrix3py.cpython-37m-x86_64-linux-gnu.so
> but I am not sure it is the one intended to be imported.
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Roberto Franceschini (franceschini-roberto) said :
#3

Hello! thanks for looking into this!

I have tried 2.8.0 and still complains, about something else.

Command "generate_events run_01" interrupted with error:
ModuleNotFoundError : No module named 'P1_uux_epem2py'
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in
'/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/ReweightTest/run_01_tag_1_debug.log'.
Please attach this file to your report.

I have done some tests with 2_7_2 as well by adding the path to f2py, but
that too sitll does not work. Maybe better if we focus on having 2.8.0 work?

On Thu, Sep 10, 2020 at 11:45 PM Olivier Mattelaer <
<email address hidden>> wrote:

> Your question #692855 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/692855
>
> Status: Open => Answered
>
> Olivier Mattelaer proposed the following answer:
> HI Roberto,
>
> This is a python module which is created by madgraph on the flight.
> So this one is related to your UFO model and process that you are using.
> So indeed this is not installable via pip.
>
> > ./ReweightTest/rw_me/SubProcesses/
> allmatrix2py.cpython-37m-x86_64-linux-gnu.so
> > ./ReweightTest/rw_me/SubProcesses/
> allmatrix3py.cpython-37m-x86_64-linux-gnu.so
>
> This is indeed the library that we need to load as a python module.
> However this library was created for python3.7 and since you are stating
> that you used MG5aMC,
> you likely need to create it for python2.7 (or python2.6).
>
> This likely means that your version of "f2py" by default is the one of
> python3 and not the one of python2.
> The easiest fix is to go to 2.8.0 where we support (and this is the
> default) python3.
> Otherwise you will need to specify the path to f2py executable related to
> python2.
>
>
> Cheers,
>
> Olivier
>
> > On 10 Sep 2020, at 19:10, Roberto Franceschini <
> <email address hidden>> wrote:
> >
> > New question #692855 on MadGraph5_aMC@NLO:
> > https://answers.launchpad.net/mg5amcnlo/+question/692855
> >
> > I am trying reweghting cards according to the pp>e+e- example
> >
> https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Reweight#ppee-cross-section
> > I am 2.7.2 and the generation of events is fine but the reweighting is
> not going through
> > ```
> > Command "generate_events run_01" interrupted with error:
> > ImportError : No module named allmatrix2py
> > Please report this bug on https://bugs.launchpad.net/mg5amcnlo
> > More information is found in
> '/home/roberto/cernbox/Clusters/MG5_aMC_v2_7_2/ReweightTest/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
> > ```
> > This module does not exist and I cannot import it from python 2.7.5
> ipython console. I have tried to install it but is not on pip, should I
> find it somewhere in the MG5 source?
> >
> > The only seemingly relevant file I can find are
> > ./ReweightTest/rw_me/SubProcesses/
> allmatrix2py.cpython-37m-x86_64-linux-gnu.so
> > ./ReweightTest/rw_me/SubProcesses/
> allmatrix3py.cpython-37m-x86_64-linux-gnu.so
> > but I am not sure it is the one intended to be imported.
> >
> >
> > --
> > You received this question notification because you are an answer
> > contact for MadGraph5_aMC@NLO.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/mg5amcnlo/+question/692855/+confirm?answer_id=1
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/mg5amcnlo/+question/692855
>
> You received this question notification because you asked the question.
>

Revision history for this message
Roberto Franceschini (franceschini-roberto) said :
#4

#************************************************************
#* MadGraph5_aMC@NLO/MadEvent *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 2.8.0 2020-08-21 *
#* *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
#* *
#* Command File for MadEvent *
#* *
#* run as ./bin/madevent.py filename *
#* *
#************************************************************
generate_events run_01
Traceback (most recent call last):
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1541, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1490, in onecmd_orig
    return func(arg, **opt)
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/madevent_interface.py", line 2471, in do_generate_events
    self.run_generate_events(switch_mode, args)
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/common_run_interface.py", line 7062, in new_fct
    original_fct(obj, *args, **opts)
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/madevent_interface.py", line 2569, in run_generate_events
    self.exec_cmd('reweight -from_cards', postcmd=False)
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1570, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1490, in onecmd_orig
    return func(arg, **opt)
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/common_run_interface.py", line 2172, in do_reweight
    reweight_cmd.import_command_file(path)
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1687, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1570, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1490, in onecmd_orig
    return func(arg, **opt)
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/various/misc.py", line 108, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/reweight_interface.py", line 505, in do_launch
    self.load_module()
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/reweight_interface.py", line 1806, in load_module
    mymod = __import__(mod_name, globals(), locals(), [])
  File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/ReweightTest/rw_me/SubProcesses/allmatrix2py.py", line 1, in <module>
    from P1_uux_epem2py import *
ModuleNotFoundError: No module named 'P1_uux_epem2py'
                              Run Options
                              -----------
               stdout_level : 20 (user set)

                         MadEvent Options
                         ----------------
     automatic_html_opening : False (user set)
        notification_center : True
                   run_mode : 2
              cluster_queue : None (user set)
               cluster_time : None (user set)
               cluster_size : 100
             cluster_memory : 100 (user set)
                    nb_core : 48 (user set)
          cluster_temp_path : None

                      Configuration Options
                      ---------------------
               pythia8_path : None (user set)
                  hwpp_path : None (user set)
                thepeg_path : None (user set)
                 hepmc_path : None (user set)
           madanalysis_path : None (user set)
          madanalysis5_path : None (user set)
            pythia-pgs_path : None (user set)
                    td_path : None (user set)
               delphes_path : None (user set)
        exrootanalysis_path : None (user set)
               syscalc_path : None (user set)
                     lhapdf : lhapdf-config
                 lhapdf_py2 : None
                 lhapdf_py3 : None
                    timeout : 60
              f2py_compiler : None
          f2py_compiler_py2 : None
          f2py_compiler_py3 : None
                web_browser : None
                 eps_viewer : None
                text_editor : None
           fortran_compiler : None
               cpp_compiler : None
                auto_update : 7 (user set)
               cluster_type : condor
      cluster_status_update : (600, 30)
           cluster_nb_retry : 1
         cluster_local_path : None
         cluster_retry_wait : 300
#************************************************************
#* MadGraph5_aMC@NLO *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 2.8.0 2020-08-21 *
#* *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
#* *
#* Command File for MadGraph5_aMC@NLO *
#* *
#* run as ./bin/mg5_aMC filename *
#* *
#************************************************************
set group_subprocesses Auto
set ignore_six_quark_processes False
set low_mem_multicore_nlo_generation False
set complex_mass_scheme False
set gauge unitary
set loop_optimized_output True
set loop_color_flows False
set max_npoint_for_channel 0
set default_unset_couplings 99
set max_t_for_channel 99
set zerowidth_tchannel True
import model sm
define p = g u c d s u~ c~ d~ s~
define j = g u c d s u~ c~ d~ s~
define l+ = e+ mu+
define l- = e- mu-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
generate p p > e+ e-
output ReweightTest
######################################################################
## PARAM_CARD AUTOMATICALY GENERATED BY MG5 FOLLOWING UFO MODEL ####
######################################################################
## ##
## Width set on Auto will be computed following the information ##
## present in the decay.py files of the model. ##
## See arXiv:1402.1178 for more details. ##
## ##
######################################################################

###################################
## INFORMATION FOR MASS
###################################
Block mass
    5 4.700000e+00 # MB
    6 1.730000e+02 # MT
   15 1.777000e+00 # MTA
   23 9.118800e+01 # MZ
   25 1.250000e+02 # MH
## Dependent parameters, given by model restrictions.
## Those values should be edited following the
## analytical expression. MG5 ignores those values
## but they are important for interfacing the output of MG5
## to external program such as Pythia.
  1 0.000000e+00 # d : 0.0
  2 0.000000e+00 # u : 0.0
  3 0.000000e+00 # s : 0.0
  4 0.000000e+00 # c : 0.0
  11 0.000000e+00 # e- : 0.0
  12 0.000000e+00 # ve : 0.0
  13 0.000000e+00 # mu- : 0.0
  14 0.000000e+00 # vm : 0.0
  16 0.000000e+00 # vt : 0.0
  21 0.000000e+00 # g : 0.0
  22 0.000000e+00 # a : 0.0
  24 8.041900e+01 # w+ : cmath.sqrt(MZ__exp__2/2. + cmath.sqrt(MZ__exp__4/4. - (aEW*cmath.pi*MZ__exp__2)/(Gf*sqrt__2)))

###################################
## INFORMATION FOR SMINPUTS
###################################
Block sminputs
    1 1.325070e+02 # aEWM1
    2 1.166390e-05 # Gf
    3 1.180000e-01 # aS

###################################
## INFORMATION FOR YUKAWA
###################################
Block yukawa
    5 4.700000e+00 # ymb
    6 1.730000e+02 # ymt
   15 1.777000e+00 # ymtau

###################################
## INFORMATION FOR DECAY
###################################
DECAY 6 1.491500e+00 # WT
DECAY 23 2.441404e+00 # WZ
DECAY 24 2.047600e+00 # WW
DECAY 25 6.382339e-03 # WH
## Dependent parameters, given by model restrictions.
## Those values should be edited following the
## analytical expression. MG5 ignores those values
## but they are important for interfacing the output of MG5
## to external program such as Pythia.
DECAY 1 0.000000e+00 # d : 0.0
DECAY 2 0.000000e+00 # u : 0.0
DECAY 3 0.000000e+00 # s : 0.0
DECAY 4 0.000000e+00 # c : 0.0
DECAY 5 0.000000e+00 # b : 0.0
DECAY 11 0.000000e+00 # e- : 0.0
DECAY 12 0.000000e+00 # ve : 0.0
DECAY 13 0.000000e+00 # mu- : 0.0
DECAY 14 0.000000e+00 # vm : 0.0
DECAY 15 0.000000e+00 # ta- : 0.0
DECAY 16 0.000000e+00 # vt : 0.0
DECAY 21 0.000000e+00 # g : 0.0
DECAY 22 0.000000e+00 # a : 0.0
#*********************************************************************
# MadGraph5_aMC@NLO *
# *
# run_card.dat MadEvent *
# *
# This file is used to set the parameters of the run. *
# *
# Some notation/conventions: *
# *
# Lines starting with a '# ' are info or comments *
# *
# mind the format: value = variable ! comment *
# *
# To display more options, you can type the command: *
# update full_run_card *
#*********************************************************************
#
#*********************************************************************
# Tag name for the run (one word) *
#*********************************************************************
  tag_1 = run_tag ! name of the run
#*********************************************************************
# Number of events and rnd seed *
# Warning: Do not generate more than 1M events in a single run *
#*********************************************************************
  10000 = nevents ! Number of unweighted events requested
  0 = iseed ! rnd seed (0=assigned automatically=default))
#*********************************************************************
# Collider type and energy *
# lpp: 0=No PDF, 1=proton, -1=antiproton, 2=photon from proton, *
# 3=photon from electron, 4=photon from muon *
#*********************************************************************
     1 = lpp1 ! beam 1 type
     1 = lpp2 ! beam 2 type
     6500.0 = ebeam1 ! beam 1 total energy in GeV
     6500.0 = ebeam2 ! beam 2 total energy in GeV
# To see polarised beam options: type "update beam_pol"

#*********************************************************************
# PDF CHOICE: this automatically fixes also alpha_s and its evol. *
#*********************************************************************
     nn23lo1 = pdlabel ! PDF set
     230000 = lhaid ! if pdlabel=lhapdf, this is the lhapdf number
# To see heavy ion options: type "update ion_pdf"
#*********************************************************************
# Renormalization and factorization scales *
#*********************************************************************
 False = fixed_ren_scale ! if .true. use fixed ren scale
 False = fixed_fac_scale ! if .true. use fixed fac scale
 91.188 = scale ! fixed ren scale
 91.188 = dsqrt_q2fact1 ! fixed fact scale for pdf1
 91.188 = dsqrt_q2fact2 ! fixed fact scale for pdf2
 -1 = dynamical_scale_choice ! Choose one of the preselected dynamical choices
 1.0 = scalefact ! scale factor for event-by-event scales
#*********************************************************************
# Type and output format
#*********************************************************************
  False = gridpack !True = setting up the grid pack
  -1.0 = time_of_flight ! threshold (in mm) below which the invariant livetime is not written (-1 means not written)
  average = event_norm ! average/sum. Normalization of the weight in the LHEF
# To see MLM/CKKW merging options: type "update MLM" or "update CKKW"

#*********************************************************************
#
#*********************************************************************
# handling of the helicities:
# 0: sum over all helicities
# 1: importance sampling over helicities
#*********************************************************************
   0 = nhel ! using helicities importance sampling or not.
#*********************************************************************
# Generation bias, check the wiki page below for more information: *
# 'cp3.irmp.ucl.ac.be/projects/madgraph/wiki/LOEventGenerationBias' *
#*********************************************************************
 None = bias_module ! Bias type of bias, [None, ptj_bias, -custom_folder-]
 {} = bias_parameters ! Specifies the parameters of the module.
#
#*******************************
# Parton level cuts definition *
#*******************************
#
#
#*********************************************************************
# BW cutoff (M+/-bwcutoff*Gamma) ! Define on/off-shell for "$" and decay
#*********************************************************************
  15.0 = bwcutoff ! (M+/-bwcutoff*Gamma)
#*********************************************************************
# Standard Cuts *
#*********************************************************************
# Minimum and maximum pt's (for max, -1 means no cut) *
#*********************************************************************
 10.0 = ptl ! minimum pt for the charged leptons
 -1.0 = ptlmax ! maximum pt for the charged leptons
 {} = pt_min_pdg ! pt cut for other particles (use pdg code). Applied on particle and anti-particle
 {} = pt_max_pdg ! pt cut for other particles (syntax e.g. {6: 100, 25: 50})
#
# For display option for energy cut in the partonic center of mass frame type 'update ecut'
#
#*********************************************************************
# Maximum and minimum absolute rapidity (for max, -1 means no cut) *
#*********************************************************************
 2.5 = etal ! max rap for the charged leptons
 0.0 = etalmin ! main rap for the charged leptons
 {} = eta_min_pdg ! rap cut for other particles (use pdg code). Applied on particle and anti-particle
 {} = eta_max_pdg ! rap cut for other particles (syntax e.g. {6: 2.5, 23: 5})
#*********************************************************************
# Minimum and maximum DeltaR distance *
#*********************************************************************
 0.4 = drll ! min distance between leptons
 -1.0 = drllmax ! max distance between leptons
#*********************************************************************
# Minimum and maximum invariant mass for pairs *
#*********************************************************************
 0.0 = mmll ! min invariant mass of l+l- (same flavour) lepton pair
 -1.0 = mmllmax ! max invariant mass of l+l- (same flavour) lepton pair
 {} = mxx_min_pdg ! min invariant mass of a pair of particles X/X~ (e.g. {6:250})
 {'default': False} = mxx_only_part_antipart ! if True the invariant mass is applied only
                       ! to pairs of particle/antiparticle and not to pairs of the same pdg codes.
 #*********************************************************************
 # Minimum and maximum invariant mass for all letpons *
 #*********************************************************************
 0.0 = mmnl ! min invariant mass for all letpons (l+- and vl)
 -1.0 = mmnlmax ! max invariant mass for all letpons (l+- and vl)
 #*********************************************************************
 # Minimum and maximum pt for 4-momenta sum of leptons / neutrino *
 # for pair of lepton includes only same flavor, opposite charge
 #*********************************************************************
 0.0 = ptllmin ! Minimum pt for 4-momenta sum of leptons(l and vl)
 -1.0 = ptllmax ! Maximum pt for 4-momenta sum of leptons(l and vl)
#*********************************************************************
# Inclusive cuts *
#*********************************************************************
 0.0 = xptl ! minimum pt for at least one charged lepton
 #*********************************************************************
 # Control the pt's of leptons sorted by pt *
 #*********************************************************************
 0.0 = ptl1min ! minimum pt for the leading lepton in pt
 0.0 = ptl2min ! minimum pt for the second lepton in pt
 -1.0 = ptl1max ! maximum pt for the leading lepton in pt
 -1.0 = ptl2max ! maximum pt for the second lepton in pt
#*********************************************************************
# maximal pdg code for quark to be considered as a light jet *
# (otherwise b cuts are applied) *
#*********************************************************************
 4 = maxjetflavor ! Maximum jet pdg code
#*********************************************************************
#
#*********************************************************************
# Store info for systematics studies *
# WARNING: Do not use for interference type of computation *
#*********************************************************************
   True = use_syst ! Enable systematics studies
#
systematics = systematics_program ! none, systematics [python], SysCalc [depreceted, C++]
['--mur=0.5,1,2', '--muf=0.5,1,2', '--pdf=errorset'] = systematics_arguments ! see: https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Systematics#Systematicspythonmodule
# Syscalc is deprecated but to see the associate options type'update syscalc'

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

What happens if you do

cd /home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/ReweightTest/rw_me/SubProcesses/
make allmatrix2py.so
ls
f2py --version
python3
import allmatrix2py

Cheers,

Olivier

> On 11 Sep 2020, at 14:41, Roberto Franceschini <email address hidden> wrote:
>
> Question #692855 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/692855
>
> Roberto Franceschini gave more information on the question:
> #************************************************************
> #* MadGraph5_aMC@NLO/MadEvent *
> #* *
> #* * * *
> #* * * * * *
> #* * * * * 5 * * * * *
> #* * * * * *
> #* * * *
> #* *
> #* *
> #* VERSION 2.8.0 2020-08-21 *
> #* *
> #* The MadGraph5_aMC@NLO Development Team - Find us at *
> #* https://server06.fynu.ucl.ac.be/projects/madgraph *
> #* *
> #************************************************************
> #* *
> #* Command File for MadEvent *
> #* *
> #* run as ./bin/madevent.py filename *
> #* *
> #************************************************************
> generate_events run_01
> Traceback (most recent call last):
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1541, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1490, in onecmd_orig
> return func(arg, **opt)
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/madevent_interface.py", line 2471, in do_generate_events
> self.run_generate_events(switch_mode, args)
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/common_run_interface.py", line 7062, in new_fct
> original_fct(obj, *args, **opts)
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/madevent_interface.py", line 2569, in run_generate_events
> self.exec_cmd('reweight -from_cards', postcmd=False)
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1570, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1490, in onecmd_orig
> return func(arg, **opt)
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/common_run_interface.py", line 2172, in do_reweight
> reweight_cmd.import_command_file(path)
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1687, in import_command_file
> self.exec_cmd(line, precmd=True)
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1570, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/extended_cmd.py", line 1490, in onecmd_orig
> return func(arg, **opt)
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/various/misc.py", line 108, in f_with_no_logger
> out = f(self, *args, **opt)
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/reweight_interface.py", line 505, in do_launch
> self.load_module()
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/madgraph/interface/reweight_interface.py", line 1806, in load_module
> mymod = __import__(mod_name, globals(), locals(), [])
> File "/home/roberto/cernbox/Clusters/MG5_aMC_v2_8_0/ReweightTest/rw_me/SubProcesses/allmatrix2py.py", line 1, in <module>
> from P1_uux_epem2py import *
> ModuleNotFoundError: No module named 'P1_uux_epem2py'
> Run Options
> -----------
> stdout_level : 20 (user set)
>
> MadEvent Options
> ----------------
> automatic_html_opening : False (user set)
> notification_center : True
> run_mode : 2
> cluster_queue : None (user set)
> cluster_time : None (user set)
> cluster_size : 100
> cluster_memory : 100 (user set)
> nb_core : 48 (user set)
> cluster_temp_path : None
>
> Configuration Options
> ---------------------
> pythia8_path : None (user set)
> hwpp_path : None (user set)
> thepeg_path : None (user set)
> hepmc_path : None (user set)
> madanalysis_path : None (user set)
> madanalysis5_path : None (user set)
> pythia-pgs_path : None (user set)
> td_path : None (user set)
> delphes_path : None (user set)
> exrootanalysis_path : None (user set)
> syscalc_path : None (user set)
> lhapdf : lhapdf-config
> lhapdf_py2 : None
> lhapdf_py3 : None
> timeout : 60
> f2py_compiler : None
> f2py_compiler_py2 : None
> f2py_compiler_py3 : None
> web_browser : None
> eps_viewer : None
> text_editor : None
> fortran_compiler : None
> cpp_compiler : None
> auto_update : 7 (user set)
> cluster_type : condor
> cluster_status_update : (600, 30)
> cluster_nb_retry : 1
> cluster_local_path : None
> cluster_retry_wait : 300
> #************************************************************
> #* MadGraph5_aMC@NLO *
> #* *
> #* * * *
> #* * * * * *
> #* * * * * 5 * * * * *
> #* * * * * *
> #* * * *
> #* *
> #* *
> #* VERSION 2.8.0 2020-08-21 *
> #* *
> #* The MadGraph5_aMC@NLO Development Team - Find us at *
> #* https://server06.fynu.ucl.ac.be/projects/madgraph *
> #* *
> #************************************************************
> #* *
> #* Command File for MadGraph5_aMC@NLO *
> #* *
> #* run as ./bin/mg5_aMC filename *
> #* *
> #************************************************************
> set group_subprocesses Auto
> set ignore_six_quark_processes False
> set low_mem_multicore_nlo_generation False
> set complex_mass_scheme False
> set gauge unitary
> set loop_optimized_output True
> set loop_color_flows False
> set max_npoint_for_channel 0
> set default_unset_couplings 99
> set max_t_for_channel 99
> set zerowidth_tchannel True
> import model sm
> define p = g u c d s u~ c~ d~ s~
> define j = g u c d s u~ c~ d~ s~
> define l+ = e+ mu+
> define l- = e- mu-
> define vl = ve vm vt
> define vl~ = ve~ vm~ vt~
> generate p p > e+ e-
> output ReweightTest
> ######################################################################
> ## PARAM_CARD AUTOMATICALY GENERATED BY MG5 FOLLOWING UFO MODEL ####
> ######################################################################
> ## ##
> ## Width set on Auto will be computed following the information ##
> ## present in the decay.py files of the model. ##
> ## See arXiv:1402.1178 for more details. ##
> ## ##
> ######################################################################
>
> ###################################
> ## INFORMATION FOR MASS
> ###################################
> Block mass
> 5 4.700000e+00 # MB
> 6 1.730000e+02 # MT
> 15 1.777000e+00 # MTA
> 23 9.118800e+01 # MZ
> 25 1.250000e+02 # MH
> ## Dependent parameters, given by model restrictions.
> ## Those values should be edited following the
> ## analytical expression. MG5 ignores those values
> ## but they are important for interfacing the output of MG5
> ## to external program such as Pythia.
> 1 0.000000e+00 # d : 0.0
> 2 0.000000e+00 # u : 0.0
> 3 0.000000e+00 # s : 0.0
> 4 0.000000e+00 # c : 0.0
> 11 0.000000e+00 # e- : 0.0
> 12 0.000000e+00 # ve : 0.0
> 13 0.000000e+00 # mu- : 0.0
> 14 0.000000e+00 # vm : 0.0
> 16 0.000000e+00 # vt : 0.0
> 21 0.000000e+00 # g : 0.0
> 22 0.000000e+00 # a : 0.0
> 24 8.041900e+01 # w+ : cmath.sqrt(MZ__exp__2/2. + cmath.sqrt(MZ__exp__4/4. - (aEW*cmath.pi*MZ__exp__2)/(Gf*sqrt__2)))
>
> ###################################
> ## INFORMATION FOR SMINPUTS
> ###################################
> Block sminputs
> 1 1.325070e+02 # aEWM1
> 2 1.166390e-05 # Gf
> 3 1.180000e-01 # aS
>
> ###################################
> ## INFORMATION FOR YUKAWA
> ###################################
> Block yukawa
> 5 4.700000e+00 # ymb
> 6 1.730000e+02 # ymt
> 15 1.777000e+00 # ymtau
>
> ###################################
> ## INFORMATION FOR DECAY
> ###################################
> DECAY 6 1.491500e+00 # WT
> DECAY 23 2.441404e+00 # WZ
> DECAY 24 2.047600e+00 # WW
> DECAY 25 6.382339e-03 # WH
> ## Dependent parameters, given by model restrictions.
> ## Those values should be edited following the
> ## analytical expression. MG5 ignores those values
> ## but they are important for interfacing the output of MG5
> ## to external program such as Pythia.
> DECAY 1 0.000000e+00 # d : 0.0
> DECAY 2 0.000000e+00 # u : 0.0
> DECAY 3 0.000000e+00 # s : 0.0
> DECAY 4 0.000000e+00 # c : 0.0
> DECAY 5 0.000000e+00 # b : 0.0
> DECAY 11 0.000000e+00 # e- : 0.0
> DECAY 12 0.000000e+00 # ve : 0.0
> DECAY 13 0.000000e+00 # mu- : 0.0
> DECAY 14 0.000000e+00 # vm : 0.0
> DECAY 15 0.000000e+00 # ta- : 0.0
> DECAY 16 0.000000e+00 # vt : 0.0
> DECAY 21 0.000000e+00 # g : 0.0
> DECAY 22 0.000000e+00 # a : 0.0
> #*********************************************************************
> # MadGraph5_aMC@NLO *
> # *
> # run_card.dat MadEvent *
> # *
> # This file is used to set the parameters of the run. *
> # *
> # Some notation/conventions: *
> # *
> # Lines starting with a '# ' are info or comments *
> # *
> # mind the format: value = variable ! comment *
> # *
> # To display more options, you can type the command: *
> # update full_run_card *
> #*********************************************************************
> #
> #*********************************************************************
> # Tag name for the run (one word) *
> #*********************************************************************
> tag_1 = run_tag ! name of the run
> #*********************************************************************
> # Number of events and rnd seed *
> # Warning: Do not generate more than 1M events in a single run *
> #*********************************************************************
> 10000 = nevents ! Number of unweighted events requested
> 0 = iseed ! rnd seed (0=assigned automatically=default))
> #*********************************************************************
> # Collider type and energy *
> # lpp: 0=No PDF, 1=proton, -1=antiproton, 2=photon from proton, *
> # 3=photon from electron, 4=photon from muon *
> #*********************************************************************
> 1 = lpp1 ! beam 1 type
> 1 = lpp2 ! beam 2 type
> 6500.0 = ebeam1 ! beam 1 total energy in GeV
> 6500.0 = ebeam2 ! beam 2 total energy in GeV
> # To see polarised beam options: type "update beam_pol"
>
> #*********************************************************************
> # PDF CHOICE: this automatically fixes also alpha_s and its evol. *
> #*********************************************************************
> nn23lo1 = pdlabel ! PDF set
> 230000 = lhaid ! if pdlabel=lhapdf, this is the lhapdf number
> # To see heavy ion options: type "update ion_pdf"
> #*********************************************************************
> # Renormalization and factorization scales *
> #*********************************************************************
> False = fixed_ren_scale ! if .true. use fixed ren scale
> False = fixed_fac_scale ! if .true. use fixed fac scale
> 91.188 = scale ! fixed ren scale
> 91.188 = dsqrt_q2fact1 ! fixed fact scale for pdf1
> 91.188 = dsqrt_q2fact2 ! fixed fact scale for pdf2
> -1 = dynamical_scale_choice ! Choose one of the preselected dynamical choices
> 1.0 = scalefact ! scale factor for event-by-event scales
> #*********************************************************************
> # Type and output format
> #*********************************************************************
> False = gridpack !True = setting up the grid pack
> -1.0 = time_of_flight ! threshold (in mm) below which the invariant livetime is not written (-1 means not written)
> average = event_norm ! average/sum. Normalization of the weight in the LHEF
> # To see MLM/CKKW merging options: type "update MLM" or "update CKKW"
>
> #*********************************************************************
> #
> #*********************************************************************
> # handling of the helicities:
> # 0: sum over all helicities
> # 1: importance sampling over helicities
> #*********************************************************************
> 0 = nhel ! using helicities importance sampling or not.
> #*********************************************************************
> # Generation bias, check the wiki page below for more information: *
> # 'cp3.irmp.ucl.ac.be/projects/madgraph/wiki/LOEventGenerationBias' *
> #*********************************************************************
> None = bias_module ! Bias type of bias, [None, ptj_bias, -custom_folder-]
> {} = bias_parameters ! Specifies the parameters of the module.
> #
> #*******************************
> # Parton level cuts definition *
> #*******************************
> #
> #
> #*********************************************************************
> # BW cutoff (M+/-bwcutoff*Gamma) ! Define on/off-shell for "$" and decay
> #*********************************************************************
> 15.0 = bwcutoff ! (M+/-bwcutoff*Gamma)
> #*********************************************************************
> # Standard Cuts *
> #*********************************************************************
> # Minimum and maximum pt's (for max, -1 means no cut) *
> #*********************************************************************
> 10.0 = ptl ! minimum pt for the charged leptons
> -1.0 = ptlmax ! maximum pt for the charged leptons
> {} = pt_min_pdg ! pt cut for other particles (use pdg code). Applied on particle and anti-particle
> {} = pt_max_pdg ! pt cut for other particles (syntax e.g. {6: 100, 25: 50})
> #
> # For display option for energy cut in the partonic center of mass frame type 'update ecut'
> #
> #*********************************************************************
> # Maximum and minimum absolute rapidity (for max, -1 means no cut) *
> #*********************************************************************
> 2.5 = etal ! max rap for the charged leptons
> 0.0 = etalmin ! main rap for the charged leptons
> {} = eta_min_pdg ! rap cut for other particles (use pdg code). Applied on particle and anti-particle
> {} = eta_max_pdg ! rap cut for other particles (syntax e.g. {6: 2.5, 23: 5})
> #*********************************************************************
> # Minimum and maximum DeltaR distance *
> #*********************************************************************
> 0.4 = drll ! min distance between leptons
> -1.0 = drllmax ! max distance between leptons
> #*********************************************************************
> # Minimum and maximum invariant mass for pairs *
> #*********************************************************************
> 0.0 = mmll ! min invariant mass of l+l- (same flavour) lepton pair
> -1.0 = mmllmax ! max invariant mass of l+l- (same flavour) lepton pair
> {} = mxx_min_pdg ! min invariant mass of a pair of particles X/X~ (e.g. {6:250})
> {'default': False} = mxx_only_part_antipart ! if True the invariant mass is applied only
> ! to pairs of particle/antiparticle and not to pairs of the same pdg codes.
> #*********************************************************************
> # Minimum and maximum invariant mass for all letpons *
> #*********************************************************************
> 0.0 = mmnl ! min invariant mass for all letpons (l+- and vl)
> -1.0 = mmnlmax ! max invariant mass for all letpons (l+- and vl)
> #*********************************************************************
> # Minimum and maximum pt for 4-momenta sum of leptons / neutrino *
> # for pair of lepton includes only same flavor, opposite charge
> #*********************************************************************
> 0.0 = ptllmin ! Minimum pt for 4-momenta sum of leptons(l and vl)
> -1.0 = ptllmax ! Maximum pt for 4-momenta sum of leptons(l and vl)
> #*********************************************************************
> # Inclusive cuts *
> #*********************************************************************
> 0.0 = xptl ! minimum pt for at least one charged lepton
> #*********************************************************************
> # Control the pt's of leptons sorted by pt *
> #*********************************************************************
> 0.0 = ptl1min ! minimum pt for the leading lepton in pt
> 0.0 = ptl2min ! minimum pt for the second lepton in pt
> -1.0 = ptl1max ! maximum pt for the leading lepton in pt
> -1.0 = ptl2max ! maximum pt for the second lepton in pt
> #*********************************************************************
> # maximal pdg code for quark to be considered as a light jet *
> # (otherwise b cuts are applied) *
> #*********************************************************************
> 4 = maxjetflavor ! Maximum jet pdg code
> #*********************************************************************
> #
> #*********************************************************************
> # Store info for systematics studies *
> # WARNING: Do not use for interference type of computation *
> #*********************************************************************
> True = use_syst ! Enable systematics studies
> #
> systematics = systematics_program ! none, systematics [python], SysCalc [depreceted, C++]
> ['--mur=0.5,1,2', '--muf=0.5,1,2', '--pdf=errorset'] = systematics_arguments ! see: https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Systematics#Systematicspythonmodule
> # Syscalc is deprecated but to see the associate options type'update syscalc'
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Pim Verschuuren (pverschu) said :
#6

Hi,
I have a similar problem with Madgraph 3.0.3-betternlops. I am using an development branch because this is, as I am aware of, the only one that works on NLO+PS with my UFO model SMEFTatNLO. I do the following:

generate p p > t t~ QED=0 QCD=2
output reweight_test_dir
launch
shower=Pythia8
reweighting=ON

Reweight card:

launch
set MASS 6 1.73e+02

Command "generate_events run_01" interrupted with error:
ImportError : No module named allmatrix2py
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/nfs/scratch2/pverschu/3.0.3-betternlops/tt_default_LO_SM/run_01_tag_1_debug.log'.
Please attach this file to your report.

I get the same error if I change the model to SMEFTatNLO and try the reweighting for a SMEFT parameter. When I add NLO then I get a different error but that one also mentions the allmatrix2py module:

error: Command "/usr/bin/gfortran -Wall -g -Wall -g -shared /tmp/pverschu/tmpcqueq_xr/tmp/pverschu/tmpcqueq_xr/src.linux-x86_64-3.6/allmatrix2pymodule.o /tmp/pverschu/tmpcqueq_xr/tmp/pverschu/tmpcqueq_xr/src.linux-x86_64-3.6/fortranobject.o /tmp/pverschu/tmpcqueq_xr/all_matrix.o /tmp/pverschu/tmpcqueq_xr/P0_gg_ttx/f2py_wrapper.o /tmp/pverschu/tmpcqueq_xr/P2_bbx_ttx/f2py_wrapper.o /tmp/pverschu/tmpcqueq_xr/P3_uux_ttx/f2py_wrapper.o /tmp/pverschu/tmpcqueq_xr/tmp/pverschu/tmpcqueq_xr/src.linux-x86_64-3.6/allmatrix2py-f2pywrappers.o ../lib/libMadLoop.a -L../lib/ -L../lib/ -L/nfs/scratch2/pverschu/3.0.3-betternlops/HEPTools/lib/ -L/nfs/scratch2/pverschu/3.0.3-betternlops/HEPTools/lib/ -L/nfs/scratch2/pverschu/3.0.3-betternlops/HEPTools/lib/ -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib64 -ldhelas -lmodel -lcts -liregi -lninja -lavh_olo -lcollier -lstdc++ -lpython3.6m -lgfortran -o ./allmatrix2py.cpython-36m-x86_64-linux-gnu.so" failed with exit status 1
     make: *** [allmatrix2py.so] Error 1

Let me know if this makes any sense and how to resolve this.

Kind regards,

Pim

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

Hi,

I have no clue about that version of MG5aMC status (which is an alpha version of ... a beta version (version3 of MG5aMC is still beta so far and does not include all feature of mG5amC) That version is not validated at all for anything but NLO+PS (which you are not using) .

So i would strongly suggest to test with "2.8.2".

Now it also seems that you have issue with your f2py executable since it seems that your version of f2py used is the one for python3.6, a version of python that we do not support (we have in 2.8.2 support for python2.7, 3.7,3.8 and 3.9).
i do not know the version of python suupported by your alpha version but it can only be either (2.6+2.7 or the same as for 2.8.2)

Cheers,

Olivier

Revision history for this message
Pim Verschuuren (pverschu) said :
#8

Hi Olivier,

The reason I can't switch over to "2.8.2" is because the SMEFT@NLO UFO model is only compatible with this development branch.

Is there a way to check which python version my development branch uses and then how to adjust the f2py version to that python version? Or do you think using the reweighting feature on such a development branch should not be used even with a fix because of lack of validation?

Kind regards,

Pim

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

Dear Pim,

The best is likely that you force the python version that you want to use.
Otherwise you have to look at the first line of the executable that you use to see
if it ask to run "python" or "python3" by default.

After that you can do "python --version" or "python3 --version" (depending of the first line).
Looks like this branch is python2 only (so it is quite old)

> The reason I can't switch over to "2.8.2" is because the SMEFT@NLO UFO
> model is only compatible with this development branch.

I know but I can not provide help for un-official version. They should not have release the model if they are no official code able to handle such model.

> and then how to adjust the f2py version to that python version?

You should have the option to specify the version of f2py that you want ot use in the file
input/mg5_configuration.txt
if you are in a python3 ready branch, you should have two line for that one for python2 and one for python3.

> Or do
> you think using the reweighting feature on such a development branch
> should not be used even with a fix because of lack of validation?

I do not know how "uptodate" that branch is. I doubt that such branch is in sync with all the fix that we bring regularly in the main version. We had quite a couple of fix on reweighting those last months and clearly none of those are include in that branch.

I do not want to prevent you to use alpha version but I can not recommend to use such type of code for production and support is of course limited in those type of branch (and indeed validation are not performed at all).

Cheers,

Olivier

> On 16 Nov 2020, at 18:15, Pim Verschuuren <email address hidden> wrote:
>
> Question #692855 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/692855
>
> Pim Verschuuren posted a new comment:
> Hi Olivier,
>
> The reason I can't switch over to "2.8.2" is because the SMEFT@NLO UFO
> model is only compatible with this development branch.
>
> Is there a way to check which python version my development branch uses
> and then how to adjust the f2py version to that python version? Or do
> you think using the reweighting feature on such a development branch
> should not be used even with a fix because of lack of validation?
>
> Kind regards,
>
> Pim
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Can you help with this problem?

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

To post a message you must log in.