Error: Actual argument contains too few elements for dummy argument 'x'

Asked by Kevin Kwok

I have tried to run a process in MG5 (I think it is process-independent so I haven't specified the process here), and it gives the following error message:

generate_events run_01
Traceback (most recent call last):
  File "/MG5_aMC_v2_6_2/madgraph/interface/extended_cmd.py", line 1501, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/MG5_aMC_v2_6_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
    return func(arg, **opt)
  File "/MG5_aMC_v2_6_2/madgraph/interface/madevent_interface.py", line 2467, in do_generate_events
    self.run_generate_events(switch_mode, args)
  File "/MG5_aMC_v2_6_2/madgraph/interface/common_run_interface.py", line 6685, in new_fct
    original_fct(obj, *args, **opts)
  File "/MG5_aMC_v2_6_2/madgraph/interface/madevent_interface.py", line 2506, in run_generate_events
    postcmd=False)
  File "/MG5_aMC_v2_6_2/madgraph/interface/extended_cmd.py", line 1528, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/MG5_aMC_v2_6_2/madgraph/interface/extended_cmd.py", line 1450, in onecmd_orig
    return func(arg, **opt)
  File "/MG5_aMC_v2_6_2/madgraph/interface/madevent_interface.py", line 3308, in do_survey
    jobs, P_zero_result = ajobcreator.launch()
  File "/MG5_aMC_v2_6_2/madgraph/madevent/gen_ximprove.py", line 186, in launch
    self.cmd.compile(['madevent'], cwd=Pdir)
  File "/MG5_aMC_v2_6_2/madgraph/interface/extended_cmd.py", line 1592, in compile
    return misc.compile(nb_core=self.options['nb_core'], *args, **opts)
  File "/MG5_aMC_v2_6_2/madgraph/various/misc.py", line 527, in compile
    raise MadGraph5Error, error_text
MadGraph5Error: A compilation Error occurs when trying to compile /Test/SubProcesses/P1_gg_x0_x0_llll.
The compilation fails with the following output message:
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c driver.f -I../../Source/
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c myamp.f -I../../Source/
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c genps.f -I../../Source/
    gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c unwgt.f -I../../Source/
    genps.f:328:25:

          & nbranch,P,M,S,X,jac,pswgt)
                             1
    Error: Actual argument contains too few elements for dummy argument 'x' (24/40) at (1)
    genps.f:60:53:

           call gen_mom(iconfig,mincfig,maxcfig,invar,wgt,x,p)
                                                         1
    Error: Actual argument contains too few elements for dummy argument 'x' (11/24) at (1)
    make: *** [genps.o] Error 1
    make: *** Waiting for unfinished jobs....

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
                              Run Options
                              -----------
               stdout_level : 20 (user set)

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

                      Configuration Options
                      ---------------------
                text_editor : None
         cluster_local_path : None
      cluster_status_update : (600, 30)
               pythia8_path : None (user set)
                  hwpp_path : None (user set)
            pythia-pgs_path : None (user set)
                    td_path : None (user set)
               delphes_path : None (user set)
                thepeg_path : None (user set)
               cluster_type : condor
          madanalysis5_path : None (user set)
           cluster_nb_retry : 1
                 eps_viewer : None
                web_browser : None
               syscalc_path : None (user set)
           madanalysis_path : None (user set)
                     lhapdf : lhapdf-config
              f2py_compiler : None
                 hepmc_path : None (user set)
         cluster_retry_wait : 300
           fortran_compiler : None
                auto_update : 7 (user set)
        exrootanalysis_path : None (user set)
                    timeout : 60
               cpp_compiler : None

I have no idea what's wrong.

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Kevin Kwok
Solved:
Last query:
Last reply:
Revision history for this message
Kevin Kwok (kiwakwok) said :
#1

The problem has been solved by setting the fortran and cpp compilers to those provided by gcc-7.3.1, instead of gcc-8.1.0.

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

Hi,

You impress me, I was not even aware that gcc8 was released (8.1was released 3 days ago)
Thanks for the information, I will keep this in mind.

Cheers,

Olivier

> On 8 May 2018, at 17:37, Kevin Kwok <email address hidden> wrote:
>
> Question #668703 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/668703
>
> Status: Open => Solved
>
> Kevin Kwok confirmed that the question is solved:
> The problem has been solved by setting the fortran and cpp compilers to
> those provided by gcc-7.3.1, instead of gcc-8.1.0.
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
KP.Xie (kpxie) said :
#3

Hi,

I met the same problem while using MadGraph with my new Mac Pro. Is there any method to use the old version of gcc to compile? I have download and install gcc@7, but the system automatically uses the newest gcc to compile and reports errors. Or I just wait for new version of MadGraph compatible with gcc8?

Thanks!
Ke-Pan

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

Hi,

You can specify which version of gfortran/c++
you want to use within the input/mg5_configuration.txt

When doing so, you also have to recompile all the dependencies to use the same version.

> . Or I just wait for new version of
> MadGraph compatible with gcc8?

My guess here is that this is a bug within gcc8 and therefore I'm just going to wait that they fix it in the next version of gcc.

Cheers,

Olivier

> On 12 May 2018, at 02:57, KP.Xie <email address hidden> wrote:
>
> Question #668703 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/668703
>
> KP.Xie posted a new comment:
> Hi,
>
> I met the same problem while using MadGraph with my new Mac Pro. Is
> there any method to use the old version of gcc to compile? I have
> download and install gcc@7, but the system automatically uses the newest
> gcc to compile and reports errors. Or I just wait for new version of
> MadGraph compatible with gcc8?
>
> Thanks!
> Ke-Pan
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
KP.Xie (kpxie) said :
#5

