running madgraph

Asked by Andrew Levin

I have been generating events in madgraph by doing

python2.6 ./bin/mg5

and then responding to some questions. How can I do this in a batch job i.e. how can I do this without having to interactively answer questions?

Thanks.

Andrew

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

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

This FAQ should answer your question:

https://answers.launchpad.net/madgraph5/+faq/2186

Cheers,

Olivier
On Dec 17, 2013, at 6:16 AM, Andrew Levin <email address hidden> wrote:

> New question #240906 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/madgraph5/+question/240906
>
> I have been generating events in madgraph by doing
>
> python2.6 ./bin/mg5
>
> and then responding to some questions. How can I do this in a batch job i.e. how can I do this without having to interactively answer questions?
>
> Thanks.
>
> Andrew
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Andrew Levin (amlevin-g) said :
#2

When I do this

python2.6 ./bin/mg5_aMC gogo.mg5

with this in gogo.mg5

launch qed_2_qcd_99_ls0ls1_grid -f
set nevents 100
set iseed 2

it seems that it generates one run with 100 events, then another, then another, and it never stops. How can I make it stop?

Thanks.

Andrew

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

Hi Andrew,

First it looks like that they are something weird in your card:
> launch qed_2_qcd_99_ls0ls1_grid -f
the -f is to prevent the appearance of any question…
so the next two lines are irrelevant, since I expect that you should use those to answer the question ask by launch:
> set nevents 100
> set iseed 2

Otherwise I have test your command in my laptop and if finish correctly.

Could you put the log that you have on screen such that I can see what's going on?

Cheers,

Olivier

On Dec 20, 2013, at 10:11 AM, Andrew Levin <email address hidden> wrote:

> Question #240906 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/madgraph5/+question/240906
>
> Andrew Levin posted a new comment:
> When I do this
>
> python2.6 ./bin/mg5_aMC gogo.mg5
>
> with this in gogo.mg5
>
> launch qed_2_qcd_99_ls0ls1_grid -f
> set nevents 100
> set iseed 2
>
> it seems that it generates one run with 100 events, then another, then
> another, and it never stops. How can I make it stop?
>
> Thanks.
>
> Andrew
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Andrew Levin (amlevin-g) said :
#4

Hi,

I removed the -f. Now it works correctly when the reweight card is empty. However, when the reweight card looks like this

#******************************************************************
# Reweight Module *
#******************************************************************
# launch
#* Use the set command to specify the new set of parameter
#* Or specify a path to a valid param_card/banner
#* Example of valid command:
#* set aewm1 137
#* ~/param_card.dat
#*
#* Note:
#* 1) the value of alphas will be used from the event
#* so the value of the param_card is not taken into account.
#* 2) It is dangerous to change a mass of any particle.

#* If you want to compute the weight for more than one hyppothesis
#* you need first to uncomment the following line:
# launch
# and then use the set command to specify your parameter.
# All modification will start from the ORIGINAL card not from the
# last define one.
#* You can have as many weight as you want.

launch
        set anoinputs 1 0.000000e-11
        set anoinputs 2 0.500000e-11

I see the following output

[anlevin@t3btch107 2.0.0beta4]$ python2.6 ./bin/mg5_aMC gogo.mg5
Running MG5 in debug mode
************************************************************
* *
* W E L C O M E to *
* M A D G R A P H 5 _ a M C @ N L O *
* *
* *
* * * *
* * * * * *
* * * * * 5 * * * * *
* * * * * *
* * * *
* *
* VERSION 2.0.0.GM 2013-11-04 *
* *
* The MadGraph5_aMC@NLO Development Team - Find us at *
* https://server06.fynu.ucl.ac.be/projects/madgraph *
* and *
* http://amcatnlo.web.cern.ch/amcatnlo/ *
* *
* Type 'help' for in-line help. *
* Type 'tutorial' to learn how MG5 works *
* Type 'tutorial aMCatNLO' to learn how aMC@NLO works *
* Type 'tutorial MadLoop' to learn how MadLoop works *
* *
************************************************************
load MG5 configuration from input/mg5_configuration.txt
lhapdf-config does not seem to correspond to a valid lhapdf-config executable. Please enter the full PATH/TO/lhapdf-config (including lhapdf-config).
Note that you can still compile and run aMC@NLO with the built-in PDFs

