LHAPDF path incorrectly set in 2.6.0

Bug #1731176 reported by Zachary Marshall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MadGraph5_aMC@NLO
Fix Released
Undecided
Unassigned

Bug Description

Hi,

In MadGraph5_aMC@NLO 2.6.0, in madgraph/interface/common_run_interface.py on L3963 the get_lhapdf_pdfsetsdir function is defined. This function includes:

        # check if the LHAPDF_DATA_PATH variable is defined
        if 'LHAPDF_DATA_PATH' in os.environ.keys() and os.environ['LHAPDF_DATA_PATH']:
            datadir = os.environ['LHAPDF_DATA_PATH']

This path is allowed to be a colon-separated series of paths (just like any other $PATH in the environment). That causes crashes when running with certain environments. Ultimately this leads to a crash on L3930 of madgraph/interface/common_run_interface.py:

            pdfsets_lines = \
                    [l for l in open(pjoin(pdfsets_dir, 'pdfsets.index')).read().split('\n') if l.strip()]

That needs to be able to handle the colon-separated path, and just search through for the first pdfsets.index file it finds.

Thanks,
Zach

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote : Re: [Bug 1731176] [NEW] LHAPDF path incorrectly set in 2.6.0
Download full text (3.2 KiB)

Thanks,

I will push the following patch:

=== modified file 'madgraph/interface/common_run_interface.py'
--- madgraph/interface/common_run_interface.py 2017-10-23 22:48:09 +0000
+++ madgraph/interface/common_run_interface.py 2017-11-09 16:26:15 +0000
@@ -4041,7 +4041,14 @@
         elif lhapdf_version.startswith('6.'):
             datadir = subprocess.Popen([self.options['lhapdf'], '--datadir'],
                          stdout = subprocess.PIPE).stdout.read().strip()
-
+
+ if ':' in datadir:
+ for totry in datadir.split(':'):
+ if os.path.exists(pjoin(totry, 'pdfsets.index')):
+ return totry
+ else:
+ return None
+
         return datadir

     def get_lhapdf_libdir(self):

Cheers,

Olivier

> On Nov 9, 2017, at 09:20, Zachary Marshall <email address hidden> wrote:
>
> Public bug reported:
>
> Hi,
>
> In MadGraph5_aMC@NLO 2.6.0, in
> madgraph/interface/common_run_interface.py on L3963 the
> get_lhapdf_pdfsetsdir function is defined. This function includes:
>
> # check if the LHAPDF_DATA_PATH variable is defined
> if 'LHAPDF_DATA_PATH' in os.environ.keys() and os.environ['LHAPDF_DATA_PATH']:
> datadir = os.environ['LHAPDF_DATA_PATH']
>
> This path is allowed to be a colon-separated series of paths (just like
> any other $PATH in the environment). That causes crashes when running
> with certain environments. Ultimately this leads to a crash on L3930 of
> madgraph/interface/common_run_interface.py:
>
> pdfsets_lines = \
> [l for l in open(pjoin(pdfsets_dir, 'pdfsets.index')).read().split('\n') if l.strip()]
>
> That needs to be able to handle the colon-separated path, and just
> search through for the first pdfsets.index file it finds.
>
> Thanks,
> Zach
>
> ** Affects: mg5amcnlo
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to
> MadGraph5_aMC@NLO.
> https://bugs.launchpad.net/bugs/1731176
>
> Title:
> LHAPDF path incorrectly set in 2.6.0
>
> Status in MadGraph5_aMC@NLO:
> New
>
> Bug description:
> Hi,
>
> In MadGraph5_aMC@NLO 2.6.0, in
> madgraph/interface/common_run_interface.py on L3963 the
> get_lhapdf_pdfsetsdir function is defined. This function includes:
>
> # check if the LHAPDF_DATA_PATH variable is defined
> if 'LHAPDF_DATA_PATH' in os.environ.keys() and os.environ['LHAPDF_DATA_PATH']:
> datadir = os.environ['LHAPDF_DATA_PATH']
>
> This path is allowed to be a colon-separated series of paths (just
> like any other $PATH in the environment). That causes crashes when
> running with certain environments. Ultimately this leads to a crash
> on L3930 of madgraph/interface/common_run_interface.py:
>
> pdfsets_lines = \
> [l for l in open(pjoin(pdfsets_dir, 'pdfsets.index')).read().split('\n') if l.strip()]
>
> That needs to be able to handle the colon-separated path, and just
> search through for the first pdfsets.index file it finds.
>
> Thanks,
> Zach
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.n...

