Madspin failure in onshell mode due to DEFAULT_F2PY_COMPILER

Bug #1724126 reported by Sung Hak Lim
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MadGraph5_aMC@NLO
Fix Released
Undecided
Unassigned

Bug Description

Dear MG5 team,

I was trying to run madspin with onshell mode but I got following error so I'm leaving a report here.

MG5 version: 2.6.0

MG5 command:
   import model MSSM_SLHA2
   output p p > go go
   launch

   (turn on madspin only)

   madspin_card.dat (only changed commands are written):
     set spinmode onshell
     define qq = u u~ d d~ s s~ c c~ b b~
     decay go > qq qq n1

Madspin output:
************************************************************
* *
* W E L C O M E to M A D S P I N *
* *
************************************************************
INFO: Extracting the banner ...
INFO: process: p p > go go
INFO: options:
INFO: detected model: MSSM_SLHA2. Loading...
set spinmode onshell # Use one of the madspin special mode
set max_weight_ps_point 400 # number of PS to estimate the maximum for each event
define qq = u u~ d d~ s s~ c c~ b b~
define qq = u u~ d d~ s s~ c c~ b b~
Defined multiparticle qq = u d s c u~ d~ s~ c~ b b~
decay go > qq qq n1
decay t > w+ b, w+ > all all
decay t~ > w- b~, w- > all all
decay w+ > all all
decay w- > all all
decay z > all all
launch
INFO: Will use seed 534609587
INFO: generate 64000 decay event for particle go
INFO: generating the production square matrix element
INFO: generating the full matrix element squared (with decay)
INFO: generate matrix element for decay only (1 - > N).
INFO: output standalone /disk2/starlight/Pub_Event_MG5/gogo_m400/test/madspin_me
INFO: Done 80.91
INFO: Compiling code
INFO: Compiling code stage 1
INFO: Compiling code stage 2
INFO: Compiling code path /disk2/starlight/Pub_Event_MG5/gogo_m400/test
Error detected in "generate_events run_04"
write debug file /disk2/starlight/Pub_Event_MG5/gogo_m400/test/run_04_tag_1_debug.log
If you need help with this issue please contact us on https://answers.launchpad.net/mg5amcnlo
MadGraph5Error : A compilation Error occurs when trying to compile /disk2/starlight/Pub_Event_MG5/gogo_m400/test/madspin_me/SubProcesses.
 The compilation fails with the following output message:
     cd P2_gg_gogo_go_uuxn1_go_uuxn1;make matrix2py.so
     cd P2_gg_gogo_go_uuxn1_go_ddxn1;make matrix2py.so
     cd P2_gg_gogo_go_uuxn1_go_ssxn1;make matrix2py.so
     cd P2_gg_gogo_go_uuxn1_go_ccxn1;make matrix2py.so
     cd P2_gg_gogo_go_uuxn1_go_bbxn1;make matrix2py.so
     cd P2_gg_gogo_go_ddxn1_go_ddxn1;make matrix2py.so

        (....)

     make: *** [P2_uux_gogo_go_ssxn1_go_bbxn1/matrix2py.so] 오류 2
     {'cpp': 'g++', 'fortran': 'gfortran', 'f2py': 'f2py'} -L../../lib/ -ldhelas -lmodel -c matrix.f -m matrix2py --f77exec=gfortran
     make: *** [P2_uux_gogo_go_ssxn1_go_ssxn1/matrix2py.so] 오류 2
     {'cpp': 'g++', 'fortran': 'gfortran', 'f2py': 'f2py'} -L../../lib/ -ldhelas -lmodel -c matrix.f -m matrix2py --f77exec=gfortran
     {'cpp': 'g++', 'fortran': 'gfortran', 'f2py': 'f2py'} -L../../lib/ -ldhelas -lmodel -c matrix.f -m matrix2py --f77exec=gfortran
     {'cpp': 'g++', 'fortran': 'gfortran', 'f2py': 'f2py'} -L../../lib/ -ldhelas -lmodel -c matrix.f -m matrix2py --f77exec=gfortran
     /bin/bash: {cpp:: command not found

        (....)

     make[1]: Leaving directory `/disk2/starlight/Pub_Event_MG5/gogo_m400/test/madspin_me/SubProcesses/P2_ccx_gogo_go_ssxn1_go_ssxn1'
     make: *** [P2_ccx_gogo_go_ddxn1_go_ccxn1/matrix2py.so] 오류 2
     make: *** [P2_ccx_gogo_go_ddxn1_go_bbxn1/matrix2py.so] 오류 2
     /bin/bash: {cpp:: command not found
     make: *** [P2_ccx_gogo_go_ssxn1_go_ssxn1/matrix2py.so] 오류 2
     make[1]: *** [matrix2py.so] 오류 127
     make[1]: Leaving directory `/disk2/starlight/Pub_Event_MG5/gogo_m400/test/madspin_me/SubProcesses/P2_ccx_gogo_go_ddxn1_go_ssxn1'
     make: *** [P2_ccx_gogo_go_ddxn1_go_ssxn1/matrix2py.so] 오류 2

 Please try to fix this compilations issue and retry.
 Help might be found at https://answers.launchpad.net/mg5amcnlo.
 If you think that this is a bug, you can report this at https://bugs.launchpad.net/mg5amcnlo

Following two lines look relevant for this failure

      {'cpp': 'g++', 'fortran': 'gfortran', 'f2py': 'f2py'} -L../../lib/ -ldhelas -lmodel -c matrix.f -m matrix2py --f77exec=gfortran
 /bin/bash: {cpp:: command not found

So I trace back Madspin ME compilation code [MG5_process]/madspin_me/SubProcesses/maikefile

     include ../../Source/make_opts
     (......)
     matrix$(MENUM)py.so: matrix.f makefile $(LIBS)
      touch __init__.py
      $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py --f77exec=$(FC)

and reached [MG5_process]/madspin_me/Source/make_opts contains

     DEFAULT_F2PY_COMPILER={'cpp': 'g++', 'fortran': 'gfortran', 'f2py': 'f2py'}

This should be f2py but may I know why the dictionary is pasted here?

Is this a bug or my misconfiguration of MG5?

Best wishes,
Sung Hak

Revision history for this message
Sung Hak Lim (sunghak-lim) wrote :
Download full text (3.3 KiB)

Dear MG5 team,

I just trace back code more deeper and found a location of bug origin:

[MG5]/madgraph/iolibs/export_v4.py:

from line 1740:
        # Try to find the correct one.
        if default_compiler['f2py'] and misc.which(default_compiler['f2py']):
            f2py_compiler = default_compiler

['f2py'] is missing there so f2py_compiler is just replaced by a dictionary.

            f2py_compiler = default_compiler['f2py']

after then, f2py compiler is propagated well into make_opts.

I also just noticed that this bug report is duplication of https://answers.launchpad.net/mg5amcnlo/+question/657970 .

====================================================================

However, I got another bug:

Command "generate_events run_16" interrupted with error:
AttributeError : 'module' object has no attribute 'initialise'
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/disk2/starlight/Pub_Event_MG5/gogo_m400/test/run_16_tag_1_debug.log'.
Please attach this file to your report.

The debug log contains:

(....)
  File "/home/starlight/Programs/MG5_aMC_v2_6_0/MadSpin/interface_madspin.py", line 1386, in get_maxwgt_for_onshell
    _, wgt = self.get_onshell_evt_and_wgt(base_event, decays)
  File "/home/starlight/Programs/MG5_aMC_v2_6_0/MadSpin/interface_madspin.py", line 1430, in get_onshell_evt_and_wgt
    production_me = self.calculate_matrix_element(production)
  File "/home/starlight/Programs/MG5_aMC_v2_6_0/MadSpin/interface_madspin.py", line 1471, in calculate_matrix_element
    mymod.initialise(pjoin(self.path_me, 'Cards','param_card.dat'))
AttributeError: 'module' object has no attribute 'initialise'

If I see code [MG5]/MadSpin/interface_madspin.py", line 1471,

            mymod = __import__("%s.matrix2py" % (pdir))
            reload(mymod)
            mymod = getattr(mymod, 'matrix2py')
            with misc.chdir(pjoin(self.path_me, 'madspin_me', 'SubProcesses', pdir)):
                with misc.stdchannel_redirected(sys.stdout, os.devnull):
                    mymod.initialise(pjoin(self.path_me, 'Cards','param_card.dat'))
            self.all_f2py[pdir] = mymod.get_me
            return self.calculate_matrix_element(event)

but matrix.f does not contain subroutine initialise and get_me.

For initialise, I can be changed into subroutine intitializemodel

For get_me, I don't know which is a correct replacement, but guessing from line which calling this module:

            if event[0].color1 == 599 and event.aqcd==0:
                return self.all_f2py[pdir](p, 0.113, 0)
            else:
                return self.all_f2py[pdir](p, event.aqcd, 0)

I replaced it into subroutine get_value, i.e.

            mymod = __import__("%s.matrix2py" % (pdir))
            reload(mymod)
            mymod = getattr(mymod, 'matrix2py')
            with misc.chdir(pjoin(self.path_me, 'madspin_me', 'SubProcesses', pdir)):
                with misc.stdchannel_redirected(sys.stdout, os.devnull):
                    mymod.initialisemodel(pjoin(self.path_me, 'Cards','param_card.dat'))
            self.all_f2py[pdir] = mymod.get_value
            return self.calculate_matrix_element(event)

May I kno...

Read more...

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote : Re: [Bug 1724126] Madspin failure in onshell mode due to DEFAULT_F2PY_COMPILER
Download full text (9.0 KiB)

Hi,

For onshell mode, my advise is to use 2.6.1 since 2.6.0 has too many bug related to that mode.
2.6.1 is not yet released (I will try to release it soon). But in the meantime, you can download it via

bzr branch lp:~mg5core2/mg5amcnlo/2.6.1<https://code.launchpad.net/~mg5core2/mg5amcnlo/2.6.1>

Cheers,

Olivier

On 17 Oct 2017, at 07:23, Sung Hak Lim <<email address hidden><mailto:<email address hidden>>> wrote:

Dear MG5 team,

I just trace back code more deeper and found a location of bug origin:

[MG5]/madgraph/iolibs/export_v4.py:

from line 1740:
       # Try to find the correct one.
       if default_compiler['f2py'] and misc.which(default_compiler['f2py']):
           f2py_compiler = default_compiler

['f2py'] is missing there so f2py_compiler is just replaced by a
dictionary.

           f2py_compiler = default_compiler['f2py']

after then, f2py compiler is propagated well into make_opts.

I also just noticed that this bug report is duplication of
https://answers.launchpad.net/mg5amcnlo/+question/657970 .

====================================================================

However, I got another bug:

Command "generate_events run_16" interrupted with error:
AttributeError : 'module' object has no attribute 'initialise'
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/disk2/starlight/Pub_Event_MG5/gogo_m400/test/run_16_tag_1_debug.log'.
Please attach this file to your report.

The debug log contains:

(....)
 File "/home/starlight/Programs/MG5_aMC_v2_6_0/MadSpin/interface_madspin.py", line 1386, in get_maxwgt_for_onshell
   _, wgt = self.get_onshell_evt_and_wgt(base_event, decays)
 File "/home/starlight/Programs/MG5_aMC_v2_6_0/MadSpin/interface_madspin.py", line 1430, in get_onshell_evt_and_wgt
   production_me = self.calculate_matrix_element(production)
 File "/home/starlight/Programs/MG5_aMC_v2_6_0/MadSpin/interface_madspin.py", line 1471, in calculate_matrix_element
   mymod.initialise(pjoin(self.path_me, 'Cards','param_card.dat'))
AttributeError: 'module' object has no attribute 'initialise'

If I see code [MG5]/MadSpin/interface_madspin.py", line 1471,

           mymod = __import__("%s.matrix2py" % (pdir))
           reload(mymod)
           mymod = getattr(mymod, 'matrix2py')
           with misc.chdir(pjoin(self.path_me, 'madspin_me', 'SubProcesses', pdir)):
               with misc.stdchannel_redirected(sys.stdout, os.devnull):
                   mymod.initialise(pjoin(self.path_me, 'Cards','param_card.dat'))
           self.all_f2py[pdir] = mymod.get_me
           return self.calculate_matrix_element(event)

but matrix.f does not contain subroutine initialise and get_me.

For initialise, I can be changed into subroutine intitializemodel

For get_me, I don't know which is a correct replacement, but guessing
from line which calling this module:

           if event[0].color1 == 599 and event.aqcd==0:
               return self.all_f2py[pdir](p, 0.113, 0)
           else:
               return self.all_f2py[pdir](p, event.aqcd, 0)

I replaced it into subroutine get_value, i.e.

           mymod = __import__(...

Read more...

Revision history for this message
Sung Hak Lim (sunghak-lim) wrote :

Hi Olivier,

Thanks for quick response. Okay, let me try 2.6.1.

Best wishes,
Sung Hak

Changed in mg5amcnlo:
status: New → Fix Committed
Changed in mg5amcnlo:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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