3 |
|
#include <iostream> |
4 |
|
#include <cmath> |
5 |
|
#include <string> |
6 |
+ |
#include <sys/time.h> |
7 |
|
|
8 |
|
#include "SimSetup.hpp" |
9 |
|
#include "ReadWrite.hpp" |
767 |
|
|
768 |
|
info[i].setBox( boxVector ); |
769 |
|
} |
770 |
+ |
} |
771 |
+ |
|
772 |
+ |
int seedValue; |
773 |
+ |
struct timeval now_time_val; |
774 |
+ |
struct timezone time_zone; |
775 |
|
|
776 |
+ |
if(globals->haveSeed()){ |
777 |
+ |
seedValue = globals->getSeed(); |
778 |
|
} |
779 |
< |
|
779 |
> |
else{ |
780 |
> |
#ifndef IS_MPI |
781 |
> |
gettimeofday(&now_time_val, &time_zone); // get the time now |
782 |
> |
seedValue = (int) now_time_val.tv_sec; // convert to epoch time |
783 |
> |
#else |
784 |
> |
if(worldRank == 0){ |
785 |
> |
gettimeofday(&now_time_val, &time_zone); // get the time now |
786 |
> |
seedValue = (int) now_time_val.tv_sec; // convert to epoch time |
787 |
> |
} |
788 |
> |
MPI_Bcast(&seedValue, 1, MPI_INT, 0, MPI_COMM_WORLD); |
789 |
> |
#endif |
790 |
> |
} |
791 |
> |
|
792 |
> |
for(int i = 0; i < nInfo; i++){ |
793 |
> |
info[i].setSeed(seedValue); |
794 |
> |
} |
795 |
> |
|
796 |
|
#ifdef IS_MPI |
797 |
|
strcpy( checkPointMsg, "Succesfully gathered all information from Bass\n" ); |
798 |
|
MPIcheckPoint(); |