Compilation error while reweighting EWDim6 model

Bug #1696578 reported by Slawek Tkaczyk on 2017-06-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MadGraph5_aMC@NLO
Undecided
Unassigned

Bug Description

Dear Experts,

I am using the EWDim6 model, and after generating events I tried to do the reweighting. The program crashes in the compilation phase:

reweight /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/Events/run_01/unweighted_events.lhe_0.lhe -from_cards --multicore=create
INFO: Extracting the banner ...
INFO: process: p p > j j mu+ mu+ vm vm
INFO: options: QED=6
INFO: Running Reweighting
We are in mode create
launch
INFO: detected model: EWdim6. Loading...
INFO: generating the square matrix element for reweighting
INFO: generate p p > j j mu+ mu+ vm vm QED=6 ;
INFO: Done 48.74
INFO: starts to compute weight for events with the following modification to the param_card:
INFO: set param_card dim6 1 -1.0 # orig: -2.0
KEEP:
INFO: Event nb 0 current time: 13h49
Command "reweight /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/Events/run_01/unweighted_events.lhe_0.lhe -from_cards --multicore=create" interrupted with error:
MadGraph5Error : A compilation Error occurs when trying to compile /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/rw_me/SubProcesses/P1_uu_ddmupmupvmvm.
 The compilation fails with the following output message:
     touch __init__.py
     f2py -L../../lib/ -ldhelas -lmodel -c matrix.f -m matrix2py
     running build
     running config_cc
     unifing config_cc, config, build_clib, build_ext, build commands --compiler options
     running config_fc
     unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
     running build_src
     build_src
     building extension "matrix2py" sources
     f2py options: []
     f2py:> /tmp/stkaczyk/tmpMaLEdE/src.linux-x86_64-2.6/matrix2pymodule.c
     creating /tmp/stkaczyk/tmpMaLEdE
     creating /tmp/stkaczyk/tmpMaLEdE/src.linux-x86_64-2.6
     Reading fortran codes...
      Reading file 'matrix.f' (format:fix,strict)
     Line #57 in matrix.f:" PARAMETER (NPOLENTRIES=(NEXTERNAL+1)*6)"
      determineexprtype: could not determine expressions ('(nexternal+1)*6') type.
     Line #77 in matrix.f:" DATA (BEAMS_HELAVGFACTOR(I),I=1,2)/2,2/"
      analyzeline: implied-DO list "(beams_helavgfactor(i),i=1,2)" is not supported. Skipping.
     Line #90 in matrix.f:" DATA (NHEL(I, 1),I=1,8) / 1, 1,-1,-1, 1, 1,-1,-1/"
      analyzeline: implied-DO list "(nhel(i, 1),i=1,8)" is not supported. Skipping.
     Line #91 in matrix.f:" DATA (NHEL(I, 2),I=1,8) / 1, 1,-1,-1, 1, 1,-1, 1/"
      analyzeline: implied-DO list "(nhel(i, 2),i=1,8)" is not supported. Skipping.
     Line #92 in matrix.f:" DATA (NHEL(I, 3),I=1,8) / 1, 1,-1,-1, 1, 1, 1,-1/"
      analyzeline: implied-DO list "(nhel(i, 3),i=1,8)" is not supported. Skipping.

Any suggestion how to fix the compilation errors?
Many thanks,
SLawek Tkaczyk

Slawek Tkaczyk (stkaczyk) wrote :

Hi,
I have checked that the reweighting algorithm works very well in the MG version 2.4.3.
Slawek

Hi,

The critical problem seems related to the following lines in the code:

      INTEGER POLARIZATIONS(0:NEXTERNAL,0:5)
      DATA ((POLARIZATIONS(I,J),I=0,NEXTERNAL),J=0,5)/NPOLENTRIES*-1/
      COMMON/BORN_BEAM_POL/POLARIZATIONS

since the first real error is:
g77:f77: matrix.f
    matrix.f: In subroutine `smatrix':
    matrix.f:348:
             INTEGER POLARIZATIONS(0:NEXTERNAL,0:5)
                     1
    matrix.f:350: (continued):
             COMMON/BORN_BEAM_POL/POLARIZATIONS
                                  2
    Invalid declaration of or reference to symbol `polarizations' at (2) [initially seen at (1)]

Now the same line (indeed introduced between those two versions) passed perfectly fine on my machine. I'm compiling with gfortran and not f77/g77.

Now i do not see anything obviously wrong on those lines.
My only guess is that g77/f77 is sensitive on the ordering of the line "COMMON/DATA" and that gfortran is not.

