Initialize random number generator
Opened this issue · 0 comments
Hello,
We are currently trying to run several Proxy apps with SMPI/SimGrid (https://github.com/simgrid/SMPI-proxy-apps/ and https://github.com/simgrid/simgrid).
We had a little issue with Quicksilver, as the mesh is initialized with random centers. But the random number generator used in initMC.cc does not seem to be initialized explicitely. It's OK when all processes are running separately, as they will all return the same sequence, but for SimGrid we "fold" all of the processes into a single one. So all processes are generating different centers, which leads to issues later.
Adding a call to srand48(params.simulationParams.seed); in initMesh (initMC.cc:257) fixes the issue for us, ensuring that all processes will be initialized to the same seed before running the calls to drand48.