1.4 beta5: Must "launch" be called from proper dirs?

Asked by Sho Iwamoto on 2011-11-28

Dear MadTeam,

In 1.4 beta5, we cannot call "launch" command from arbitrary directories, wheres 1.3.30 we could.
Is this a specification, or a bug?

That is:

cd fullpath/2/madgraph5/directory/
bin/mg5
mg5> generate p p > t t~; output ttbar; launch -f ttbar

would works quite well, but on the other hand,

cd ~
fullpath/2/madgraph5/directory/bin/mg5
mg5> generate p p > t t~; output ttbar #> works; directory "ttbar" generated.
mg5> launch -f ttbar

would halt on "launch" line with putting out some messages (attached as a comment).
Perhaps launch will work if we move as "cd ttbar", which is the very generated directory.

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
Olivier Mattelaer Edit question
Solved by:
Olivier Mattelaer
Solved:
2011-11-30
Last query:
2011-11-30
Last reply:
2011-11-30
Sho Iwamoto (misho) said : #1

================ERROR MESSAGE

Error gen_indexhtml-pl must be run from main or bin directory
load configuration from ttbar/bin/internal/me5_configuration.txt
Option nb_core from config file not understood
Option run_mode from config file not understood
Specified text editor "None" not valid.
generate_events run_01 -f
Will run in mode parton
Generating 10000 events with run name run_01
survey run_01
compile directory
Command "generate_events run_01 -f" interrupted with error:
OSError : [Errno 2] No such file or directory
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'ttbar/run_01_debug.log'.
Please attach this file to your report.

quit

Generation failed (no results.dat file found)
mg5>Error gen_indexhtml-pl must be run from main or bin directory
Error gen_indexhtml-pl must be run from main or bin directory

Thanks Sho,

This is clearly a bug.

I'll fix this.

Cheers,

Olivier

I'll close it when I have solve it.

Thanks a lot for your bug report

Ok this is fixed.

If you want me to make a new release on this. Just tell me.

Sho Iwamoto (misho) said : #5

Thanks for your quick reply and debug, but sorry the same problem still remains.

$ fullpath/2/madgraph5/directory/bin/mg5
mg5> generate p p > t t~; output ttbar; launch -f ttbar
would bump into other exceptions.

First:
# File "/home/misho/Library/HEP/MG_ME/madgraph5/madgraph/interface/madevent_interface.py", line 1197, in __init__
# subprocess.call(['%s/gen_cardhtml-pl' % self.dirbin], cwd=me_dir)
# (snip)
# OSError: [Errno 2] No such file or directory
here, me_dir is, say, "ttbar", and self.dirbin is "ttbar/bin/internal", thus MG5 tries to execute "ttbar/ttbar/bin/internal/gen_...", which fails. Similar exception raises, and so finally I modified the file as

+++ madgraph/interface/madevent_interface.py
@@ -1194,7 +1194,7 @@
- subprocess.call(['%s/gen_cardhtml-pl' % self.dirbin], cwd=me_dir)
+ subprocess.call(['bin/internal/gen_cardhtml-pl'], cwd=me_dir)
@@ -2583,8 +2583,10 @@
- out = subprocess.call([pjoin(self.dirbin, 'compile_Source')],
+ out = subprocess.call([pjoin("bin/internal",'compile_Source')],
@@ -2731,8 +2733,8 @@
- os.system('%s/gen_cardhtml-pl &> /dev/null' % (self.dirbin))
+ subprocess.call(['bin/internal/gen_cardhtml-pl'], cwd=self.me_dir)

However, here raised is another exception as appended the last, and I could not solve this exception.

For details, executing
$ fullpath/2/madgraph5/directory/bin/mg5
mg5> generate p p > t t~; output ttbar; launch -f ttbar
would give the exceptions.

================= log (ttbar/run_01_debug.log)
generate_events run_01
Traceback (most recent call last):
  File "/home/misho/Library/HEP/MG_ME/madgraph5/madgraph/interface/extended_cmd.py", line 204, in onecmd
    return cmd.Cmd.onecmd(self, line)
  File "/usr/lib/python2.6/cmd.py", line 219, in onecmd
    return func(arg)
  File "/home/misho/Library/HEP/MG_ME/madgraph5/madgraph/interface/madevent_interface.py", line 1547, in do_generate_events
    postcmd=False)
  File "/home/misho/Library/HEP/MG_ME/madgraph5/madgraph/interface/extended_cmd.py", line 242, in exec_cmd
    stop = cmd.Cmd.onecmd(current_interface, line)
  File "/usr/lib/python2.6/cmd.py", line 219, in onecmd
    return func(arg)
  File "/home/misho/Library/HEP/MG_ME/madgraph5/madgraph/interface/madevent_interface.py", line 1721, in do_survey
    self.monitor(run_type='All jobs submitted for survey')
  File "/home/misho/Library/HEP/MG_ME/madgraph5/madgraph/interface/madevent_interface.py", line 2529, in monitor
    stdout=subprocess.PIPE)
  File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Sorry for that, this seems to be due to the argument of launch. If you remove it it works

i.e. If you do
generate p p > t t~
output ttbar
launch -f

it works. (that's why I was saying that it was working)
in me_dir should be an absolute path.
I fixed this in my computer and it work.
Hope that it will be the same on your computer too.

Thanks,

Olivier

Sho Iwamoto (misho) said : #7

Thank you, it works on my PC.

I am a little leery of the log message
>
> The total cross-section is 0.55434E+03 +- 0.77891E+00 pb
> more information in /home/misho/hepexp/directsearch/tmp/ttbar/index.html
> mg5>Error gen_indexhtml-pl must be run from main or bin directory
>
, but anyway it works well with proper result.

Thanks a lot.

Sho Iwamoto (misho) said : #8

Thanks Olivier Mattelaer, that solved my question.