comp.lang.ada
 help / color / mirror / Atom feed
From: Vincent LAFAGE <lafage@ipno.in2p3.fr>
Subject: Re: Parallel_Simulation
Date: Mon, 25 Feb 2013 18:17:23 +0100
Date: 2013-02-25T18:17:23+01:00	[thread overview]
Message-ID: <kgg6b2$kma$1@ccpntc8.in2p3.fr> (raw)
In-Reply-To: <nospam-A31E64.07402825022013@news.aioe.org>

Le 25/02/2013 13:40, John B. Matthews a écrit :
> In article <kgfdsp$tb0$1@ccpntc8.in2p3.fr>,
>  Vincent LAFAGE <lafage@ipno.in2p3.fr> wrote:
> 
>> I am interested in MonteCarlo simulation and I had translated a 
>> former F77 code to Ada with success, with the goal of parallelizing 
>> it, but one part in the algorithm still resists parallelization: the 
>> random number generator. I need the different worker to rely on 
>> independant random number generators.
>>
>> Then I found a precious example in
>>  RM-A-5-2 59., 60., 61.
>> that compiles smoothly.
>>
>> I will now attempt to check the independance of the sequence 
>> generated by each thread. But this kind of check is always more 
>> subtle than expected.
>>
>> I wonder whether there is a statement about the independance of such 
>> generator, in particular in the gnat implementation?
> 
> You should check your implementation's required documentation and any 
> statements on implementation advice. For example, GNAT includes a 
> comment in Ada.Numerics.Float_Random.ads, and the GNAT Reference Manual 
> says, "The generator period is sufficiently long for the first condition 
> here [A.5.2(47)] to hold true."

Thanks for the advice,
but the particular doesn't exactly fit my question.
I understand that the sequence is long enough.
But different seeds will in the end be different starting points along
the same sequence (well, at least for congruential generators, I still
have to confirm it for Mersenne Twister algorithm that is used).
And this would in turn lead to fine correlations between the sequences.

The best statement I have found until now is in gnat_rm-4.6.info:

*67*.  The minimum time interval between calls to the time-dependent
Reset procedure that are guaranteed to initiate different random number
sequences.  See A.5.2(45).
   The minimum period between reset calls to guarantee distinct series
of random numbers is one microsecond.

So I need to assert the delay between the reset of each worker in
   RM-A-5-2 60.
to be sure that there is at least one microsecond.

Would you think of another way?

Best regards
Vincent



  reply	other threads:[~2013-02-25 17:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 10:20 Parallel_Simulation Vincent LAFAGE
2013-02-25 12:40 ` Parallel_Simulation John B. Matthews
2013-02-25 17:17   ` Vincent LAFAGE [this message]
2013-02-25 18:18     ` Parallel_Simulation Shark8
2013-02-26  7:20       ` Parallel_Simulation Vincent LAFAGE
2013-02-25 18:30     ` Parallel_Simulation John B. Matthews
2013-02-26  7:13       ` Parallel_Simulation Vincent LAFAGE
2013-02-25 21:04     ` Parallel_Simulation Simon Wright
2013-02-25 21:40     ` Parallel_Simulation gautier_niouzes
2013-02-26  7:09     ` Parallel_Simulation Vincent LAFAGE
2013-02-28 11:47       ` Parallel_Simulation John B. Matthews
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox