[SciPy-User] Weird randomization issue with multiprocessing module

Ted To rainexpected@theo...
Fri Nov 30 11:25:33 CST 2012


I have a very strange problem that maybe someone might have some ideas
as to what is going on.  I'm making a series of random draws across
multiple processor threads on a Debian Wheezy, dual core AMD Phenom box
with scipy 0.10.1 and numpy 1.6.2 (once I debug my code, I will run it
on a more powerful workstation).  Since each series of draws is in a
separate thread, I would have presumed that the draws are completely
independent of one another.  But strangely, for a total of 1000 threads
(managed by multiprocessing.Pool), early in the series of threads, I see
precisely the same numbers in some of the variables produced by two
adjacent threads.  The probability of this happening should be
vanishingly small but strangely happens twice within the first 25
threads and by cursory examination not at all in the remaining 975.  The
numbers are being drawn using scipy.stats.norm and random.random.

Any ideas?

Thanks in advance,
Ted To

More information about the SciPy-User mailing list