Blitz++ library and parallel programing

Hello

I was given a program that use the blitz++ library. This program was first made to use a single processor but was then modified to use several. However I have found that several bug appeared in the finished program even thought i cannot find their source.
I have read the Blitz++ random number generator does not work with parallel program. Does anyone know what kind of bug/error one would expect from using such a RNG in a parallel program?
RNGs maintain state: each time a number is requested it is calculated from the current state and the state variables are updated, so that the next time a different number would be produced.
If the RNG isn't protecting its state update from concurrent access (e.g. with a mutex, which they normally don't), when two threads request a random number, both threads update the same state variables, resulting in data race (a form of undefined behavior)

The usual choices are one RNG per thread (make sure to seed them differently) and one global RNG to which you synchronize access yourself.
The program use mpich2 to provide parallel possibility. If the seed is made on each thread with the rank number of the node, is that sufficient to be able to use the rng?
Topic archived. No new replies allowed.