add_time_of_flight broken in recent releases

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

Bug Description

In 2.6.7, running:

bin/madevent time_of_flight_exec_card

with the card as:

add_time_of_flight run_01 --threshold=100.

Gives a crash:

Traceback (most recent call last):
  File "./bin/madevent", line 165, in <module>
    cmd_line = cmd_interface.MadEventCmdShell(force_run=True)
  File "/tmp/zmarshal/test0/run/PROC_AnoFree_NLO_simp_16_mt_0/bin/internal/madevent_interface.py", line 2108, in __init__
    CmdExtended.__init__(self, me_dir, options, *completekey, **stdin)
  File "/tmp/zmarshal/test0/run/PROC_AnoFree_NLO_simp_16_mt_0/bin/internal/madevent_interface.py", line 203, in __init__
    super(CmdExtended, self).__init__(me_dir, options, *arg, **opt)
  File "/cvmfs/atlas-nightlies.cern.ch/repo/sw/21.6/sw/lcg/releases/LCG_88/MCGenerators/madgraph5amc/2.6.7p3.atlas4/x86_64-slc6-gcc62-opt/madgraph/interface/common_run_interface.py", line 635, in __init__
    if os.path.isabs(me_dir):
  File "/cvmfs/atlas-nightlies.cern.ch/repo/sw/21.6/sw/lcg/releases/LCG_88/Python/2.7.13/x86_64-slc6-gcc62-opt/lib/python2.7/posixpath.py", line 54, in isabs
    return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'

This seems to be due to the default value of me_dir being passed down from the initial MadEventCmd call:

https://bazaar.launchpad.net/~madteam/mg5amcnlo/series2.0/view/head:/Template/LO/bin/madevent#L165

https://bazaar.launchpad.net/~madteam/mg5amcnlo/series2.0/view/head:/madgraph/interface/madevent_interface.py#L2104

Is there something we can do to get around this crash? Has the syntax changed?

Thanks,
Zach

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote : Re: [Bug 1860477] [NEW] add_time_of_flight broken in recent releases

Hi Zach,

I have just tested and did not reproduce this. I tested 2.7.0 released this morning, I'm going to try with 2.6.7.

Did you have try to use the parameter within the run_card? This should be an easy way to fix the issue.

Cheers,

Olivier

> On 21 Jan 2020, at 20:13, Zachary Marshall <email address hidden> wrote:
>
> add_time_of_flight run_01 --threshold=100.

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

Ok I do not reproduce it with 2.6.7 (not too surprised actually since I do not remember any related bug)

I think that I understand your issue which should be much more generic than this one.
If you look at the code, just above the crashing line you have the following:
        if me_dir is None and MADEVENT:
            me_dir = root_path

        if os.path.isabs(me_dir): # this crash complaining that me_dir is None

So clearly your issue (me_dir is None) should be catched by the if statement above.
However, in your case (contrary to the test on my laptop/cluster), The MADEVENT value is likely False.

This variable is simply setup like this:
try:
    import madgraph
except ImportError:
    MADEVENT = True
else:
    MADEVENT=False

So I guess that the issue is related to your PYTHONPATH.
One solution is likely to change your executable in that case and instead of using ./bin/madevent
you should use
the mg5_aMC executable and the following command:
launch PROCESS_PATH -i
add_time_of_flight run_01 --threshold=100.

Cheers,

Olivier

PS: remove the "and MADEVENT" in this case will be wrong in this case since root_path will not be your madevent directory.
PPS: Another question is for you to think if your really need/want to edit your PYTHONPATH obviously, if yes tell me, I will then need to review all the if MADEVENT and check if they are fine in this case.

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

Thanks Olivier -- your suggestion for using the original executable did the job!

Best,
Zach

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