Would you mind to edit the file madgraph/iolibs/template_files/matrix_standalone_v4.inc at around line 92, you should have:
          INTEGER POLARIZATIONS(0:NEXTERNAL,0:5)
      DATA ((POLARIZATIONS(I,J),I=0,NEXTERNAL),J=0,5)/NPOLENTRIES*-1/
      COMMON/%(proc_prefix)sBORN_BEAM_POL/POLARIZATIONS

if you can replace this by

          INTEGER POLARIZATIONS(0:NEXTERNAL,0:5)
      COMMON/%(proc_prefix)sBORN_BEAM_POL/POLARIZATIONS
      DATA ((POLARIZATIONS(I,J),I=0,NEXTERNAL),J=0,5)/NPOLENTRIES*-1/

and then see if this works.

Thanks in advance,

OLivier

Download full text (8.7 KiB)

Hi, Thank you for your quick answer.

I replaced the order of the lines in the file you pointed me to,

and now I am getting the following error:

INFO: Update the dependent parameter of the param_card.dat
REWEIGHT: load configuration from /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/Cards/me5_configuration.txt
REWEIGHT: load configuration from /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/input/mg5_configuration.txt
REWEIGHT: load configuration from /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/Cards/me5_configuration.txt
REWEIGHT: Extracting the banner ...
REWEIGHT: process: p p > j j mu+ mu+ vm vm
REWEIGHT: options: QED=6
REWEIGHT: Running Reweighting
REWEIGHT: detected model: EWdim6. Loading...
REWEIGHT: generating the square matrix element for reweighting
REWEIGHT: generate p p > j j mu+ mu+ vm vm QED=6 ;
REWEIGHT: Done 50.71
REWEIGHT: starts to compute weight for events with the following modification to the param_card:
REWEIGHT: set param_card dim6 1 -1.0 # orig: -2.0

REWEIGHT: Event nb 0 current time: 11h32
CRITICAL: fail compilation [reweight_interface.py at line 1111]
REWEIGHT: Original cross-section: 0.001411646 +- 2.042258e-06 pb
REWEIGHT: Computed cross-section:
REWEIGHT: storing files of previous run
REWEIGHT: Done
REWEIGHT:
REWEIGHT:
quit
INFO:

INFO:

and in the debug file I see:

reweight run_01 -from_cards
Traceback (most recent call last):
  File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/bin/internal/extended_cmd.py", line 1430, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/bin/internal/extended_cmd.py", line 1384, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/bin/internal/common_run_interface.py", line 1963, in do_reweight
    reweight_cmd.import_command_file(path)
  File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/madgraph/interface/extended_cmd.py", line 1572, in import_command_file
    self.exec_cmd(line, precmd=True)
  File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/madgraph/interface/extended_cmd.py", line 1457, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/madgraph/interface/extended_cmd.py", line 1384, in onecmd_orig
    return func(arg, **opt)
  File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/madgraph/various/misc.py", line 99, in f_with_no_logger
    out = f(self, *args, **opt)
  File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/madgraph/interface/reweight_interface.py", line 677, in do_launch
    weight = self.calculate_weight(event)
  File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/madgraph/interface/reweight_interface.py", line 896, in calculate_weight
    w_orig = self.calculate_matrix_element(event, 0, space)
  File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/madgraph/interface/reweight_interface.py", line 1104, in calculate_matrix_element
    mymod = __import__('%s.SubProcesses.%s.matrix%spy' % (base, Pname, 2*metag), globals(), locals(), [],-1)
ImportError: /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/rw_me/SubProcesses/P1_uu_ddmupmup...

Read more...

Download full text (13.2 KiB)

Hi,

Thanks a lot for having done the check!
So this confirms that the ordering is important for g77/f77 but not for gfortran. I learned something today.

Now looks like that you have also gfortran on your system and that the system is partly using gfortran and using g77
(Probably for the f2py related stuff)

So can you try the following patch:

=== modified file 'madgraph/iolibs/template_files/makefile_sa_f_sp'
--- madgraph/iolibs/template_files/makefile_sa_f_sp 2016-11-13 13:28:20 +0000
+++ madgraph/iolibs/template_files/makefile_sa_f_sp 2017-06-09 10:20:45 +0000
@@ -24,4 +24,4 @@

 matrix$(MENUM)py.so: matrix.f makefile $(LIBS)
  touch __init__.py
