RNG revisited

General OpenMP discussion

RNG revisited

Postby gideonsimpson » Mon Apr 22, 2013 3:51 pm

I know this has been discussed before, but I none of the previous posts seemed too satisfactory. Is there a generally accepted method for safely generating distinct pseudo random numbers within each thread?
gideonsimpson
 
Posts: 6
Joined: Sun Feb 22, 2009 8:39 pm

Re: RNG revisited

Postby MarkB » Tue Apr 23, 2013 4:41 am

Hi there,

There is a good discussion of this (with reference to implementation in the ACML library) here: http://developer.amd.com/tools/cpu-deve ... enerators/

Hope that helps,
Mark.
MarkB
 
Posts: 456
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Re: RNG revisited

Postby gideonsimpson » Wed Apr 24, 2013 4:05 pm

Conceptually, it was helpful. But I was really hoping to find an example of a simple & robust implementation of multiple streams.
gideonsimpson
 
Posts: 6
Joined: Sun Feb 22, 2009 8:39 pm

Re: RNG revisited

Postby MarkB » Thu Apr 25, 2013 2:35 am

I'm sorry, I'm not aware of a free implementation that does anything better than having threadprivate state and using different seeds.
MarkB
 
Posts: 456
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Re: RNG revisited

Postby gideonsimpson » Thu Apr 25, 2013 11:02 am

Do people have any general feelings on the quality of using distinct seeds on each thread, provided you use something relatively robust (Mersenne Twister) and the total number of threads is "small" (<100)?
gideonsimpson
 
Posts: 6
Joined: Sun Feb 22, 2009 8:39 pm

Re: RNG revisited

Postby MarkB » Thu Apr 25, 2013 12:07 pm

gideonsimpson wrote:Do people have any general feelings on the quality of using distinct seeds on each thread, provided you use something relatively robust (Mersenne Twister) and the total number of threads is "small" (<100)?


If you don't care about a very small (but non-zero) probability of having overlapping sequences on different threads, then Mersenne Twister with distinct random seeds should be fine.
MarkB
 
Posts: 456
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh


Return to Using OpenMP

Who is online

Users browsing this forum: Exabot [Bot] and 9 guests