MadGraph5 (5.2.1.1) / lhapdf (5.9.1) : index of lhapdf file not found

Asked by Alexander Law

I am using MadGraph 5.2.1.1 and lhapdf 5.9.1. I am generating events from within a process directory using the bin/madevent script and passing it the path to a commands file. Event generations run successfully if I use the default cteq6l1 PDF, but I have been unsuccessful in interfacing the process to PDFs included with the lhapdf library. If I add the following lines to my madevent commands file:

set pdlabel 'lhapdf'
# 21000 corresponds to MSTW2008lo68
set lhaid 21000

... the event generation dies quickly with the following error:

MadGraph5Error : index of lhapdf file not found

I believe that I have followed the instructions in README.lhapdf carefully.

Terminal output is below. Thanks for any help!
Alexander

Terminal output (trimmed the startup banner):
INFO: load configuration from /export/home/alaw/azh/signalUncertainties/batch/mg_run/condorDir/A_Zh_Zll_hbb_batch/Cards/me5_configuration.txt
INFO: load configuration from /export/home/alaw/bin/madgraph5/MG5_aMC_v2_1_1/input/mg5_configuration.txt
INFO: load configuration from /export/home/alaw/azh/signalUncertainties/batch/mg_run/condorDir/A_Zh_Zll_hbb_batch/Cards/me5_configuration.txt
Using default text editor "vi". Set another one in ./input/mg5_configuration.txt
Using default eps viewer "evince". Set another one in ./input/mg5_configuration.txt
Using default web browser "firefox". Set another one in ./input/mg5_configuration.txt
import command ./Cards/madevent_commands_MSTW2008lo68cl_facNo_renNo_test.txt
launch
The following switches determine which programs are run:
 1 Run the pythia shower/hadronization: pythia=NOT INSTALLED
 2 Run PGS as detector simulator: pgs=NOT INSTALLED
 3 Run Delphes as detector simulator: delphes=NOT INSTALLED
 4 Decay particles with the MadSpin module: madspin=OFF
 5 Add weight to events based on coupling parameters: reweight=OFF
  Either type the switch number (1 to 5) to change its default setting,
  or set any switch explicitly (e.g. type 'madspin=ON' at the prompt)
  Type '0', 'auto', 'done' or just press enter when you are done.
 [0, 4, 5, auto, done, madspin=ON, madspin=OFF, madspin, reweight=ON, ... ]
The answer to the previous question is not set in your input file
Use 0 value
set Wh2 1
INFO: modify param_card information BLOCK decay with id (35,) set to 1.0
set Wh3 1
INFO: modify param_card information BLOCK decay with id (36,) set to 1.0
set Whc 1
INFO: modify param_card information BLOCK decay with id (37,) set to 1.0
set scale 91.1880
INFO: modify parameter scale of the run_card.dat to 91.188
set dsqrt_q2fact1 91.1880
INFO: modify parameter dsqrt_q2fact1 of the run_card.dat to 91.188
set dsqrt_q2fact2 91.1880
INFO: modify parameter dsqrt_q2fact2 of the run_card.dat to 91.188
set pdlabel 'lhapdf'
INFO: modify parameter pdlabel of the run_card.dat to lhapdf
set lhaid 21000
INFO: modify parameter lhaid of the run_card.dat to 21000
set nevents 500
INFO: modify parameter nevents of the run_card.dat to 500
Do you want to edit a card (press enter to bypass editing)?
  1 / param : param_card.dat
  2 / run : run_card.dat
 you can also
   - enter the path to a valid card or banner.
   - use the 'set' command to modify a parameter directly.
     The set option works only for param_card and run_card.
     Type 'help set' for more information on this command.
   - call an external program (ASperGE/MadWidth/...).
     Type 'help' for the list of available command
 [0, done, 1, param, 2, run, enter path]
The answer to the previous question is not set in your input file
Use 0 value
Generating 500 events with run name run_01
survey run_01
INFO: compile directory
INFO: Using LHAPDF v5.9.1 interface for PDFs
Error: no display specified
Error detected in sub-command launch
write debug file /export/home/alaw/azh/signalUncertainties/batch/mg_run/condorDir/A_Zh_Zll_hbb_batch/run_01_tag_1_debug.log
If you need help with this issue please contact us on https://answers.launchpad.net/madgraph5
MadGraph5Error : index of lhapdf file not found
quit
INFO:

INFO:

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
marco zaro Edit question
Solved by:
Alexander Law
Solved:
Last query:
Last reply:
Revision history for this message
marco zaro (marco-zaro) said :
#1

