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

allow for repartitioning in the 1st timestep

parent 24a02ba6
......@@ -90,6 +90,7 @@ namespace AMDiS { namespace Parallel {
deserialized(false),
writeSerializationFile(false),
repartitioningAllowed(false),
repartitionOnlyOnce(false),
repartitionIthChange(20),
repartitioningWaitAfterFail(20),
nMeshChangesAfterLastRepartitioning(0),
......@@ -111,10 +112,12 @@ namespace AMDiS { namespace Parallel {
Parameters::get(name + "->repartitioning", repartitioningAllowed);
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 wait after fail", repartitioningWaitAfterFail);
Parameters::get(name + "->mesh adaptivity", meshAdaptivity);
nMeshChangesAfterLastRepartitioning = repartitionIthChange - 1;
// === Create partitioner object. ===
......@@ -1178,9 +1181,11 @@ namespace AMDiS { namespace Parallel {
repartitioningFailed--;
} else if (tryRepartition &&
repartitioningAllowed &&
nMeshChangesAfterLastRepartitioning >= repartitionIthChange) {
(repartitionOnlyOnce || nMeshChangesAfterLastRepartitioning >= repartitionIthChange)) {
repartitionMesh();
nMeshChangesAfterLastRepartitioning = 0;
if (repartitionOnlyOnce)
repartitioningAllowed = false;
} else {
MSG("Repartitioning not tried because tryRepartitioning = %d repartitioningAllowed = %d nMeshChange = %d repartitionIthChange = %d\n",
tryRepartition, repartitioningAllowed,
......
......@@ -554,8 +554,11 @@ namespace AMDiS { namespace Parallel {
/// If true, it is possible to repartition the mesh during computations.
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.
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