Hi,

Thanks for the quick reply! Could you describe more specifically? I am very pool at coding. How to specify the version? Replace
# fortran_compiler = None
and
# cpp_compiler = None
to what? I have installed gcc@7. And what's the meaning of 'recompile all the dependencies to use the same version'?

Thank you very much!
Ke-Pan

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

hi,

> Thanks for the quick reply! Could you describe more specifically? I am very pool at coding. How to specify the version? Replace
> # fortran_compiler = None
> and
> # cpp_compiler = None
> to what? I have installed gcc@7.

How do you call gfortran to use the one related to gcc7?
if this is gfortran7
then you have to replace the line
> # fortran_compiler = None
by
> fortran_compiler = gfortran7

> And what's the meaning of 'recompile all the dependencies to use the same version'?

If you have link MG5aMC to lhapdf/fastjet/...
all those are likely to be recompiled with the same version of gcc to avoid any issue.

If you run at NLO, it is also likely that you need to recompile the following two directories:
vendor/Cuttools and vendor/IREGI

Cheers,

Olivier

> On 12 May 2018, at 11:42, KP.Xie <email address hidden> wrote:
>
> Question #668703 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/668703
>
> KP.Xie posted a new comment:
> Hi,
>
> Thanks for the quick reply! Could you describe more specifically? I am very pool at coding. How to specify the version? Replace
> # fortran_compiler = None
> and
> # cpp_compiler = None
> to what? I have installed gcc@7. And what's the meaning of 'recompile all the dependencies to use the same version'?
>
> Thank you very much!
> Ke-Pan
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
KP.Xie (kpxie) said :
#7

Hi,

Thank you very much Olivier! That solves my problem. I finally can use MG now~

Best,
Ke-Pan

Revision history for this message
Beojan (beojan2) said :
#8

I'm not so sure this is a GCC bug. From the release announcement for Gfortran 8.1 (https://groups.google.com/forum/#!topic/comp.lang.fortran/x3JnAjRX-KA):

> When an actual argument contains too few elements for a dummy
> argument, an error is now issued. The -std=legacy option can be
> used to still compile such code

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

Actually,

I do not have access to a such recent compiler yet on any of the cluster on which I have access (it is not even yet available on the new cluster that enter on production this month and not even available on any of the "install it yourself" tools available on that cluster.

But you might try the following patch:
=== modified file 'Template/LO/SubProcesses/genps.f'
--- Template/LO/SubProcesses/genps.f 2018-04-20 08:38:20 +0000
+++ Template/LO/SubProcesses/genps.f 2018-05-24 15:34:29 +0000
@@ -104,7 +104,7 @@
 c
       integer iconfig,mincfig,maxcfig,invar
       double precision p1(0:3,nexternal+1)
- double precision x(maxinvar)
+ double precision x(*)
       double precision wgt
 c
 c Local
@@ -663,7 +663,7 @@
 c double precision spole(-max_branch:0),swidth(-max_branch:0)
       double precision jac,pswgt
       integer nbranch
- double precision x(40) ! ja 3/2/11 21->40 after strange segfault
+ double precision x(*) ! ja 3/2/11 21->40 after strange segfault
 c
 c Local
 c

Cheers,

Olivier

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

Don't hesitate to tell me if this works.
If it does I can include this in the official version of the code.

Cheers,

Olivier

Revision history for this message
Joshua Ellis (jp-ellis) said :
#11

The patch provided (which I see has been included in the latest version of MadGraph) is incomplete. The following is also required:

diff -u Template/LO/SubProcesses/genps.f Template/LO/SubProcesses/genps.f
--- a/Template/LO/SubProcesses/genps.f
+++ b/Template/LO/SubProcesses/genps.f
@@ -41,7 +41,7 @@
       integer mincfig,maxcfig !Range of configurations
       integer invar
       double precision wgt !(input and output)
- double precision x(maxdim),p(maxdim) !x,p (output) [p(0:3,nexternal)]
+ double precision x(maxdim),p(*) !x,p (output) [p(0:3,nexternal)]
 c
 c Local
 c

Diff finished. Tue Jun 26 11:32:30 2018

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

Thanks a lot,

I have applied it.
I just see that the latest version of easybuild (installed on our server on Monday)
allow the installation of gcc8.
So I will be able to test more deeply and check the full code (at least I will try).

Thanks,

Olivier

> On 26 Jun 2018, at 04:57, Joshua Ellis <email address hidden> wrote:
>
> Question #668703 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/668703
>
> Joshua Ellis posted a new comment:
> The patch provided (which I see has been included in the latest version
> of MadGraph) is incomplete. The following is also required:
>
> diff -u Template/LO/SubProcesses/genps.f Template/LO/SubProcesses/genps.f
> --- a/Template/LO/SubProcesses/genps.f
> +++ b/Template/LO/SubProcesses/genps.f
> @@ -41,7 +41,7 @@
> integer mincfig,maxcfig !Range of configurations
> integer invar
> double precision wgt !(input and output)
> - double precision x(maxdim),p(maxdim) !x,p (output) [p(0:3,nexternal)]
> + double precision x(maxdim),p(*) !x,p (output) [p(0:3,nexternal)]
> c
> c Local
> c
>
> Diff finished. Tue Jun 26 11:32:30 2018
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Juan Carlos Vasquez Carmona (juancarlos8866) said :
#13

Hi,

Actually what worked for me was putting gfortran-7 not gfortran7 for the fortran compiler. I use MacOS version 10.13.6

Hope it helps,
Juan