45#include "utils/RandNumGen.hpp"
58 RandNumGen::RandNumGen(result_type seed) {
66 MPI_Comm_rank(MPI_COMM_WORLD, &worldRank);
67 MPI_Comm_size(MPI_COMM_WORLD, &nProcessors);
71 std::vector<result_type> initalSequence(nProcessors);
72 std::iota(initalSequence.begin(), initalSequence.end(), seed);
75 std::seed_seq seq(initalSequence.begin(), initalSequence.end());
76 std::vector<result_type> seeds(nProcessors);
77 seq.generate(seeds.begin(), seeds.end());
82 for (
int index {1}; index < nProcessors; ++index)
83 MPI_Send(&seeds[index], 1, MPI_UINT32_T, index, 10, MPI_COMM_WORLD);
85 MPI_Recv(&result, 1, MPI_UINT32_T, 0, 10, MPI_COMM_WORLD, &status);
89 engine = std::mt19937(result);
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.