Commit 5d88dc3c authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

rolling out commSplit in MonteCarlo

parent f75949f1
......@@ -3,7 +3,8 @@
void MonteCarlo::Method() {
mout.StartBlock("MC Method");
vout(1) << "l=" << level.fine << " dM=" << ctr.dM << " fine=" << onlyFine << endl;
vout(1) << "l=" << level.fine << " dM=" << ctr.dM
<< " fine=" << onlyFine << " commSplit=" << commSplit << endl;
method();
avgs.Update(sums, ctr.M);
vars.Update(avgs);
......
......@@ -19,6 +19,8 @@ protected:
int degree = 1;
int commSplit;
bool onlyFine = false;
Level level;
......@@ -39,7 +41,7 @@ public:
SampleID coarseId;
SampleID fineId;
MonteCarlo(Level level, int dM, bool onlyFine) :
MonteCarlo(Level level, int dM, bool onlyFine, int commSplit = 0) :
level(level), ctr(SampleCounter(dM)), onlyFine(onlyFine) {
readConfigEntries();
......@@ -47,18 +49,21 @@ public:
// Todo make function problemName -> meshes
if (problemName.find("1D") != string::npos)
meshes = MeshesCreator("Interval").
WithCommSplit(commSplit).
WithPLevel(level.coarse).
WithLevel(level.fine).
Create();
else if (problemName.find("2D") != string::npos)
meshes = MeshesCreator("Square").
WithCommSplit(commSplit).
WithPLevel(level.coarse).
WithLevel(level.fine).
Create();
else
meshes = MeshesCreator("Square").
WithCommSplit(commSplit).
WithPLevel(level.coarse).
WithLevel(level.fine).
Create();
......@@ -75,6 +80,8 @@ public:
fineId.coarse = false;
coarseId.level = level;
coarseId.coarse = true;
this->commSplit = meshes->CommSplit();
}
MonteCarlo(Level level, int dM, bool onlyFine, Meshes *meshes, PDESolver *pdeSolver) :
......@@ -89,6 +96,8 @@ public:
fineId.coarse = false;
coarseId.level = level;
coarseId.coarse = true;
this->commSplit = meshes->CommSplit();
}
~MonteCarlo() {
......
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