Read more...

Revision history for this message
Zachary Marshall (zach-marshall) wrote :

Thanks Olivier! Can I ask what the timescale for the next release is? I just want to understand whether we should apply this privately or wait for 2.6.1.

Best,
Zach

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote : Re: [Bug 1731176] LHAPDF path incorrectly set in 2.6.0

Probably one or two week.

Olivier
> On Nov 9, 2017, at 19:05, Zachary Marshall <email address hidden> wrote:
>
> Thanks Olivier! Can I ask what the timescale for the next release is?
> I just want to understand whether we should apply this privately or wait
> for 2.6.1.
>
> Best,
> Zach
>
> --
> You received this bug notification because you are subscribed to
> MadGraph5_aMC@NLO.
> https://bugs.launchpad.net/bugs/1731176
>
> Title:
> LHAPDF path incorrectly set in 2.6.0
>
> Status in MadGraph5_aMC@NLO:
> New
>
> Bug description:
> Hi,
>
> In MadGraph5_aMC@NLO 2.6.0, in
> madgraph/interface/common_run_interface.py on L3963 the
> get_lhapdf_pdfsetsdir function is defined. This function includes:
>
> # check if the LHAPDF_DATA_PATH variable is defined
> if 'LHAPDF_DATA_PATH' in os.environ.keys() and os.environ['LHAPDF_DATA_PATH']:
> datadir = os.environ['LHAPDF_DATA_PATH']
>
> This path is allowed to be a colon-separated series of paths (just
> like any other $PATH in the environment). That causes crashes when
> running with certain environments. Ultimately this leads to a crash
> on L3930 of madgraph/interface/common_run_interface.py:
>
> pdfsets_lines = \
> [l for l in open(pjoin(pdfsets_dir, 'pdfsets.index')).read().split('\n') if l.strip()]
>
> That needs to be able to handle the colon-separated path, and just
> search through for the first pdfsets.index file it finds.
>
> Thanks,
> Zach
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mg5amcnlo/+bug/1731176/+subscriptions

Revision history for this message
Zachary Marshall (zach-marshall) wrote :

Hi Olivier,

Do you have a new estimate for the release time?

Thanks,
Zach

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Zach,

All the feature that was targeted for that version have now been validated and they all have been merged in a single version.
So the release will happen very soon. Maybe during the week-end (but a bit unlikely),
If we miss that time-slot, it will be for the end of next week —probably on thursday—
 (The reason for such gap is that I have only a 60% contract with the physics department and therefore I do work for some other department on Monday/Tuesday)

Cheers,

Olivier

> On Nov 30, 2017, at 13:27, Zachary Marshall <email address hidden> wrote:
>
> Hi Olivier,
>
> Do you have a new estimate for the release time?
>
> Thanks,
> Zach
>
> --
> You received this bug notification because you are subscribed to
> MadGraph5_aMC@NLO.
> https://bugs.launchpad.net/bugs/1731176
>
> Title:
> LHAPDF path incorrectly set in 2.6.0
>
> Status in MadGraph5_aMC@NLO:
> New
>
> Bug description:
> Hi,
>
> In MadGraph5_aMC@NLO 2.6.0, in
> madgraph/interface/common_run_interface.py on L3963 the
> get_lhapdf_pdfsetsdir function is defined. This function includes:
>
> # check if the LHAPDF_DATA_PATH variable is defined
> if 'LHAPDF_DATA_PATH' in os.environ.keys() and os.environ['LHAPDF_DATA_PATH']:
> datadir = os.environ['LHAPDF_DATA_PATH']
>
> This path is allowed to be a colon-separated series of paths (just
> like any other $PATH in the environment). That causes crashes when
> running with certain environments. Ultimately this leads to a crash
> on L3930 of madgraph/interface/common_run_interface.py:
>
> pdfsets_lines = \
> [l for l in open(pjoin(pdfsets_dir, 'pdfsets.index')).read().split('\n') if l.strip()]
>
> That needs to be able to handle the colon-separated path, and just
> search through for the first pdfsets.index file it finds.
>
> Thanks,
> Zach
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mg5amcnlo/+bug/1731176/+subscriptions

Revision history for this message
Zachary Marshall (zach-marshall) wrote :

Hi Olivier,

Sorry to be a pain, but I just want to double-check that 2.6.1 is on track for today -- we have many excited users champing at the bit for this one!

Thanks,
Zach

Changed in mg5amcnlo:
status: New → 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.