fastjet-config does not seem to correspond to a valid fastjet-config executable (v3+). Please enter the full PATH/TO/fastjet-config (including fastjet-config).

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 /scratch/anlevin/madgraph_beta/2.0.0beta4/gogo.mg5
The import format was not given, so we guess it as command
launch qed_2_qcd_99_ls0ls1_grid
************************************************************
* *
* W E L C O M E to *
* M A D G R A P H 5 _ a M C @ N L O *
* M A D E V E N T *
* *
* * * *
* * * * * *
* * * * * 5 * * * * *
* * * * * *
* * * *
* *
* VERSION 2.0.0.GM 2013-11-04 *
* *
* The MadGraph5_aMC@NLO Development Team - Find us at *
* https://server06.fynu.ucl.ac.be/projects/madgraph *
* *
* Type 'help' for in-line help. *
* *
************************************************************
load configuration from /scratch/anlevin/madgraph_beta/2.0.0beta4/qed_2_qcd_99_ls0ls1_grid/Cards/me5_configuration.txt
load configuration from /scratch/anlevin/madgraph_beta/2.0.0beta4/input/mg5_configuration.txt
load configuration from /scratch/anlevin/madgraph_beta/2.0.0beta4/qed_2_qcd_99_ls0ls1_grid/Cards/me5_configuration.txt
Using default text editor "vi". Set another one in ./input/mg5_configuration.txt
generate_events run_30
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=ON
  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 nevents 100
INFO: modify parameter nevents of the run_card.dat to 100
set iseed 2
INFO: modify parameter iseed of the run_card.dat to 2
Do you want to edit a card (press enter to bypass editing)?
  1 / param : param_card.dat
  2 / run : run_card.dat
  3 / reweight : reweight_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.
 [0, done, 1, param, 2, run, 3, reweight, enter path]
The answer to the previous question is not set in your input file
Use 0 value
Generating 100 events with run name run_30
survey run_30
INFO: compile directory
run_card missed argument xmtcentral. Takes default: 0.0
run_card missed argument d. Takes default: 1.0
run_card missed argument gridrun. Takes default: False
run_card missed argument gevents. Takes default: 2000
run_card missed argument fixed_couplings. Takes default: True
Since icckw>0, We change the value of 'drjj' to 0
Since icckw>0, We change the value of 'drjl' to 0
mmjj > xqcut (and auto_ptj_mjj = F). MMJJ set to 0
run_card missed argument lhaid. Takes default: 10042
write compile file for card: /scratch/anlevin/madgraph_beta/2.0.0beta4/qed_2_qcd_99_ls0ls1_grid/Cards/param_card.dat
Error: no display specified
Using random number seed offset = 2
INFO: Running Survey
Creating Jobs
Working on SubProcesses
    P0_qq_wpwpqq_wp_lvl_wp_lvl
    P0_qq_wpwpqq_wp_lvl_wp_tapvl
    P0_qq_wpwpqq_wp_tapvl_wp_tapvl
INFO: Idle: 0, Running: 12, Completed: 0 [ current time: 05h35 ]
INFO: Idle: 0, Running: 11, Completed: 1 [ 35s ]
INFO: Idle: 0, Running: 10, Completed: 2 [ 59.3s ]
INFO: Idle: 0, Running: 9, Completed: 3 [ 1m 4s ]
INFO: Idle: 0, Running: 8, Completed: 4 [ 1m 44s ]
INFO: Idle: 0, Running: 7, Completed: 5 [ 2m 9s ]
INFO: Idle: 0, Running: 6, Completed: 6 [ 2m 23s ]
INFO: Idle: 0, Running: 5, Completed: 7 [ 3m 2s ]
INFO: Idle: 0, Running: 4, Completed: 8 [ 3m 34s ]
INFO: Idle: 0, Running: 3, Completed: 9 [ 3m 57s ]
INFO: Idle: 0, Running: 2, Completed: 10 [ 4m 1s ]
INFO: Idle: 0, Running: 1, Completed: 11 [ 4m 19s ]
INFO: Idle: 0, Running: 0, Completed: 12 [ 13m 11s ]
INFO: End survey
refine 100
INFO: compile directory
Since icckw>0, We change the value of 'drjj' to 0
Since icckw>0, We change the value of 'drjl' to 0
mmjj > xqcut (and auto_ptj_mjj = F). MMJJ set to 0
write compile file for card: /scratch/anlevin/madgraph_beta/2.0.0beta4/qed_2_qcd_99_ls0ls1_grid/Cards/param_card.dat
Creating Jobs
INFO: Refine results to 100
    P0_qq_wpwpqq_wp_lvl_wp_lvl
    P0_qq_wpwpqq_wp_lvl_wp_tapvl
    P0_qq_wpwpqq_wp_tapvl_wp_tapvl
