Same random seed in gridpack

Asked by Baptiste Ravina

Hi, having generated a gridpack and running
./run.sh <nevents> <iseed>
I observe that two consecutive executions give rise to different outputs. I realise this might indeed be the intended behaviour, in order to generate independent datasets each time. However in my particular case I need to keep track of the random numbers used each time.
How can I modify the contents of the gridpack such that running
./run.sh <nevents> <iseed>
twice generates the same output, but
./run.sh <nevents> <iseed>
./run.sh <nevents> <iseed+1>
doesn't?
Effectively, how do I make sure the only random seed ever used in the generation of events is the iseed?

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Which version of the code are you using?

Cheers,

Olivier

> On 10 Apr 2020, at 00:47, Baptiste Ravina <email address hidden> wrote:
>
> New question #689812 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/689812
>
> Hi, having generated a gridpack and running
> ./run.sh <nevents> <iseed>
> I observe that two consecutive executions give rise to different outputs. I realise this might indeed be the intended behaviour, in order to generate independent datasets each time. However in my particular case I need to keep track of the random numbers used each time.
> How can I modify the contents of the gridpack such that running
> ./run.sh <nevents> <iseed>
> twice generates the same output, but
> ./run.sh <nevents> <iseed>
> ./run.sh <nevents> <iseed+1>
> doesn't?
> Effectively, how do I make sure the only random seed ever used in the generation of events is the iseed?
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Baptiste Ravina (bravina) said :
#2

Hi Olivier, I'm using the latest version 2.7.2.

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

Not expected then.
I always consider than the more randomness you get the better it is but I will take a look.

Cheers,

Olivier

> On 10 Apr 2020, at 11:03, Baptiste Ravina <email address hidden> wrote:
>
> Question #689812 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/689812
>
> Status: Answered => Open
>
> Baptiste Ravina is still having a problem:
> Hi Olivier, I'm using the latest version 2.7.2.
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

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

Hi,

Here you will find all the information that you might need:
 - a link to a patch
 - a link to a dedicated tarball including the patch
 - more
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/296

The issue was double:
 - the argument python_seed of the run_card was not handle and therefore python code was using the default seed (which is related to the time where your code starts)
 - the restore_data script was not fully restoring the state as it should which was leading to small variation of cross-section (but not of distribution)

I guess that CMS and ATLAS never noticed the second issue since they typically start by unpacking the gridpack.
The first issue is more recent.

Cheers,

Olivier

Revision history for this message
Baptiste Ravina (bravina) said :
#5

Hi Olivier,

The patch worked - thanks a lot! Will these changes be included in 2.7.3?

Cheers,
Baptiste

Revision history for this message
Baptiste Ravina (bravina) said :
#6

Thanks Olivier Mattelaer, that solved my question.

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

Yes it will be