Commit fa65db24 authored by Niklas Schnierstein's avatar Niklas Schnierstein Committed by Cristian Lalescu
Browse files

added time variable to seed calculation

parent 41732fc1
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <cassert> #include <cassert>
#include "scope_timer.hpp" #include "scope_timer.hpp"
#include <algorithm> #include <algorithm>
#include <chrono>
template <class rnumber,field_backend be> template <class rnumber,field_backend be>
...@@ -50,11 +50,18 @@ ornstein_uhlenbeck_process<rnumber,be>::ornstein_uhlenbeck_process( ...@@ -50,11 +50,18 @@ ornstein_uhlenbeck_process<rnumber,be>::ornstein_uhlenbeck_process(
gen.resize(omp_get_max_threads()); gen.resize(omp_get_max_threads());
long now;
if (this->ou_field->clayout->myrank == 0){
now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
}
MPI_Bcast(&now,1,MPI_LONG,0,this->ou_field->comm);
for(int thread=0;thread<omp_get_max_threads();thread++) for(int thread=0;thread<omp_get_max_threads();thread++)
{ {
int current_seed = long current_seed =
this->ou_field->clayout->myrank*omp_get_max_threads() + this->ou_field->clayout->myrank*omp_get_max_threads() +
thread; thread+now;
gen[thread].seed(current_seed); gen[thread].seed(current_seed);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment