Re: [Numpy-discussion] PRNGs and multi-threading

2009-08-21 Thread Sturla Molden
Xavier Saint-Mleux skrev: > Of course, the mathematically correct way would be to use a correct > jumpahead function, but all the implementations that I know of are GPL. > A recent article about this is: > > www.iro.umontreal.ca/~lecuyer/myftp/papers/jumpmt.pdf > > I know of no efficient "jumpa

Re: [Numpy-discussion] PRNGs and multi-threading

2009-08-21 Thread Xavier Saint-Mleux
Robert Kern wrote: > On Fri, Aug 21, 2009 at 20:50, Sturla Molden wrote: > >> Sturla Molden skrev: >> >>> It seems there is a special version of the Mersenne Twister for this. >>> The code is LGPL (annoying for SciPy but ok for me). >>> >> http://www.math.sci.hiroshima-u.ac.jp/~m-mat

Re: [Numpy-discussion] PRNGs and multi-threading

2009-08-21 Thread Robert Kern
On Fri, Aug 21, 2009 at 20:50, Sturla Molden wrote: > Sturla Molden skrev: >> It seems there is a special version of the Mersenne Twister for this. >> The code is LGPL (annoying for SciPy but ok for me). > > http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/DC/dgene.pdf >

Re: [Numpy-discussion] PRNGs and multi-threading

2009-08-21 Thread Sturla Molden
Sturla Molden skrev: > It seems there is a special version of the Mersenne Twister for this. > The code is LGPL (annoying for SciPy but ok for me). http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/DC/dgene.pdf Basically it encodes

Re: [Numpy-discussion] PRNGs and multi-threading

2009-08-21 Thread Sturla Molden
Robert Kern skrev: > As long as you use different seeds, I believe this is fine. The state > size of MT is so enormous that almost any reasonable use will not find > overlaps. > It seems there is a special version of the Mersenne Twister for this. The code is LGPL (annoying for SciPy but ok fo

Re: [Numpy-discussion] PRNGs and multi-threading

2009-08-21 Thread Sturla Molden
Robert Kern skrev: > Although you don't really have re-entrancy issues, you will usually > want one PRNG per thread for determinism. > I see... numpy.random.rand does not have re-entrancy issues because of the GIL, but I get indeterminism from the OS scheduling the threads. RandomState might n

Re: [Numpy-discussion] PRNGs and multi-threading

2009-08-21 Thread Robert Kern
On Fri, Aug 21, 2009 at 17:48, Sturla Molden wrote: > > I am not sure if this is the right place to discuss this issue. However, > I problem I keep running into in Monte Carlo simulations is generating > pseudorandom numbers with multiple threads. PRNGs such as the Mersenne > Twister keep an intern

[Numpy-discussion] PRNGs and multi-threading

2009-08-21 Thread Sturla Molden
I am not sure if this is the right place to discuss this issue. However, I problem I keep running into in Monte Carlo simulations is generating pseudorandom numbers with multiple threads. PRNGs such as the Mersenne Twister keep an internal state, which prevents the PRNG from being re-entrant a