Error: gen_ximprove_share object has no attribute cmd when running gridpack

Asked by Joshua Lin

I've been following this guide on how to use a gridpack:
https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/GridDevelopment

So I have generated a gridpack; moved it to a separate directory and unpacked it to get the folder madevent, as well as run.sh as per the instructions. I then compiled the package (by running ./bin/compile in madevent folder), and then attempted to run the 'run.sh' file. However, I encountered the following error:

./run.sh 100 100
Now generating 100 events with random seed 100 and granularity 1
WRITE GRIDCARD /home/GRIDPACK/madevent
P0_gg_hg
P0_gq_hq
P0_qq_hg
/home/GRIDPACK/madevent/bin/internal/gen_ximprove.py:798: DeprecationWarning: object.__new__() takes no parameters
  return super(gen_ximprove, cls).__new__(gen_ximprove_share, cmd, opt)
Traceback (most recent call last):
  File "./madevent/bin/gridrun", line 86, in <module>
    cmd_line = cmd_interface.GridPackCmd(me_dir=root_path, nb_event=args[0], seed=args[1], gran=args[2])
  File "/home/GRIDPACK/madevent/bin/internal/madevent_interface.py", line 6315, in __init__
    self.launch(nb_event, seed)
  File "/home/GRIDPACK/madevent/bin/internal/madevent_interface.py", line 6410, in launch
    self.refine4grid(nb_event)
  File "/home/GRIDPACK/madevent/bin/internal/madevent_interface.py", line 6442, in refine4grid
    x_improve.launch() # create the ajob for the refinment and run those!
  File "/home/GRIDPACK/madevent/bin/internal/gen_ximprove.py", line 858, in launch
    self.results = sum_html.collect_result(self.cmd,
AttributeError: 'gen_ximprove_share' object has no attribute 'cmd'
mv: cannot stat `./Events/GridRun_100/unweighted_events.lhe.gz': No such file or directory
write ./events.lhe.gz

I'm not sure what to do with this error; any help on this matter is greatly appreciated.

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Luca (cadaluca90) said :
#1

Hello,

in case it can help to debug the issue, I am also experiencing the same error reported by Joshua.
It happens for the generation of a different process (pp > HH + 0/1/2 jet).
Please let me know if this is known or if some input is needed (for example the gridpack for inspection).

Thanks in advance for you help!

Cheers,
Luca

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

Hi,

1) I do not reproduce such issue.
2) I do not see how such error is actually possible

The only option that I can imagine is that such issue is actually already solved.
Which version of the code are you using?

Cheers,

Olivier

> On 28 Feb 2018, at 10:11, Luca <email address hidden> wrote:
>
> Question #664986 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/664986
>
> Luca posted a new comment:
> Hello,
>
> in case it can help to debug the issue, I am also experiencing the same error reported by Joshua.
> It happens for the generation of a different process (pp > HH + 0/1/2 jet).
> Please let me know if this is known or if some input is needed (for example the gridpack for inspection).
>
> Thanks in advance for you help!
>
> Cheers,
> Luca
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Joshua Lin (joshuazlin) said :
#3

Hello,

I am using Madgraph v2.6.1
I looked through the code; and have found a temporary solution. After unpacking the gridpack; I edited the code in
/madevent/bin/internal/gen_ximprove.py
on line 797; we have a block of code

797 if cmd.proc_characteristics['loop_induced']:
798 return super(gen_ximprove, cls).__new__(gen_ximprove_share, cmd, opt)
799 elif gen_ximprove.format_variable(cmd.run_card['gridpack'], bool):
800 return super(gen_ximprove, cls).__new__(gen_ximprove_gridpack, cmd, opt)
801 elif cmd.run_card["job_strategy"] == 2:
802 return super(gen_ximprove, cls).__new__(gen_ximprove_share, cmd, opt)
803 else:
804 return super(gen_ximprove, cls).__new__(gen_ximprove_v4, cmd, opt)

In the lines shown above; I commented out lines 797, 798, and now the gridpack runs properly (though I am not sure if the results are what we expect). To me; it seems like having loop_induced mode on would cause the above code to create a gen_ximprove_share; though we wanted a gen_ximprove_gridpack instead?

Revision history for this message
Luca (cadaluca90) said :
#4

Hello Oliver,

same for me, I am using a gridpack that I produced with MG5_aMC_v2_6_1, running it in a SL6 release using Python 2.7.11.
Indeed as pointed out by Joshua the error happens only for loop induced processes, while the running works fine for another LO sample that I produced with the very same setup.
Joshua's fix works, but can you confirm that the results that we obtain is correct?

Thanks,
Luca

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

Hi,

Since you were not mentionning it, I was guessing that it was normal LO (via heft model).
Ok, I reproduce the problem now. I'm investigating it

Cheers,

Olivier

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

ok your fix should be ok as far as I can think.
This is obviously not the correct fix which is the following one:

=== modified file 'madgraph/madevent/gen_ximprove.py'
--- madgraph/madevent/gen_ximprove.py 2017-12-11 23:43:19 +0000
+++ madgraph/madevent/gen_ximprove.py 2018-03-01 15:37:01 +0000
@@ -1602,6 +1602,10 @@
     min_event_in_iter = 1000
     combining_job = sys.maxint

+ def __new__(cls, *args, **opts):
+
+ return super(gen_ximprove_v4, cls).__new__(cls, *args, **opts)
+
     def __init__(self, *args, **opts):

         self.ngran = -1

> On 28 Feb 2018, at 18:12, Luca <email address hidden> wrote:
>
> Question #664986 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/664986
>
> Luca posted a new comment:
> Hello Oliver,
>
> same for me, I am using a gridpack that I produced with MG5_aMC_v2_6_1, running it in a SL6 release using Python 2.7.11.
> Indeed as pointed out by Joshua the error happens only for loop induced processes, while the running works fine for another LO sample that I produced with the very same setup.
> Joshua's fix works, but can you confirm that the results that we obtain is correct?
>
> Thanks,
> Luca
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Luca (cadaluca90) said :
#7

Hello Olivier,
thanks for the reply.

However, I tried to take the original gen_ximprove.py script (without the modification suggested by Joshua) and add these two lines, but I get the same error.
Is there some extra step to follow?

Cheers,
Luca

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

Oops thanks for let me know,
I tried that one realise that it was failing fixing it locally and forget to change it in the release file.

The correct one is:

=== modified file 'madgraph/madevent/gen_ximprove.py'
--- madgraph/madevent/gen_ximprove.py 2017-12-11 23:43:19 +0000
+++ madgraph/madevent/gen_ximprove.py 2018-03-01 15:37:01 +0000
@@ -1602,6 +1602,10 @@
    min_event_in_iter = 1000
    combining_job = sys.maxint

+ def __new__(cls, *args, **opts):
+
+ return super(gen_ximprove, cls).__new__(cls, *args, **opts)
+
    def __init__(self, *args, **opts):

        self.ngran = -1

Thanks,

Olivier

> On 1 Mar 2018, at 19:22, Luca <email address hidden> wrote:
>
> Question #664986 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/664986
>
> Luca posted a new comment:
> Hello Olivier,
> thanks for the reply.
>
> However, I tried to take the original gen_ximprove.py script (without the modification suggested by Joshua) and add these two lines, but I get the same error.
> Is there some extra step to follow?
>
> Cheers,
> Luca
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Can you help with this problem?

Provide an answer of your own, or ask Joshua Lin for more information if necessary.

To post a message you must log in.