Commit fe752c0c authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

And old single level code works now.

parent 2c1211fd
...@@ -399,11 +399,7 @@ namespace AMDiS { ...@@ -399,11 +399,7 @@ namespace AMDiS {
if (it2->elIndex > vertexInRank[it->first][elementInRank].elIndex) if (it2->elIndex > vertexInRank[it->first][elementInRank].elIndex)
vertexInRank[it->first][elementInRank] = *it2; vertexInRank[it->first][elementInRank] = *it2;
for (int level = 0; level < nLevel; level++) { vertexOwner[it->first] = std::max(vertexOwner[it->first], elementInRank);
int levelId = levelData.getLevelId(level, elementInRank);
vertexOwner[it->first][level] =
std::max(vertexOwner[it->first][level], levelId);
}
ranksInLevel[0].insert(elementInRank); ranksInLevel[0].insert(elementInRank);
for (int level = 1; level < nLevel; level++) for (int level = 1; level < nLevel; level++)
...@@ -434,11 +430,7 @@ namespace AMDiS { ...@@ -434,11 +430,7 @@ namespace AMDiS {
if (it2->elIndex > edgeInRank[it->first][elementInRank].elIndex) if (it2->elIndex > edgeInRank[it->first][elementInRank].elIndex)
edgeInRank[it->first][elementInRank] = *it2; edgeInRank[it->first][elementInRank] = *it2;
for (int level = 0; level < nLevel; level++) { edgeOwner[it->first] = std::max(edgeOwner[it->first], elementInRank);
int levelId = levelData.getLevelId(level, elementInRank);
edgeOwner[it->first][level] =
std::max(edgeOwner[it->first][level], levelId);
}
ranksInLevel[0].insert(elementInRank); ranksInLevel[0].insert(elementInRank);
for (int level = 1; level < nLevel; level++) for (int level = 1; level < nLevel; level++)
...@@ -469,11 +461,7 @@ namespace AMDiS { ...@@ -469,11 +461,7 @@ namespace AMDiS {
if (it2->elIndex > faceInRank[it->first][elementInRank].elIndex) if (it2->elIndex > faceInRank[it->first][elementInRank].elIndex)
faceInRank[it->first][elementInRank] = *it2; faceInRank[it->first][elementInRank] = *it2;
for (int level = 0; level < nLevel; level++) { faceOwner[it->first] = std::max(faceOwner[it->first], elementInRank);
int levelId = levelData.getLevelId(level, elementInRank);
faceOwner[it->first][level] =
std::max(faceOwner[it->first][level], levelId);
}
ranksInLevel[0].insert(elementInRank); ranksInLevel[0].insert(elementInRank);
for (int level = 1; level < nLevel; level++) for (int level = 1; level < nLevel; level++)
......
...@@ -259,17 +259,17 @@ namespace AMDiS { ...@@ -259,17 +259,17 @@ namespace AMDiS {
/// Returns the rank owner of the current iterator position. /// Returns the rank owner of the current iterator position.
int getIterateOwner(int level) int getIterateOwner()
{ {
switch (iterGeoPos) { switch (iterGeoPos) {
case VERTEX: case VERTEX:
return vertexOwner[vertexIter->first][level]; return vertexOwner[vertexIter->first];
break; break;
case EDGE: case EDGE:
return edgeOwner[edgeIter->first][level]; return edgeOwner[edgeIter->first];
break; break;
case FACE: case FACE:
return faceOwner[faceIter->first][level]; return faceOwner[faceIter->first];
break; break;
default: default:
ERROR_EXIT("Should not happen!\n"); ERROR_EXIT("Should not happen!\n");
...@@ -301,21 +301,21 @@ namespace AMDiS { ...@@ -301,21 +301,21 @@ namespace AMDiS {
} }
/// Returns the rank owner of a vertex DOF. /// Returns the rank owner of a vertex DOF.
int getOwner(DegreeOfFreedom vertex, int level) int getOwner(DegreeOfFreedom vertex)
{ {
return vertexOwner[vertex][level]; return vertexOwner[vertex];
} }
/// Returns the rank owner of an edge. /// Returns the rank owner of an edge.
int getOwner(DofEdge edge, int level) int getOwner(DofEdge edge)
{ {
return edgeOwner[edge][level]; return edgeOwner[edge];
} }
/// Returns the rank owner of an face. /// Returns the rank owner of an face.
int getOwner(DofFace face, int level) int getOwner(DofFace face, int level)
{ {
return faceOwner[face][level]; return faceOwner[face];
} }
...@@ -562,17 +562,14 @@ namespace AMDiS { ...@@ -562,17 +562,14 @@ namespace AMDiS {
/// Maps to an element object the corresponding face. /// Maps to an element object the corresponding face.
map<ElementObjectData, DofFace> faceLocalMap; map<ElementObjectData, DofFace> faceLocalMap;
/// Maps from level to rank number
typedef map<int, int> LevelRank;
/// Defines for all vertex DOFs the rank that ownes this vertex DOF. /// Defines for all vertex DOFs the rank that ownes this vertex DOF.
map<DegreeOfFreedom, LevelRank> vertexOwner; map<DegreeOfFreedom, int> vertexOwner;
/// Defines for all edges the rank that ownes this edge. /// Defines for all edges the rank that ownes this edge.
map<DofEdge, LevelRank> edgeOwner; map<DofEdge, int> edgeOwner;
/// Defines for all faces the rank that ownes this face. /// Defines for all faces the rank that ownes this face.
map<DofFace, LevelRank> faceOwner; map<DofFace, int> faceOwner;
map<DegreeOfFreedom, int> vertexMaxLevel; map<DegreeOfFreedom, int> vertexMaxLevel;
......
...@@ -847,6 +847,8 @@ namespace AMDiS { ...@@ -847,6 +847,8 @@ namespace AMDiS {
levelData.init(neighbours); levelData.init(neighbours);
MSG("INIT MESH LEVEL %d\n", levelData.getLevelNumber());
bool multiLevelTest = false; bool multiLevelTest = false;
Parameters::get("parallel->multi level test", multiLevelTest); Parameters::get("parallel->multi level test", multiLevelTest);
if (multiLevelTest) { if (multiLevelTest) {
...@@ -1590,7 +1592,7 @@ namespace AMDiS { ...@@ -1590,7 +1592,7 @@ namespace AMDiS {
if (!(objData.count(mpiRank) && objData.size() > 1)) if (!(objData.count(mpiRank) && objData.size() > 1))
continue; continue;
int owner = elObjDb.getIterateOwner(0); int owner = elObjDb.getIterateOwner();
ElementObjectData& rankBoundEl = objData[mpiRank]; ElementObjectData& rankBoundEl = objData[mpiRank];
AtomicBoundary bound; AtomicBoundary bound;
......
...@@ -19,6 +19,13 @@ namespace AMDiS { ...@@ -19,6 +19,13 @@ namespace AMDiS {
using namespace std; using namespace std;
MeshLevelData::MeshLevelData()
{
std::set<int> neighbours;
init(neighbours);
}
void MeshLevelData::init(std::set<int> &neighbourRanks) void MeshLevelData::init(std::set<int> &neighbourRanks)
{ {
levelRanks.resize(1); levelRanks.resize(1);
......
...@@ -37,9 +37,7 @@ namespace AMDiS { ...@@ -37,9 +37,7 @@ namespace AMDiS {
class MeshLevelData class MeshLevelData
{ {
public: public:
MeshLevelData() MeshLevelData();
: nLevel(0)
{}
void init(std::set<int> &neighbourRanks); void init(std::set<int> &neighbourRanks);
......
...@@ -266,6 +266,10 @@ namespace AMDiS { ...@@ -266,6 +266,10 @@ namespace AMDiS {
{ {
FUNCNAME("SubDomainSolver::solveGlobal()"); FUNCNAME("SubDomainSolver::solveGlobal()");
int ml = 0;
Parameters::get("parallel->multi level test", ml);
if (ml > 0)
ERROR_EXIT("BLUB!\n"); ERROR_EXIT("BLUB!\n");
Vec tmp; Vec tmp;
......
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