From fd4978bdec3602366c956f815e2faf10a834563c Mon Sep 17 00:00:00 2001 From: Andreas Adelmann <andreas.adelmann@psi.ch> Date: Wed, 18 Sep 2024 13:21:53 +0200 Subject: [PATCH] if see is -1, on all ranks the seed is 1234567, so we can better compare results --- src/Distribution/Gaussian.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Distribution/Gaussian.hpp b/src/Distribution/Gaussian.hpp index 0ffd672e8..5c55f91a7 100644 --- a/src/Distribution/Gaussian.hpp +++ b/src/Distribution/Gaussian.hpp @@ -17,8 +17,17 @@ public: : SamplingBase(pc, fc, opalDist) {} void generateParticles(size_t& numberOfParticles, Vector_t<double, 3> nr) override { - GeneratorPool rand_pool64((size_t)(Options::seed + 100 * ippl::Comm->rank())); + size_t randInit; + if (Options::seed == -1) { + randInit = 1234567; + *gmsg << "* Seed = " << randInit << " on all ranks" << endl; + } + else + randInit = (size_t)(Options::seed + 100 * ippl::Comm->rank()); + + GeneratorPool rand_pool64(randInit); + double mu[3], sd[3]; // sample R -- GitLab