Commit 2da9438e authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

using commsplit in sample generator

parent afb91428
......@@ -3,13 +3,16 @@
#include "SampleGenerator.hpp"
//#define USE_MPI
#define USE_MPI
#include "sprng_cpp.h"
#define SEED 985456376
#define GTYPE 0
class UniformDistributionReal : public SampleGenerator<Scalar> {
private:
Sprng *randNumberGen;
......@@ -40,12 +43,12 @@ private:
};
public:
UniformDistributionReal(Meshes &meshes, double a, double b,
int streamID = 0, int numStreams = 1,
int gType = 0, int seed = SEED) :
UniformDistributionReal(Meshes &meshes, double a, double b) :
a(a), b(b), SampleGenerator(meshes) {
this->randNumberGen = SelectType(gType);
this->randNumberGen->init_sprng(streamID, numStreams, seed, SPRNG_DEFAULT);
this->randNumberGen = SelectType(GTYPE);
this->randNumberGen->init_sprng(
PPM->Color(commSplit), (int) pow(2, commSplit), SEED, SPRNG_DEFAULT
);
}
~UniformDistributionReal() { randNumberGen->free_sprng(); };
......
Markdown is supported
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