INFO: Combining runs
INFO: finish refine
refine 100
Creating Jobs
INFO: Refine results to 100
    P0_qq_wpwpqq_wp_lvl_wp_lvl
    P0_qq_wpwpqq_wp_lvl_wp_tapvl
    P0_qq_wpwpqq_wp_tapvl_wp_tapvl
INFO: Combining runs
INFO: finish refine
combine_events
INFO: Combining Events
  === Results Summary for run: run_30 tag: tag_1 ===

     Cross-section : 0.008822 +- 0.0001147 pb
     Nb of events : 100

running syscalc on mode parton
store_events
INFO: Storing parton level results
INFO: End Parton
reweight -from_cards
INFO: Extracting the banner ...
INFO: process: p p > w+ w+ p p QED=2 QCD=99, w+ > l+ vl
INFO: options:
INFO: Running Reweight
exit

launch
INFO: detected model: SM_LS0_LS1_UFO. Loading...
INFO: generating the square matrix element for reweighting
INFO: generate p p > w+ w+ p p QED=2 QCD=99, w+ > l+ vl ;add process p p > w- w- p p QED=2 QCD=99, w- > l- vl~ ;
INFO: Done 123
set anoinputs 1 0.000000e-11
INFO: modify param_card information BLOCK anoinputs with id (1,) set to 0.0
set anoinputs 2 0.500000e-11
INFO: modify param_card information BLOCK anoinputs with id (2,) set to 5e-12
Do you want to edit a card (press enter to bypass editing)?
  1 / param : param_card.dat
  9 / plot : plot_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.
 [0, done, 1, param, 9, plot, enter path]
The answer to the previous question is not set in your input file
Use 0 value
Command "generate_events run_30" interrupted with error:
InvalidCmd : original card and new card are identical
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in '/scratch/anlevin/madgraph_beta/2.0.0beta4/qed_2_qcd_99_ls0ls1_grid/run_30_tag_1_debug.log'.
Please attach this file to your report.
INFO: storring files of Previous run
INFO: Done
INFO:

INFO: Original cross-section: 0.00868285214 +- 0.000112890857 pb
INFO: Computed cross-section:
quit
INFO:

quit

Thanks

Andrew

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

Hi Andrew,

I don't see any infinite loop in your log.
It seems to work as expected (including the safety crash at the end of your log, which occurs since your original param_card is identical to one that you use for reweighting).

Cheers,

Olivier

PS: you don't need to regenerate the events to run the reweighing. (with probably much sensitive value for that reweighing)
you just have to do:
./bin/mg5_aMC
launch qed_2_qcd_99_ls0ls1_grid -i
reweight
(edit the card)

On Dec 20, 2013, at 11:56 AM, Andrew Levin <email address hidden> wrote:

