<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="sans-serif">Hi,<br>
<br>
I've encountered a problem regarding the random number generator inside
mpich. Please consider the following code segment<br>
<br>
//...init mpi<br>
srand(time(0));<br>
cout << rand() << endl;<br>
cout.flush();<br>
//...finalize mpi<br>
<br>
Now each time I run the program with<br>
$ mpirun -n nr_proc my_prog<br>
I got a sequence of nr_proc elements, with the same value! <br>
It is crucial for me to get different values for the different
processes. <br>
Can anyone help me out with this, please?<br>
<br>
Thank you,<br>
Regards,<br>
Andras<br>
</font></font>
</body>
</html>