- $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py
\ No newline at end of file
+ $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py --f77exec=$(FC)
\ No newline at end of file

Thanks,

Olivier

> On 9 Jun 2017, at 11:34, Slawek Tkaczyk <email address hidden> wrote:
>
> Hi, Thank you for your quick answer.
>
> I replaced the order of the lines in the file you pointed me to,
>
> and now I am getting the following error:
>
>
> INFO: Update the dependent parameter of the param_card.dat
> REWEIGHT: load configuration from /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/Cards/me5_configuration.txt
> REWEIGHT: load configuration from /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/input/mg5_configuration.txt
> REWEIGHT: load configuration from /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/Cards/me5_configuration.txt
> REWEIGHT: Extracting the banner ...
> REWEIGHT: process: p p > j j mu+ mu+ vm vm
> REWEIGHT: options: QED=6
> REWEIGHT: Running Reweighting
> REWEIGHT: detected model: EWdim6. Loading...
> REWEIGHT: generating the square matrix element for reweighting
> REWEIGHT: generate p p > j j mu+ mu+ vm vm QED=6 ;
> REWEIGHT: Done 50.71
> REWEIGHT: starts to compute weight for events with the following modification to the param_card:
> REWEIGHT: set param_card dim6 1 -1.0 # orig: -2.0
>
> REWEIGHT: Event nb 0 current time: 11h32
> CRITICAL: fail compilation [reweight_interface.py at line 1111]
> REWEIGHT: Original cross-section: 0.001411646 +- 2.042258e-06 pb
> REWEIGHT: Computed cross-section:
> REWEIGHT: storing files of previous run
> REWEIGHT: Done
> REWEIGHT:
> REWEIGHT:
> quit
> INFO:
>
> INFO:
>
>
> and in the debug file I see:
>
>
> reweight run_01 -from_cards
> Traceback (most recent call last):
> File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/bin/internal/extended_cmd.py", line 1430, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/bin/internal/extended_cmd.py", line 1384, in onecmd_orig
> return func(arg, **opt)
> File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/bin/internal/common_run_interface.py", line 1963, in do_reweight
> reweight_cmd.import_command_file(path)
> File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/madgraph/interface/extended_cmd.py", line 1572, in import_command_file
> self.exec_cmd(line, precmd=True)
> File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/madgraph/interface/extended_cmd.py", line 1457, in exec_cm...

Slawek Tkaczyk (stkaczyk) wrote :
Download full text (17.1 KiB)

Hi Olivier,

It is all working fine now!

Many thanks again for spending time to make these two suggestions!

Best regards,

Slawek

________________________________
From: <email address hidden> <email address hidden> on behalf of Olivier Mattelaer <email address hidden>
Sent: Friday, June 9, 2017 12:27:44 PM
To: Slawomir M Tkaczyk
Subject: Re: [Bug 1696578] Re: Compilation error while reweighting EWDim6 model

Hi,

Thanks a lot for having done the check!
So this confirms that the ordering is important for g77/f77 but not for gfortran. I learned something today.

Now looks like that you have also gfortran on your system and that the system is partly using gfortran and using g77
(Probably for the f2py related stuff)

So can you try the following patch:

=== modified file 'madgraph/iolibs/template_files/makefile_sa_f_sp'
--- madgraph/iolibs/template_files/makefile_sa_f_sp 2016-11-13 13:28:20 +0000
+++ madgraph/iolibs/template_files/makefile_sa_f_sp 2017-06-09 10:20:45 +0000
@@ -24,4 +24,4 @@

 matrix$(MENUM)py.so: matrix.f makefile $(LIBS)
         touch __init__.py
- $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py
\ No newline at end of file
+ $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py --f77exec=$(FC)
\ No newline at end of file

Thanks,

Olivier