> Question #240906 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/madgraph5/+question/240906
>
> Andrew Levin posted a new comment:
> Hi,
>
> I removed the -f. Now it works correctly when the reweight card is
> empty. However, when the reweight card looks like this
>
> #******************************************************************
> # Reweight Module *
> #******************************************************************
> # launch
> #* Use the set command to specify the new set of parameter
> #* Or specify a path to a valid param_card/banner
> #* Example of valid command:
> #* set aewm1 137
> #* ~/param_card.dat
> #*
> #* Note:
> #* 1) the value of alphas will be used from the event
> #* so the value of the param_card is not taken into account.
> #* 2) It is dangerous to change a mass of any particle.
>
>
> #* If you want to compute the weight for more than one hyppothesis
> #* you need first to uncomment the following line:
> # launch
> # and then use the set command to specify your parameter.
> # All modification will start from the ORIGINAL card not from the
> # last define one.
> #* You can have as many weight as you want.
>
> launch
> set anoinputs 1 0.000000e-11
> set anoinputs 2 0.500000e-11
>
> I see the following output
>
> [anlevin@t3btch107 2.0.0beta4]$ python2.6 ./bin/mg5_aMC gogo.mg5
> Running MG5 in debug mode
> ************************************************************
> * *
> * W E L C O M E to *
> * M A D G R A P H 5 _ a M C @ N L O *
> * *
> * *
> * * * *
> * * * * * *
> * * * * * 5 * * * * *
> * * * * * *
> * * * *
> * *
> * VERSION 2.0.0.GM 2013-11-04 *
> * *
> * The MadGraph5_aMC@NLO Development Team - Find us at *
> * https://server06.fynu.ucl.ac.be/projects/madgraph *
> * and *
> * http://amcatnlo.web.cern.ch/amcatnlo/ *
> * *
> * Type 'help' for in-line help. *
> * Type 'tutorial' to learn how MG5 works *
> * Type 'tutorial aMCatNLO' to learn how aMC@NLO works *
> * Type 'tutorial MadLoop' to learn how MadLoop works *
> * *
> ************************************************************
> load MG5 configuration from input/mg5_configuration.txt
> lhapdf-config does not seem to correspond to a valid lhapdf-config executable. Please enter the full PATH/TO/lhapdf-config (including lhapdf-config).
> Note that you can still compile and run aMC@NLO with the built-in PDFs
>
> fastjet-config does not seem to correspond to a valid fastjet-config
> executable (v3+). Please enter the full PATH/TO/fastjet-config
> (including fastjet-config).
>
> 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 /scratch/anlevin/madgraph_beta/2.0.0beta4/gogo.mg5
> The import format was not given, so we guess it as command
> launch qed_2_qcd_99_ls0ls1_grid
> ************************************************************
> * *
> * W E L C O M E to *
> * M A D G R A P H 5 _ a M C @ N L O *
> * M A D E V E N T *
> * *
> * * * *
> * * * * * *
> * * * * * 5 * * * * *
> * * * * * *
> * * * *
> * *
> * VERSION 2.0.0.GM 2013-11-04 *
> * *
> * The MadGraph5_aMC@NLO Development Team - Find us at *
> * https://server06.fynu.ucl.ac.be/projects/madgraph *
> * *
> * Type 'help' for in-line help. *
> * *
> ************************************************************
> load configuration from /scratch/anlevin/madgraph_beta/2.0.0beta4/qed_2_qcd_99_ls0ls1_grid/Cards/me5_configuration.txt
> load configuration from /scratch/anlevin/madgraph_beta/2.0.0beta4/input/mg5_configuration.txt
> load configuration from /scratch/anlevin/madgraph_beta/2.0.0beta4/qed_2_qcd_99_ls0ls1_grid/Cards/me5_configuration.txt
> Using default text editor "vi". Set another one in ./input/mg5_configuration.txt
> generate_events run_30
> 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=ON
> 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 nevents 100
> INFO: modify parameter nevents of the run_card.dat to 100
> set iseed 2
> INFO: modify parameter iseed of the run_card.dat to 2
> Do you want to edit a card (press enter to bypass editing)?
> 1 / param : param_card.dat
> 2 / run : run_card.dat
> 3 / reweight : reweight_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.
> [0, done, 1, param, 2, run, 3, reweight, enter path]
> The answer to the previous question is not set in your input file
> Use 0 value
> Generating 100 events with run name run_30
> survey run_30
> INFO: compile directory
> run_card missed argument xmtcentral. Takes default: 0.0
> run_card missed argument d. Takes default: 1.0
> run_card missed argument gridrun. Takes default: False
> run_card missed argument gevents. Takes default: 2000
> run_card missed argument fixed_couplings. Takes default: True
> Since icckw>0, We change the value of 'drjj' to 0
> Since icckw>0, We change the value of 'drjl' to 0
> mmjj > xqcut (and auto_ptj_mjj = F). MMJJ set to 0
> run_card missed argument lhaid. Takes default: 10042
> write compile file for card: /scratch/anlevin/madgraph_beta/2.0.0beta4/qed_2_qcd_99_ls0ls1_grid/Cards/param_card.dat
> Error: no display specified
> Using random number seed offset = 2
> INFO: Running Survey
> Creating Jobs
> Working on SubProcesses
> P0_qq_wpwpqq_wp_lvl_wp_lvl
> P0_qq_wpwpqq_wp_lvl_wp_tapvl
> P0_qq_wpwpqq_wp_tapvl_wp_tapvl
> INFO: Idle: 0, Running: 12, Completed: 0 [ current time: 05h35 ]
> INFO: Idle: 0, Running: 11, Completed: 1 [ 35s ]
> INFO: Idle: 0, Running: 10, Completed: 2 [ 59.3s ]
> INFO: Idle: 0, Running: 9, Completed: 3 [ 1m 4s ]
> INFO: Idle: 0, Running: 8, Completed: 4 [ 1m 44s ]
> INFO: Idle: 0, Running: 7, Completed: 5 [ 2m 9s ]
> INFO: Idle: 0, Running: 6, Completed: 6 [ 2m 23s ]
> INFO: Idle: 0, Running: 5, Completed: 7 [ 3m 2s ]
> INFO: Idle: 0, Running: 4, Completed: 8 [ 3m 34s ]
> INFO: Idle: 0, Running: 3, Completed: 9 [ 3m 57s ]
> INFO: Idle: 0, Running: 2, Completed: 10 [ 4m 1s ]
> INFO: Idle: 0, Running: 1, Completed: 11 [ 4m 19s ]
> INFO: Idle: 0, Running: 0, Completed: 12 [ 13m 11s ]
> INFO: End survey
> refine 100
> INFO: compile directory
> Since icckw>0, We change the value of 'drjj' to 0
> Since icckw>0, We change the value of 'drjl' to 0
> mmjj > xqcut (and auto_ptj_mjj = F). MMJJ set to 0
> write compile file for card: /scratch/anlevin/madgraph_beta/2.0.0beta4/qed_2_qcd_99_ls0ls1_grid/Cards/param_card.dat
> Creating Jobs
> INFO: Refine results to 100
> P0_qq_wpwpqq_wp_lvl_wp_lvl
> P0_qq_wpwpqq_wp_lvl_wp_tapvl
> P0_qq_wpwpqq_wp_tapvl_wp_tapvl
> INFO: Combining runs
> INFO: finish refine
> refine 100
> Creating Jobs
> INFO: Refine results to 100
> P0_qq_wpwpqq_wp_lvl_wp_lvl
> P0_qq_wpwpqq_wp_lvl_wp_tapvl
> P0_qq_wpwpqq_wp_tapvl_wp_tapvl
> INFO: Combining runs
> INFO: finish refine
> combine_events
> INFO: Combining Events
> === Results Summary for run: run_30 tag: tag_1 ===
>
> Cross-section : 0.008822 +- 0.0001147 pb
> Nb of events : 100
>
> running syscalc on mode parton
> store_events
> INFO: Storing parton level results
> INFO: End Parton
> reweight -from_cards
> INFO: Extracting the banner ...
> INFO: process: p p > w+ w+ p p QED=2 QCD=99, w+ > l+ vl
> INFO: options:
> INFO: Running Reweight
> exit
>
> launch
> INFO: detected model: SM_LS0_LS1_UFO. Loading...
> INFO: generating the square matrix element for reweighting
> INFO: generate p p > w+ w+ p p QED=2 QCD=99, w+ > l+ vl ;add process p p > w- w- p p QED=2 QCD=99, w- > l- vl~ ;
> INFO: Done 123
> set anoinputs 1 0.000000e-11
> INFO: modify param_card information BLOCK anoinputs with id (1,) set to 0.0
> set anoinputs 2 0.500000e-11
> INFO: modify param_card information BLOCK anoinputs with id (2,) set to 5e-12
> Do you want to edit a card (press enter to bypass editing)?
> 1 / param : param_card.dat
> 9 / plot : plot_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.
> [0, done, 1, param, 9, plot, enter path]
> The answer to the previous question is not set in your input file
> Use 0 value
> Command "generate_events run_30" interrupted with error:
> InvalidCmd : original card and new card are identical
> Please report this bug on https://bugs.launchpad.net/madgraph5
> More information is found in '/scratch/anlevin/madgraph_beta/2.0.0beta4/qed_2_qcd_99_ls0ls1_grid/run_30_tag_1_debug.log'.
> Please attach this file to your report.
> INFO: storring files of Previous run
> INFO: Done
> INFO:
>
> INFO: Original cross-section: 0.00868285214 +- 0.000112890857 pb
> INFO: Computed cross-section:
> quit
> INFO:
>
> quit
>
> Thanks
>
> Andrew
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Andrew Levin (amlevin-g) said :
#6