Dear Alexander,
does the file
LHAPDF/share/lhapdf/PDFsets.index
exists (LHAPDF the path to your lhapdf installation)?
Let me know,

Marco

Revision history for this message
Alexander Law (law-59) said :
#2

Thanks for the quick response, Marco -

The file exists in that directory, however I have no environment variables set to point the event generation executable to this directory.

Following the directions in README.lhapdf (as I understand them), I copied libLHAPDF.a to lib/ at the top level of the process directory. I then copied PDFsets.index, and the desired PDF file (MSTW2008lo68cl.LHGRID) to lib/PDFsets, also within the process directory, where I expect that the process looks for them by default.

Thanks for the help,
Alexander

Revision history for this message
marco zaro (marco-zaro) said :
#3

Hi Alexander,
so, the README.lhapdf is not correct, as we forgot to update it. Sorry for this.
In order to use lhapdf you have to
launch the MG5_aMC shell
type
set lhadpf /PATH/TO/lhapdf-config

with the absolute path to lhapdf-config, which is in the bin/ directory of your lhapdf installation

set pdlabel = ‘lhapdf’ in the run_card and lhaid to the desired pdf set.
This shoudl be it.

Let me know if it works.

Cheers,

Marco

On 10 Jun 2014, at 18:31, Alexander Law <email address hidden> wrote:

> Question #250006 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/250006
>
> Status: Needs information => Open
>
> Alexander Law gave more information on the question:
> Thanks for the quick response, Marco -
>
> The file exists in that directory, however I have no environment
> variables set to point the event generation executable to this
> directory.
>
> Following the directions in README.lhapdf (as I understand them), I
> copied libLHAPDF.a to lib/ at the top level of the process directory. I
> then copied PDFsets.index, and the desired PDF file
> (MSTW2008lo68cl.LHGRID) to lib/PDFsets, also within the process
> directory, where I expect that the process looks for them by default.
>
> Thanks for the help,
> Alexander
>
> --
> You received this question notification because you are a direct
> subscriber of the question.

Revision history for this message
Alexander Law (law-59) said :
#4

+ When I add the line:
set lhapdf /export/home/alaw/libs/lhapdf-5.9.1/bin/lhapdf-config
... to my madevent commands file, I get the following (new) error in the terminal output:
WARNING: invalid set command lhapdf /export/home/alaw/libs/lhapdf-5.9.1/bin/lhapdf-config
... and the generation dies on the same error "index of lhapdf file not found".

+ Removing that line from the madevent commands file, and typing it directly into the madevent prompt (launched from the process/bin/ directory), it appears to edit the mg5_configuration file in my central installation of MadGraph (i.e., where I generate processes). Attempting to run the generation at this point also fails, with the same error.

+ Adding the full path to lhapdf-config in process/Cards/me5_configuration.txt , generation dies with the following error:
Exception : ['/export/home/alaw/libs/lhapdf-5.9.1/bin/lhapdf-getdata', 'MSTW2008lo68cl.LHgrid'] fails with no such file or directory
... In this case, generation appears to have added a link to libLHAPDF.a in process/lib/, and created process/lib/PDFsets/, but I see no contents in the new PDFsets directory. It looks like it successfully finds lhapdf-getdata, given the full path in process/me5_configuration.txt, but it still doesn't know where to look for the actual dataset and index files(?).

Thanks,
Alexander

Revision history for this message
marco zaro (marco-zaro) said :
#5

Hi,
can you check that the file exist?
> /export/home/alaw/libs/lhapdf-5.9.1/bin/lhapdf-config
Thanks a lot,

Marco

On 10 Jun 2014, at 21:36, Alexander Law <email address hidden> wrote:

> Question #250006 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/250006
>
> Status: Answered => Open
>
> Alexander Law is still having a problem:
> + When I add the line:
> set lhapdf /export/home/alaw/libs/lhapdf-5.9.1/bin/lhapdf-config
> ... to my madevent commands file, I get the following (new) error in the terminal output:
> WARNING: invalid set command lhapdf /export/home/alaw/libs/lhapdf-5.9.1/bin/lhapdf-config
> ... and the generation dies on the same error "index of lhapdf file not found".
>
> + Removing that line from the madevent commands file, and typing it
> directly into the madevent prompt (launched from the process/bin/
> directory), it appears to edit the mg5_configuration file in my central
> installation of MadGraph (i.e., where I generate processes). Attempting
> to run the generation at this point also fails, with the same error.
>
> + Adding the full path to lhapdf-config in process/Cards/me5_configuration.txt , generation dies with the following error:
> Exception : ['/export/home/alaw/libs/lhapdf-5.9.1/bin/lhapdf-getdata', 'MSTW2008lo68cl.LHgrid'] fails with no such file or directory
> ... In this case, generation appears to have added a link to libLHAPDF.a in process/lib/, and created process/lib/PDFsets/, but I see no contents in the new PDFsets directory. It looks like it successfully finds lhapdf-getdata, given the full path in process/me5_configuration.txt, but it still doesn't know where to look for the actual dataset and index files(?).
>
> Thanks,
> Alexander
>
> --
> You received this question notification because you are a direct
> subscriber of the question.

