Commit 358a977c authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

bla

parent 4a950584
...@@ -296,10 +296,8 @@ namespace AMDiS { ...@@ -296,10 +296,8 @@ namespace AMDiS {
/// Error stream /// Error stream
static ostream *error; static ostream *error;
/** \brief /// Remember funcName to avoid multiple output of funcName within the same
* Remember funcName to avoid multiple output of funcName within the same /// function call
* function call
*/
static const char *oldFuncName; static const char *oldFuncName;
/// Global info level /// Global info level
...@@ -309,15 +307,12 @@ namespace AMDiS { ...@@ -309,15 +307,12 @@ namespace AMDiS {
static bool msgWait; static bool msgWait;
}; };
// ============================================================================ // ===========================================================================
// ===== message macros ======================================================= // ===== message macros ======================================================
// ============================================================================ // ===========================================================================
/** \brief
* Should be the first call in every functions. It defines the current function
* name nn for message output via MSG, WARNING, ...
*/
/// Should be the first call in every functions. It defines the current
/// function name nn for message output via MSG, WARNING, ...
#define FUNCNAME(nn) const char *funcName; funcName = nn; #define FUNCNAME(nn) const char *funcName; funcName = nn;
/// prints an error message /// prints an error message
...@@ -365,25 +360,19 @@ namespace AMDiS { ...@@ -365,25 +360,19 @@ namespace AMDiS {
if (Msg::getMsgInfo() && (std::min(Msg::getMsgInfo(), (info)) >= (noinfo))) Msg::print if (Msg::getMsgInfo() && (std::min(Msg::getMsgInfo(), (info)) >= (noinfo))) Msg::print
/** \brief /// If the value of Msg::wait is not zero the macro will produce the message
* If the value of Msg::wait is not zero the macro will produce the message /// 'wait for <enter> ...' and will continue after pressing the return or enter
* 'wait for <enter> ...' and will continue after pressing the return or enter /// key. Otherwise the program continues without a message.
* key. Otherwise the program continues without a message.
*/
#define WAIT Msg::wait(Msg::getMsgWait()) #define WAIT Msg::wait(Msg::getMsgWait())
/** \brief /// produces the message 'wait for <enter> ...' and will continue after
* produces the message 'wait for <enter> ...' and will continue after pressing /// pressing the return or enter key.
* the return or enter key.
*/
#define WAIT_REALLY Msg::wait(true) #define WAIT_REALLY Msg::wait(true)
#define TIME_USED(f,s) ((double)((s)-(f))/(double)CLOCKS_PER_SEC) #define TIME_USED(f,s) ((double)((s)-(f))/(double)CLOCKS_PER_SEC)
/** \brief /// internal used indices to represent the different geometrical objects.
* internal used indices to represent the different geometrical objects. /// Used as parameter for getGeo() and as template parameter for FixVec.
* Used as parameter for getGeo() and as template parameter for FixVec.
*/
typedef enum typedef enum
{ {
CENTER = 0, /**< in 1d the center is at the edge, in 2d at the face, in 3d CENTER = 0, /**< in 1d the center is at the edge, in 2d at the face, in 3d
...@@ -424,10 +413,8 @@ namespace AMDiS { ...@@ -424,10 +413,8 @@ namespace AMDiS {
class Global class Global
{ {
public: public:
/** \brief /// returns a pointer to \ref referenceElement [dim]. With this pointer you
* returns a pointer to \ref referenceElement [dim]. With this pointer you /// can get information about the element via Element's getGeo method.
* can get information about the element via Element's getGeo method.
*/
static const Element *getReferenceElement(int dim) static const Element *getReferenceElement(int dim)
{ {
FUNCNAME("Global::getReferenceElement()"); FUNCNAME("Global::getReferenceElement()");
...@@ -445,10 +432,8 @@ namespace AMDiS { ...@@ -445,10 +432,8 @@ namespace AMDiS {
return 0; return 0;
} }
/** \brief /// Returns geometrical information about elements of the dimension dim.
* Returns geometrical information about elements of the dimension dim. /// getGeo(VERTEX, 3) returns 4 because a Tetrahedron has 4 vertices.
* getGeo(VERTEX, 3) returns 4 because a Tetrahedron has 4 vertices.
*/
static inline int getGeo(GeoIndex p, int dim) static inline int getGeo(GeoIndex p, int dim)
{ {
TEST_EXIT_DBG(p >= MINPART && p <= MAXPART) TEST_EXIT_DBG(p >= MINPART && p <= MAXPART)
...@@ -467,23 +452,19 @@ namespace AMDiS { ...@@ -467,23 +452,19 @@ namespace AMDiS {
static void clear(); static void clear();
private: private:
/** \brief /// Global is a pure static class. So the constructor is private to avoid
* Global is a pure static class. So the constructor is private to avoid /// instantiation.
* instantiation.
*/
Global(); Global();
private: private:
/// Dimension of the simulated world /// Dimension of the simulated world
static int dimOfWorld; static int dimOfWorld;
/** \brief /// contains a pointer to a Line, a Triangle, and a Tetrahedron.
* contains a pointer to a Line, a Triangle, and a Tetrahedron. /// This allows the access to information of the concrete elements via
* This allows the access to information of the concrete elements via /// the dimension index.
* the dimension index. /// referenceElement[3]->getGeo(VERTEX) gives the number of vertices of a
* referenceElement[3]->getGeo(VERTEX) gives the number of vertices of a /// Tetrahedron wich is 4 => no switch statement is necessary.
* Tetrahedron wich is 4 => no switch statement is necessary.
*/
static Element *referenceElement[4]; static Element *referenceElement[4];
/// Stores the precalculated results that should be returned by Global::getGeo. /// Stores the precalculated results that should be returned by Global::getGeo.
......
...@@ -499,6 +499,38 @@ namespace AMDiS { ...@@ -499,6 +499,38 @@ namespace AMDiS {
} }
void ElementObjectDatabase::clear()
{
FUNCNAME("ElementObjectDatabase::clear()");
vertexElements.clear();
edgeElements.clear();
faceElements.clear();
vertexLocalMap.clear();
edgeLocalMap.clear();
faceLocalMap.clear();
vertexInRank.clear();
edgeInRank.clear();
faceInRank.clear();
bConnMap.clear();
periodicVertices.clear();
periodicEdges.clear();
periodicFaces.clear();
periodicDofAssoc.clear();
periodicEdgeAssoc.clear();
edgeReverseMode.clear();
faceReverseMode.clear();
macroElementRankMap = NULL;
macroElIndexMap.clear();
macroElIndexTypeMap.clear();
}
void ElementObjectDatabase::createReverseModeData() void ElementObjectDatabase::createReverseModeData()
{ {
FUNCNAME("ElementObjectDatabase::createReverseModeData()"); FUNCNAME("ElementObjectDatabase::createReverseModeData()");
......
...@@ -135,6 +135,9 @@ namespace AMDiS { ...@@ -135,6 +135,9 @@ namespace AMDiS {
/// heighest rank number of all ranks where the object is part of. /// heighest rank number of all ranks where the object is part of.
void updateRankData(); void updateRankData();
/// All data from the database is dropped.
void clear();
/** \brief /** \brief
* Iterates over all elements for one geometrical index, i.e., over all * Iterates over all elements for one geometrical index, i.e., over all
* vertices, edges or faces in the mesh. The function returns true, if the * vertices, edges or faces in the mesh. The function returns true, if the
......
...@@ -89,7 +89,8 @@ namespace AMDiS { ...@@ -89,7 +89,8 @@ namespace AMDiS {
debugOutputDir(""), debugOutputDir(""),
lastMeshChangeIndex(0), lastMeshChangeIndex(0),
createBoundaryDofFlag(0), createBoundaryDofFlag(0),
boundaryDofInfo(1) boundaryDofInfo(1),
meshAdaptivity(true)
{ {
FUNCNAME("MeshDistributor::ParalleDomainBase()"); FUNCNAME("MeshDistributor::ParalleDomainBase()");
...@@ -101,6 +102,7 @@ namespace AMDiS { ...@@ -101,6 +102,7 @@ namespace AMDiS {
Parameters::get(name + "->debug output dir", debugOutputDir); Parameters::get(name + "->debug output dir", debugOutputDir);
Parameters::get(name + "->repartition ith change", repartitionIthChange); Parameters::get(name + "->repartition ith change", repartitionIthChange);
Parameters::get(name + "->log main rank", Msg::outputMainRank); Parameters::get(name + "->log main rank", Msg::outputMainRank);
Parameters::get(name + "->mesh adaptivity", meshAdaptivity);
string partStr = "parmetis"; string partStr = "parmetis";
Parameters::get(name + "->partitioner", partStr); Parameters::get(name + "->partitioner", partStr);
...@@ -352,6 +354,10 @@ namespace AMDiS { ...@@ -352,6 +354,10 @@ namespace AMDiS {
// Set DOF rank information to all matrices and vectors. // Set DOF rank information to all matrices and vectors.
setRankDofs(); setRankDofs();
// And delete some data, we there is no mesh adaptivty.
if (meshAdaptivity)
elObjDb.clear();
initialized = true; initialized = true;
} }
...@@ -938,13 +944,6 @@ namespace AMDiS { ...@@ -938,13 +944,6 @@ namespace AMDiS {
{ {
FUNCNAME("MeshDistributor::checkMeshChange()"); FUNCNAME("MeshDistributor::checkMeshChange()");
double vm, rss;
processMemUsage(vm, rss);
mpi::globalAdd(vm);
mpi::globalAdd(rss);
MSG("MEM-RSS 0 = %f\n", rss);
MPI::COMM_WORLD.Barrier(); MPI::COMM_WORLD.Barrier();
double first = MPI::Wtime(); double first = MPI::Wtime();
...@@ -1067,12 +1066,6 @@ namespace AMDiS { ...@@ -1067,12 +1066,6 @@ namespace AMDiS {
// === Print imbalance factor. === // === Print imbalance factor. ===
printImbalanceFactor(); printImbalanceFactor();
processMemUsage(vm, rss);
mpi::globalAdd(vm);
mpi::globalAdd(rss);
MSG("MEM-RSS 1 = %f\n", rss);
} }
...@@ -1606,6 +1599,10 @@ namespace AMDiS { ...@@ -1606,6 +1599,10 @@ namespace AMDiS {
elObjDb.create(partitionMap, levelData); elObjDb.create(partitionMap, levelData);
elObjDb.updateRankData(); elObjDb.updateRankData();
unsigned long memsize = elObjDb.calculateMemoryUsage();
MSG("Memory usage of element object database = %5.f KByte\n",
static_cast<double>(memsize / 1024));
intBoundary.create(levelData, 0, elObjDb); intBoundary.create(levelData, 0, elObjDb);
ParallelDebug::printBoundaryInfo(intBoundary); ParallelDebug::printBoundaryInfo(intBoundary);
......
...@@ -563,6 +563,12 @@ namespace AMDiS { ...@@ -563,6 +563,12 @@ namespace AMDiS {
MeshLevelData levelData; MeshLevelData levelData;
/// If there is no mesh adaptivity, the mesh distributor can remove some
/// data structures which are only used if mesh changes or it must be
/// redistributed due to some local adaptivity. By default, this variable
/// is set to true, and thus no special assumption are made.
bool meshAdaptivity;
public: public:
static bool sebastianMode; static bool sebastianMode;
......
...@@ -52,6 +52,10 @@ namespace AMDiS { ...@@ -52,6 +52,10 @@ namespace AMDiS {
coarseSpaceMap[component] = coarseDofs; coarseSpaceMap[component] = coarseDofs;
} }
if (find(uniqueCoarseMap.begin(), uniqueCoarseMap.end(), coarseDofs) ==
uniqueCoarseMap.end())
uniqueCoarseMap.push_back(coarseDofs);
} }
...@@ -59,28 +63,8 @@ namespace AMDiS { ...@@ -59,28 +63,8 @@ namespace AMDiS {
{ {
FUNCNAME("ParallelCoarseSpaceMatVec:prepare()"); FUNCNAME("ParallelCoarseSpaceMatVec:prepare()");
// === Create vector of unique pointers to all coarse space maps. ===
uniqueCoarseMap.clear();
if (coarseSpaceMap.size()) {
std::set<ParallelDofMapping*> tmp;
for (map<int, ParallelDofMapping*>::iterator it = coarseSpaceMap.begin();
it != coarseSpaceMap.end(); ++it) {
if (tmp.count(it->second) == 0) {
tmp.insert(it->second);
uniqueCoarseMap.push_back(it->second);
}
}
}
TEST_EXIT(uniqueCoarseMap.size() <= 2) TEST_EXIT(uniqueCoarseMap.size() <= 2)
("Not yet implemented for more than two coarse spaces!\n"); ("Not yet implemented for more than two coarse spaces!\n");
if (uniqueCoarseMap.size() == 2) {
if (uniqueCoarseMap[0]->getFeSpace()->getBasisFcts()->getDegree() <
uniqueCoarseMap[1]->getFeSpace()->getBasisFcts()->getDegree()) {
swap(uniqueCoarseMap[0], uniqueCoarseMap[1]);
}
}
// === Create pointers to PETSc matrix and vector objects. === // === Create pointers to PETSc matrix and vector objects. ===
...@@ -95,7 +79,7 @@ namespace AMDiS { ...@@ -95,7 +79,7 @@ namespace AMDiS {
// === Create map from component number to its coarse space map. === // === Create map from component number to its coarse space map. ===
componentIthCoarseMap.resize(coarseSpaceMap.size()); componentIthCoarseMap.resize(coarseSpaceMap.size());
for (unsigned int i = 0; i < componentIthCoarseMap.size(); i++) { for (unsigned int i = 0; i < coarseSpaceMap.size(); i++) {
bool found = false; bool found = false;
for (int j = 0; j < nCoarseMap; j++) { for (int j = 0; j < nCoarseMap; j++) {
if (coarseSpaceMap[i] == uniqueCoarseMap[j]) { if (coarseSpaceMap[i] == uniqueCoarseMap[j]) {
......
...@@ -302,7 +302,7 @@ namespace AMDiS { ...@@ -302,7 +302,7 @@ namespace AMDiS {
VecCopy(x_interface, y_interface); VecCopy(x_interface, y_interface);
// VecScale(y_interface, 0.2519); // VecScale(y_interface, 0.16);
// Multiply with scaled Lagrange constraint matrix. // Multiply with scaled Lagrange constraint matrix.
......
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