Thanks.

Indeed I was incorrectly using the same parameters in the reweight file.

Revision history for this message
Andrew Levin (amlevin-g) said :
#7

Is it possible to specify the name of the run (instead of just having it called run_01, run_02, etc, ...)?

Otherwise I am not sure how I can submit batch jobs to generate events, since many of them would try to create the same run I think.

Thanks.

Andrew

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

Hi Andrew,

1) You can't have two run simultaneously running in the same directory.
2) the way to run on grid/cluster is either by configuring MadEvent to be on cluster mode (such that it submit on the cluster on not on local path). Another possibility is to use the gridpack mode: https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/GridDevelopment

Cheers,

Olivier

Revision history for this message
Andrew Levin (amlevin-g) said :
#9

Thanks.

Also, is it possible to change the number of madevent processes that are run simultaneously?

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

Depends on what you means by madevent processes.

The rule is that only one executable ./bin/generate_events (or the equivalent launch command from the mg5 interface)
should run at the same time in a given directory.

If you want to change the number of core that are allowed to be used by the madevent in such run, then this is possible.

Cheers,

Olivier

Revision history for this message
Andrew Levin (amlevin-g) said :
#11

Sorry, I mean cores. I tried to ran batch jobs that each run ./bin/mg5_aMC and many of them went to the same machine and started 200 madevent processes on that machine :)

