Commit 9e3e5617 authored by Thomas Witkowski's avatar Thomas Witkowski

Checker partitioner with tetrahedron (4) mode works also for larger numer of MPI tasks.

parent 18b97ade
......@@ -152,10 +152,19 @@ namespace AMDiS {
case 4:
// tetrahedron-stripes
elInRank = elStripeInRank[elIndex];
#if 0
{
int nStripes = elInStripe.size();
int elsPerStripe = elInStripe[0].size();
int procPerStripe = mpiSize / nStripes;
TEST_EXIT(mpiSize % nStripes == 0)("Should not happen!\n");
int inStripe = -1;
int stripePos = -1;
for (int stripe = 0; stripe < elInStripe.size(); stripe++) {
for (int stripe = 0; stripe < nStripes; stripe++) {
for (int pos = 0; pos < elInStripe[stripe].size(); pos++) {
if (elInStripe[stripe][pos] == elIndex) {
inStripe = stripe;
......@@ -171,6 +180,7 @@ namespace AMDiS {
elInRank = inStripe;
}
#endif
break;
......@@ -197,6 +207,7 @@ namespace AMDiS {
FUNCNAME("CheckerPartitioner::createTetrahedronStripes()");
vector<vector<MacroElement*> > stripes;
vector<vector<int> > elInStripe;
int nElements = 0;
TraverseStack stack;
......@@ -300,6 +311,32 @@ namespace AMDiS {
}
TEST_EXIT(testElementCounter == nElements)("Should not happen!\n");
int elsPerStripe = stripes[0].size();
for (int i = 0; i < stripes.size(); i++) {
TEST_EXIT(stripes[i].size() == elsPerStripe)
("Should not happen!\n");
}
// === Computing mapping from macro element indices to ranks ===
int nStripes = elInStripe.size();
int procPerStripe = mpiSize / nStripes;
int elsPerRank = elsPerStripe / procPerStripe;
TEST_EXIT(mpiSize % nStripes == 0)("Should not happen!\n");
TEST_EXIT(elsPerStripe % procPerStripe == 0)("Should not happen!\n");
elStripeInRank.clear();
int rankCount = 0;
for (int i = 0; i < nStripes; i++) {
for (int j = 0; j < procPerStripe; j++) {
for (int k = 0; k < elsPerRank; k++)
elStripeInRank[elInStripe[i][j * elsPerRank + k]] = rankCount;
rankCount++;
}
}
}
}
......@@ -65,7 +65,7 @@ namespace AMDiS {
int mode;
/// Only used in mode 4.
vector<vector<int> > elInStripe;
map<int, int> elStripeInRank;
bool multilevel;
};
......
......@@ -1392,7 +1392,7 @@ namespace AMDiS {
#else
int writePartMesh = 0;
#endif
Parameters::get("dbg->write part mesh", writePartMesh);
Parameters::get("parallel->debug->write part mesh", writePartMesh);
if (writePartMesh > 0 && repartitioningCounter == 0)
ParallelDebug::writePartitioningFile(debugOutputDir + "partitioning",
repartitioningCounter,
......
......@@ -352,6 +352,8 @@ namespace AMDiS {
(fabs(c[0] - 12.5) < e && fabs(c[1] - 12.5) < e)) {
MSG("PRIMAL COORD %f %f\n", c[0], c[1]);
primals.insert(**it);
} else {
MSG("OMMIT SOME PRIMAL!\n");
}
}
}
......
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