[MPICH] mpich2 & rand()

Andras Joo jooam at aston.ac.uk
Sat Jun 23 11:49:13 CDT 2007


Hi,
Thank you guys.
Momentary I will use the initialization suggested by Kusumanchi (which 
works fine), but later on probably will switch to a more robust random 
number generator.
Have a nice weekend.
A.


Kamaraju Kusumanchi wrote:
>>  //...init mpi
>>  srand(time(0));
>
> What I do is change the seed based on the rank of the process. Say
> something like
>
> srand(time(0)+my_rank**2);
>
> where my_rank is is the rank of the processor. Does that work for your 
> case?
>
> hth
> raju
>




More information about the mpich-discuss mailing list