[Numpy-discussion] numpy.random and multiprocessing

Gael Varoquaux gael.varoquaux@normalesup....
Thu Dec 11 10:45:01 CST 2008


On Thu, Dec 11, 2008 at 10:20:48AM -0600, Bruce Southey wrote:
> Part of this is one of the gotcha's of simulation that is not specific 
> to multiprocessing and Python.  Just highly likely to occur in your case 
> with multiprocessing but does occur in single processing. As David 
> indicated, many applications use a single source (often computer time) 
> to initialize the pseudo-random generators if an actual seed is not 
> supplied. Depending on the resolution as most require an integer so 
> minor changes may not be sufficient to change the seed. So the same seed 
> will get used if the source has not sufficiently 'advanced' before the 
> next initialization.

> If you really care about reproducing the streams, you should specify the 
> seed anyhow.

Well, its not about me. I have found this out, now, so I will know. Its
about many other people who are going to stumble upon this. I don't think
it is a good idea to count on the fact that people will understand-enough
these problems not to be fooled by them. We should try to reduce that, as
much as possible without adding magic that renders the behavior
incomprehensible.

Gaël


More information about the Numpy-discussion mailing list