--- trunk/OOPSE/libmdtools/SimSetup.cpp 2003/08/20 19:42:31 707 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2003/08/20 22:23:34 708 @@ -3,6 +3,7 @@ #include #include #include +#include #include "SimSetup.hpp" #include "ReadWrite.hpp" @@ -766,9 +767,32 @@ void SimSetup::gatherInfo( void ){ info[i].setBox( boxVector ); } + } + + int seedValue; + struct timeval now_time_val; + struct timezone time_zone; + if(globals->haveSeed()){ + seedValue = globals->getSeed(); } - + else{ +#ifndef IS_MPI + gettimeofday(&now_time_val, &time_zone); // get the time now + seedValue = (int) now_time_val.tv_sec; // convert to epoch time +#else + if(worldRank == 0){ + gettimeofday(&now_time_val, &time_zone); // get the time now + seedValue = (int) now_time_val.tv_sec; // convert to epoch time + } + MPI_Bcast(&seedValue, 1, MPI_INT, 0, MPI_COMM_WORLD); +#endif + } + + for(int i = 0; i < nInfo; i++){ + info[i].setSeed(seedValue); + } + #ifdef IS_MPI strcpy( checkPointMsg, "Succesfully gathered all information from Bass\n" ); MPIcheckPoint();