Revision history for this message
Alexander Law (law-59) said :
#6

Howdy -

The file exists, and the link created in process/lib/ is valid.

When I queried "lhapdf-config --pdfsets-path" on the command line, I discovered that my dataset was in the wrong place. I hadn't made a PDFsets/ subdirectory, and downloaded it directly to share/lhapdf. Correcting this gets me a little farther along the generation startup.

To summarize the working recipe for me:
+ install the LHAPDF library in some central location (lhapdfDir)
+ download PDFsets.index to lhapdfDir/share/lhapdf/
+ mkdir lhapdfDir/share/lhapdf/PDFsets
+ download your PDF set(s) to the above directory
+ in the MG5 process directory (procDir) edit procDir/Cards/me5_configuration.txt:
    lhapdf = path/to/lhapdfDir/bin/lhapdf-config

This at least passes the steps on which generation was dying previously. Now it dies with fortran compilation errors. I don't know yet whether these are related to the original problem in this thread, or distinct, so I'll leave this update as-is, and add the new issue in another message.

Alexander

Revision history for this message
Alexander Law (law-59) said :
#7

The fortran compiler errors I now encounter are copied from the terminal, below:

MadGraph5Error : A compilation Error occurs when trying to compile /export/home/alaw/azh/signalUncertainties/batch/mg_run/condorDir/A_Zh_Zll_hbb_batch/Source.
        The compilation fails with the following output message:
            gfortran -O -w -fbounds-check -ffixed-line-length-132 -c -o gen_ximprove.o gen_ximprove.f
            gfortran -O -w -fbounds-check -ffixed-line-length-132 -c -o ranmar.o ranmar.f
            gfortran -O -w -fbounds-check -ffixed-line-length-132 -c -o rw_routines.o rw_routines.f
            gfortran -O -w -fbounds-check -ffixed-line-length-132 -o ../bin/internal/gen_ximprove gen_ximprove.o ranmar.o rw_routines.o open_file.o
            open_file.o: In function `open_file_':
            open_file.f:(.text+0x446): undefined reference to `_gfortran_transfer_character_write'
            open_file.f:(.text+0x459): undefined reference to `_gfortran_transfer_character_write'
            open_file.f:(.text+0x470): undefined reference to `_gfortran_transfer_character_write'
            collect2: ld returned 1 exit status
            make: *** [../bin/internal/gen_ximprove] Error 1

Thanks,
Alexander

Revision history for this message
marco zaro (marco-zaro) said :
#8

Dear Alexander,
can you please check this questions which looks related to yours?
https://answers.launchpad.net/mg5amcnlo/+question/236807
Let me know,

Marco

On 10 Jun 2014, at 22:46, Alexander Law <email address hidden> wrote:

> _gfortran_transfer_character_write

Revision history for this message
Alexander Law (law-59) said :
#9

Hi, Marco -

Thanks for all the help! That old thread was all I needed to fix the compile errors. I'm getting my events now, so I'll be glad to mark this as solved, with a final request to update the instructions in README.lhapdf.

Thanks!
Alexander Law

Revision history for this message
marco zaro (marco-zaro) said :
#10

Dear Alexander,
the README.lhapdf is not there any more in 2.1.2, so everything should be ok
great that you solved your problems!
Cheers,

Marco

On 11 Jun 2014, at 02:17, Alexander Law <email address hidden> wrote:

> Question #250006 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/250006
>
> Status: Answered => Solved
>
> Alexander Law confirmed that the question is solved:
> Hi, Marco -
>
> Thanks for all the help! That old thread was all I needed to fix the
> compile errors. I'm getting my events now, so I'll be glad to mark this
> as solved, with a final request to update the instructions in
> README.lhapdf.
>
> Thanks!
> Alexander Law
>
> --
> You received this question notification because you are a direct
> subscriber of the question.