Hi Andras,<br><br> If all the nodes are reaching that line at the same time (the same second, essentially), they'll all get seeded with the same number in your srand() call. One simple (but not ideal) solution is for
<span style="font-style: italic;">P</span> processors, initialize the random number generate on the master process as you are doing, then use it to generate an array of <span style="font-style: italic;">P</span> initial random numbers as seeds, and then scatter these seeds out to the processes. You then call srand() with these values instead, which will
<span style="font-style: italic;">pretty much</span> make sure you have different seeds on the nodes, giving you a quasi-random numbers on each process.<br><br> Be aware, though, that while this might be suitable for testing/developing, true random number generation is a pretty complex topic, and you would be much better off using a library like SPRNG (
<a href="http://sprng.cs.fsu.edu/">http://sprng.cs.fsu.edu/</a> ). This adds complexity, but it's really the only way to have 'real' random numbers.<br><br> Hope that helps,<br> - Brian<br><br><br>Brian Dobbins
<br>Yale Engineering HPC<br>