numpy performance and random numbers

Carl Johan Rehn care02 at gmail.com
Sat Dec 19 17:57:15 EST 2009


On 19 Dec, 23:09, sturlamolden <sturlamol... at yahoo.no> wrote:
> On 19 Des, 22:58, sturlamolden <sturlamol... at yahoo.no> wrote:
>
> > If you pick two random states (using any PRNG), you need error-
> > checking that states are always unique, i.e. that each PRNG never
> > reaches the starting state of the other(s).
>
> Another note on this:
>
> Ideally, we would e.g. know how to find (analytically) MT states that
> are very far apart. But to my knowledge no such equation has been
> derived.
>
> But often in Monte Carlo simulations, the PRNG is not the dominant
> computational bottleneck. So we can simply start N PRNGs from N
> consequtive states, and for each PRNG only use every N-th pseudorandom
> deviate.

Thank you for pointing me to the short-period MT reference and
especially the reference on the CUDA-version of parallel MT (even
though I would have wished the author had included a benchmark
comparison in the report). This is a very interesting topic. I agree
that it may work to start PRNGs at distinct and different states, but
that bookkeeping may slow down the algorithm so that it is not worth
the effort. However, the CUDA-version sounds interesting and should be
easy enough to use in a practical application.

Carl



More information about the Python-list mailing list