Commit 63e723dc authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

allow for repartitioning in the 1st timestep

parent 24a02ba6
...@@ -90,6 +90,7 @@ namespace AMDiS { namespace Parallel { ...@@ -90,6 +90,7 @@ namespace AMDiS { namespace Parallel {
deserialized(false), deserialized(false),
writeSerializationFile(false), writeSerializationFile(false),
repartitioningAllowed(false), repartitioningAllowed(false),
repartitionOnlyOnce(false),
repartitionIthChange(20), repartitionIthChange(20),
repartitioningWaitAfterFail(20), repartitioningWaitAfterFail(20),
nMeshChangesAfterLastRepartitioning(0), nMeshChangesAfterLastRepartitioning(0),
...@@ -111,10 +112,12 @@ namespace AMDiS { namespace Parallel { ...@@ -111,10 +112,12 @@ namespace AMDiS { namespace Parallel {
Parameters::get(name + "->repartitioning", repartitioningAllowed); Parameters::get(name + "->repartitioning", repartitioningAllowed);
Parameters::get(name + "->debug output dir", debugOutputDir); Parameters::get(name + "->debug output dir", debugOutputDir);
Parameters::get(name + "->repartition only once", repartitionOnlyOnce);
Parameters::get(name + "->repartition ith change", repartitionIthChange); Parameters::get(name + "->repartition ith change", repartitionIthChange);
Parameters::get(name + "->repartition wait after fail", repartitioningWaitAfterFail); Parameters::get(name + "->repartition wait after fail", repartitioningWaitAfterFail);
Parameters::get(name + "->mesh adaptivity", meshAdaptivity); Parameters::get(name + "->mesh adaptivity", meshAdaptivity);
nMeshChangesAfterLastRepartitioning = repartitionIthChange - 1;
// === Create partitioner object. === // === Create partitioner object. ===
...@@ -1178,9 +1181,11 @@ namespace AMDiS { namespace Parallel { ...@@ -1178,9 +1181,11 @@ namespace AMDiS { namespace Parallel {
repartitioningFailed--; repartitioningFailed--;
} else if (tryRepartition && } else if (tryRepartition &&
repartitioningAllowed && repartitioningAllowed &&
nMeshChangesAfterLastRepartitioning >= repartitionIthChange) { (repartitionOnlyOnce || nMeshChangesAfterLastRepartitioning >= repartitionIthChange)) {
repartitionMesh(); repartitionMesh();
nMeshChangesAfterLastRepartitioning = 0; nMeshChangesAfterLastRepartitioning = 0;
if (repartitionOnlyOnce)
repartitioningAllowed = false;
} else { } else {
MSG("Repartitioning not tried because tryRepartitioning = %d repartitioningAllowed = %d nMeshChange = %d repartitionIthChange = %d\n", MSG("Repartitioning not tried because tryRepartitioning = %d repartitioningAllowed = %d nMeshChange = %d repartitionIthChange = %d\n",
tryRepartition, repartitioningAllowed, tryRepartition, repartitioningAllowed,
......
...@@ -554,8 +554,11 @@ namespace AMDiS { namespace Parallel { ...@@ -554,8 +554,11 @@ namespace AMDiS { namespace Parallel {
/// If true, it is possible to repartition the mesh during computations. /// If true, it is possible to repartition the mesh during computations.
bool repartitioningAllowed; bool repartitioningAllowed;
/// repartition the mesh (only) the first time repartitionMesh() is called
bool repartitionOnlyOnce;
/// Stores the number of mesh changes that must lie in between to /// Stores the number of mesh changes that must lie in between two
/// repartitionings. /// repartitionings.
int repartitionIthChange; int repartitionIthChange;
......
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