> On 9 Jun 2017, at 11:34, Slawek Tkaczyk <email address hidden> wrote:
>
> Hi, Thank you for your quick answer.
>
> I replaced the order of the lines in the file you pointed me to,
>
> and now I am getting the following error:
>
>
> INFO: Update the dependent parameter of the param_card.dat
> REWEIGHT: load configuration from /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/Cards/me5_configuration.txt
> REWEIGHT: load configuration from /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/input/mg5_configuration.txt
> REWEIGHT: load configuration from /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/Cards/me5_configuration.txt
> REWEIGHT: Extracting the banner ...
> REWEIGHT: process: p p > j j mu+ mu+ vm vm
> REWEIGHT: options: QED=6
> REWEIGHT: Running Reweighting
> REWEIGHT: detected model: EWdim6. Loading...
> REWEIGHT: generating the square matrix element for reweighting
> REWEIGHT: generate p p > j j mu+ mu+ vm vm QED=6 ;
> REWEIGHT: Done 50.71
> REWEIGHT: starts to compute weight for events with the following modification to the param_card:
> REWEIGHT: set param_card dim6 1 -1.0 # orig: -2.0
>
> REWEIGHT: Event nb 0 current time: 11h32
> CRITICAL: fail compilation [reweight_interface.py at line 1111]
> REWEIGHT: Original cross-section: 0.001411646 +- 2.042258e-06 pb
> REWEIGHT: Computed cross-section:
> REWEIGHT: storing files of previous run
> REWEIGHT: Done
> REWEIGHT:
> REWEIGHT:
> quit
> INFO:
>
> INFO:
>
>
> and in the debug file I see:
>
>
> reweight run_01 -from_cards
> Traceback (most recent call last):
> File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/bin/internal/extended_cmd.py", line 1430, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/bin/internal/extended_cmd.py", line 1384, in onecmd_orig
> return func(arg, **opt)
> File "...

Download full text (21.7 KiB)

Hi,

Thanks to you this clearly improve our code in order to make it work on more machine.

Thanks,

Olivier
On 9 Jun 2017, at 13:02, Slawek Tkaczyk <<email address hidden><mailto:<email address hidden>>> wrote:

Hi Olivier,

It is all working fine now!

Many thanks again for spending time to make these two suggestions!

Best regards,

Slawek

________________________________
From: <email address hidden><mailto:<email address hidden>> <<email address hidden><mailto:<email address hidden>>> on behalf of Olivier Mattelaer <<email address hidden><mailto:<email address hidden>>>
Sent: Friday, June 9, 2017 12:27:44 PM
To: Slawomir M Tkaczyk
Subject: Re: [Bug 1696578] Re: Compilation error while reweighting EWDim6 model

Hi,

Thanks a lot for having done the check!
So this confirms that the ordering is important for g77/f77 but not for gfortran. I learned something today.

Now looks like that you have also gfortran on your system and that the system is partly using gfortran and using g77
(Probably for the f2py related stuff)

So can you try the following patch:

=== modified file 'madgraph/iolibs/template_files/makefile_sa_f_sp'
--- madgraph/iolibs/template_files/makefile_sa_f_sp 2016-11-13 13:28:20 +0000
+++ madgraph/iolibs/template_files/makefile_sa_f_sp 2017-06-09 10:20:45 +0000
@@ -24,4 +24,4 @@

matrix$(MENUM)py.so: matrix.f makefile $(LIBS)
        touch __init__.py
- $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py
\ No newline at end of file
+ $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py --f77exec=$(FC)
\ No newline at end of file

Thanks,

Olivier

On 9 Jun 2017, at 11:34, Slawek Tkaczyk <<email address hidden><mailto:<email address hidden>>> wrote:

Hi, Thank you for your quick answer.

I replaced the order of the lines in the file you pointed me to,

and now I am getting the following error:

INFO: Update the dependent parameter of the param_card.dat
REWEIGHT: load configuration from /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/Cards/me5_configuration.txt<http://cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/Cards/me5_configuration.txt>
REWEIGHT: load configuration from /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/input/mg5_configuration.txt<http://cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/input/mg5_configuration.txt>
REWEIGHT: load configuration from /afs/cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/Cards/me5_configuration.txt<http://cern.ch/user/s/stkaczyk/MG5_aMC_v2_5_5/PROC_EWdim6_0/Cards/me5_configuration.txt>
REWEIGHT: Extracting the banner ...
REWEIGHT: process: p p > j j mu+ mu+ vm vm
REWEIGHT: options: QED=6
REWEIGHT: Running Reweighting
REWEIGHT: detected model: EWdim6. Loading...
REWEIGHT: generating the square matrix element for reweighting
REWEIGHT: generate p p > j j mu+ mu+ vm vm QED=6 ;
REWEIGHT: Done 50.71
REWEIGHT: starts to compute weight for events with the following modification to the param_card:
REWEIGHT: set param_card dim6 1 -1.0 # orig: -2.0

REWEIGHT: Event nb 0 current time: 11h32
CRITICAL: fail compilation [reweight_interface.py at line 1111]
REWEIGHT: Original cross-section: 0.001411646 +- 2.042258e-06 pb
REWEIGHT: Comput...

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  Edit
Everyone can see this information.

Other bug subscribers