I am recreating the directory for each job.

By the way, I am trying to generate a large number of events (like 1M) (and also doing reweighting on each event). Is it correct that I can do this by generating 100 events ./bin/mg5_aMC at a time, and then merging all of the lhe files? This should correctly sample the phase space, right?

Revision history for this message
Andrew Levin (amlevin-g) said :
#12

just a correction: it should be

100 events with ./bin/mg5_aMC

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

Hi Andrew,

You can limit the number of core by doing.
./bin/mg5_aMC
set nb_core X
This will be store for all future use.

You can run in different directory (different output name).
But then you need to assign manually the seed in the run_card otherwise each directory will generate exactly the same event set.

Cheers,

Olivier

Revision history for this message
Andrew Levin (amlevin-g) said :
#14

OK. Also, if I generate 100 events, is the cross section less accurate than if I generate 100000 events?

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

Yes it will be.

But if you generate 100 samples of 10000 events, it should have in principle the same precision than one sample of 100*10000 events.
(After combining the cross-section).

Note that generating a sample of less than 10k is quite often a bad idea in term of speed optimization.
Since the overhead and the computation of sub-dominant channel will then kill you.

In fact generating 100 events or 1000 events takes exactly the same time in 99% of the case.
This is still the case (most of the time) for 10k events.

Cheers,

Olivier

On Jan 6, 2014, at 4:36 PM, Andrew Levin <email address hidden> wrote:

> Question #240906 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/madgraph5/+question/240906
>
> Andrew Levin posted a new comment:
> OK. Also, if I generate 100 events, is the cross section less accurate
> than if I generate 100000 events?
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Andrew Levin (amlevin-g) said :
#16

Hi,

Then I am worried about the weights. The weight (XWGTUP) is equal to the xs divided by the number of events, right? So, this means that if I generate 100 events, reweight them, and then combine them that the reweights will not be very accurate, right?

I am reweighting each event 80 times, so it is not very feasible to do this much more than 100 events per job I think.

Andrew

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

I never study such merge carefully, but
We have a code to handle such merging:
Template/LO/bin/internal/merge.pl
you can take a look if you want.

But I think that the basic idea is that the cross-section of the total sample is the average of the cross-section of
each individual sample. The fluctuation being linked to statistical fluctuation.
The same is for the weight, you can just replace the weight by the average one for all events.

Cheers,

Olivier

On Jan 6, 2014, at 6:16 PM, Andrew Levin <email address hidden> wrote:

> Question #240906 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/madgraph5/+question/240906
>
> Andrew Levin posted a new comment:
> Hi,
>
> Then I am worried about the weights. The weight (XWGTUP) is equal to the
> xs divided by the number of events, right? So, this means that if I
> generate 100 events, reweight them, and then combine them that the
> reweights will not be very accurate, right?
>
> I am reweighting each event 80 times, so it is not very feasible to do
> this much more than 100 events per job I think.
>
> Andrew
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Andrew Levin (amlevin-g) said :
#18

ok, but I guess we also need to change the reweights when we merge the lhe files, they should be for each event and for each reweight

new reweight = old reweight * (new XWGTUP / old XWGTUP)

right?

also, how do you recommend that we check that there are not phase space issues when we use this reweighting?

i.e. how do you recommend we check if the reweighted samples are similar to those you would get by generating a separate sample for each parameter choice?

thanks

Andrew

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

Hi Andrew,

> Andrew Levin posted a new comment:
> ok, but I guess we also need to change the reweights when we merge the
> lhe files, they should be for each event and for each reweight
>
> new reweight = old reweight * (new XWGTUP / old XWGTUP)
>
> right?

I think that both option with and without changing the weight makes sense.

> i.e. how do you recommend we check if the reweighted samples are similar
> to those you would get by generating a separate sample for each
> parameter choice?

Sample of 100 event are clearly too small for such purpose.
CMS did that with various sub-sample of 100k events.
checking that each sub-sample produce the correct distributions.

Cheers,

Olivier

On Jan 7, 2014, at 2:46 AM, Andrew Levin <email address hidden> wrote:

> Question #240906 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/madgraph5/+question/240906
>
> Andrew Levin posted a new comment:
> ok, but I guess we also need to change the reweights when we merge the
> lhe files, they should be for each event and for each reweight
>
> new reweight = old reweight * (new XWGTUP / old XWGTUP)
>
> right?
>
> also, how do you recommend that we check that there are not phase space
> issues when we use this reweighting?
>
> i.e. how do you recommend we check if the reweighted samples are similar
> to those you would get by generating a separate sample for each
> parameter choice?
>
> thanks
>
> Andrew
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Andrew Levin (amlevin-g) said :
#20

ok, I think then I have to do this:

generate 100K events

in 80 jobs reweight the 100K events

combine the 80 reweighted files into one file with all of the reweights (I will need to write a script to do this)

I think with this way we can avoid the problem of having to change any weights after the generation

Revision history for this message
Andrew Levin (amlevin-g) said :
#21

sorry, after thinking about this more, I am not sure I understand why it is not necessary to generate the events in large subsamples

jf we use

W_new/W_old = |M_new|/M_old

as the weight for each event why would this depend on the size of the subsamples that are merged together to make the final sample?

thanks

Andrew

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

Hi Andrew,

Here I'm start to be confuse about what you are doing.
Looks like that you are not speaking about merging of various samples generated with various seed.
Do you?

If so what is M_new and M_old, I don't see how you associate two matrix-element to a single event...

Cheers,

Olivier

Revision history for this message
Andrew Levin (amlevin-g) said :
#23

I am speaking of merging various samples generated with different seeds.

M_new and M_old are defined here

https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Reweight

(near the top above "Technical Details")

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

Hi Andrew,

My point is just that a small sub-sample didn't allow comparison of distribution. Which is what you need right?

Cheers,

Olivier

Revision history for this message
Andrew Levin (amlevin-g) said :
#25

But why do we need to compare the distribution for a subsample?

We can compare the distribution for the full sample.

When I say subsample I mean what is produced in a single batch job i.e. 100 events with 80 reweights per event.

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

Oh Sure, no problem.

On Jan 8, 2014, at 9:21 AM, Andrew Levin <email address hidden> wrote:

> Question #240906 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/madgraph5/+question/240906
>
> Andrew Levin posted a new comment:
> But why do we need to compare the distribution for a subsample?
>
> We can compare the distribution for the full sample.
>
> When I say subsample I mean what is produced in a single batch job i.e.
> 100 events with 80 reweights per event.
>
> --
> 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 Andrew Levin for more information if necessary.

To post a message you must log in.