Liebe Gitlab-Nutzer, lieber Gitlab-Nutzer, es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Ein Anmelden über dieses erzeugt ein neues Konto. Das alte Konto ist über den Reiter "Standard" erreichbar. Die Administratoren

Dear Gitlab user, it is now possible to log in to our service using the ZIH login/LDAP. Logging in via this will create a new account. The old account can be accessed via the "Standard" tab. The administrators

Commit 209f7b44 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

changed DEBUG to NOT NDEBUG and removed separate debug target from cmake

parent a877b6da
......@@ -19,11 +19,6 @@ endif()
#TODO: use the cmake build type
SET(MTL_INCLUDE_DIR ${LIB_DIR}/mtl4/ CACHE PATH "mtl4 directory")
# set global compile_definitions for all target, depending on build-type
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
$<$<CONFIG:Debug>:DEBUG=1>
$<$<CONFIG:Release>:DEBUG=0>)
# find_package(Subversion QUIET)
# if(Subversion_FOUND)
# Subversion_WC_INFO(${CMAKE_CURRENT_SOURCE_DIR} svn_info)
......
......@@ -39,9 +39,7 @@ set(CMAKE_BUILD_TYPE @CMAKE_BUILD_TYPE@)
add_library(amdis_base INTERFACE)
add_library(AMDiS ALIAS amdis_base)
target_compile_definitions(amdis_base INTERFACE
$<$<CONFIG:Release>:DEBUG=0>
$<$<NOT:$<CONFIG:Release>>:DEBUG=1>)
target_compile_definitions(amdis_base INTERFACE)
if (AMDIS_NEED_CXX11)
set(CMAKE_CXX_STANDARD 11)
......
......@@ -204,10 +204,7 @@ add_library(amdis
${SOURCE_DIR}/time/RosenbrockAdaptInstationary.cc
${SOURCE_DIR}/time/RosenbrockMethod.cc
${SOURCE_DIR}/time/RosenbrockStationary.cc
)
add_library(amdis_debug INTERFACE)
target_sources(amdis_debug INTERFACE
# debugging files
${SOURCE_DIR}/Debug.cc
${SOURCE_DIR}/GlobalDOFNumbering.cc # not used by any other class
${SOURCE_DIR}/GlobalElementNumbering.cc # not used by any other class
......@@ -244,8 +241,7 @@ if (MSVC)
_CRT_SECURE_NO_WARNINGS)
endif (MSVC)
target_link_libraries(amdis AMDiS::base muparser
$<$<CONFIG:Debug>:amdis_debug>)
target_link_libraries(amdis AMDiS::base muparser)
# specify how to install this target:
# -----------------------------------
......
......@@ -14,6 +14,7 @@ if (ENABLE_PARALLEL_DOMAIN)
${SOURCE_DIR}/parallel/MeshManipulation.cc
${SOURCE_DIR}/parallel/MeshPartitioner.cc
${SOURCE_DIR}/parallel/MpiHelper.cc
${SOURCE_DIR}/parallel/ParallelDebug.cc
${SOURCE_DIR}/parallel/ParallelDofMapping.cc
${SOURCE_DIR}/parallel/ParallelProblemStat.cc
${SOURCE_DIR}/parallel/ParallelSolver.cc
......@@ -22,10 +23,6 @@ if (ENABLE_PARALLEL_DOMAIN)
${SOURCE_DIR}/parallel/StdMpi.cc
)
target_sources(amdis_debug INTERFACE
${SOURCE_DIR}/parallel/ParallelDebug.cc
)
target_compile_definitions(amdis_parallel INTERFACE
HAVE_PARALLEL_DOMAIN_AMDIS=1)
......
......@@ -73,7 +73,7 @@ namespace AMDiS {
if (obj0.subObj == EDGE) {
int el0_v0 = obj0.el->getVertexOfEdge(obj0.ithObj, 0);
int el1_v0 = obj0.el->getVertexOfEdge(obj1.ithObj, 0);
#if DEBUG != 0
#ifndef NDEBUG
int el0_v1 = obj0.el->getVertexOfEdge(obj0.ithObj, 1);
int el1_v1 = obj0.el->getVertexOfEdge(obj1.ithObj, 1);
#endif
......
......@@ -29,15 +29,6 @@
#define AMDIS_VERSION "AMDiS: Version 0.9.1"
#endif
#ifdef DEBUG
#undef DEBUG
#endif
#ifdef NDEBUG
#define DEBUG 0
#else
#define DEBUG 1
#endif
#include <boost/config.hpp>
#define CACHE_LINE 16
......
......@@ -122,7 +122,7 @@ namespace AMDiS {
feSpaces.resize(0);
}
#if DEBUG
#ifndef NDEBUG
FiniteElemSpace* FiniteElemSpace::provideFeSpace(Mesh *mesh)
{
FUNCNAME("FiniteElemSpace::provideFeSpace()");
......
......@@ -53,7 +53,7 @@ namespace AMDiS {
static void destroyFeSpaces();
#if DEBUG
#ifndef NDEBUG
/// For debugging it may be useful to get some FE space for a given mesh at a
/// position in code where it is not possible to access the FE space directly. The
/// function assumes that there is only one FE space defined for the mesh.
......
......@@ -187,7 +187,7 @@ namespace AMDiS {
vsprintf(buff, format, arg);
PRINT_LINE((*error), buff);
va_end(arg);
#if defined HAVE_PARALLEL_DOMAIN_AMDIS && !defined HAVE_PARALLEL_MTL4 && (DEBUG == 0 || defined NDEBUG)
#if defined HAVE_PARALLEL_DOMAIN_AMDIS && !defined HAVE_PARALLEL_MTL4 && (defined NDEBUG)
#if (PETSC_VERSION_MINOR >= 5)
PetscError(MPI_COMM_WORLD, __LINE__, "Msg::print_error_exit", "Global.cc", 1, PETSC_ERROR_INITIAL, buff);
#else
......@@ -220,11 +220,9 @@ namespace AMDiS {
const char *file,
int line)
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#if (DEBUG == 0)
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) && defined(NDEBUG)
if (outputMainRank && MPI::COMM_WORLD.Get_rank() != 0)
return;
#endif
#endif
static int old_line = -1;
......@@ -256,11 +254,9 @@ namespace AMDiS {
void Msg::print_warn(const char *format, ...)
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#if (DEBUG == 0)
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) && defined(NDEBUG)
if (outputMainRank && MPI::COMM_WORLD.Get_rank() != 0)
return;
#endif
#endif
va_list arg;
char buff[255];
......
......@@ -1161,7 +1161,7 @@ namespace AMDiS {
in >> name;
in.get();
#if DEBUG != 0
#ifndef NDEBUG
int oldVal = dim;
#endif
SerUtil::deserialize(in, dim);
......@@ -1178,7 +1178,7 @@ namespace AMDiS {
SerUtil::deserialize(in, preserveCoarseDOFs);
#if DEBUG != 0
#ifndef NDEBUG
oldVal = nDofEl;
#endif
SerUtil::deserialize(in, nDofEl);
......@@ -1186,7 +1186,7 @@ namespace AMDiS {
nDof.deserialize(in);
#if DEBUG != 0
#ifndef NDEBUG
oldVal = nNodeEl;
#endif
SerUtil::deserialize(in, nNodeEl);
......
......@@ -280,23 +280,23 @@ namespace AMDiS {
bool cont = true;
while (cont) {
bool cont1;
#if DEBUG != 0
#ifndef NDEBUG
bool cont2;
#endif
if (structure1->isLeafElement() == structure2->isLeafElement()) {
cont1 = structure1->nextElement(result);
#if DEBUG != 0
#ifndef NDEBUG
cont2 = structure2->nextElement();
#endif
} else {
if (structure1->isLeafElement()) {
cont1 = structure1->nextElement();
#if DEBUG != 0
#ifndef NDEBUG
cont2 = structure2->skipBranch(result);
#endif
} else {
cont1 = structure1->skipBranch(result);
#if DEBUG != 0
#ifndef NDEBUG
cont2 = structure2->nextElement();
#endif
}
......@@ -385,7 +385,7 @@ namespace AMDiS {
}
if (!finished) {
#if (DEBUG != 0)
#ifndef NDEBUG
int oldMeshIndex = mesh->getChangeIndex();
#endif
......@@ -394,7 +394,7 @@ namespace AMDiS {
else
manager->refineMacroElement(mesh, macroElIndex);
#if (DEBUG != 0)
#ifndef NDEBUG
TEST_EXIT(oldMeshIndex != mesh->getChangeIndex())
("Mesh has not been changed by refinement procedure!\n");
#endif
......
......@@ -32,10 +32,10 @@
#include "Global.h"
#include "BoundaryObject.h"
#if (DEBUG != 0)
#define WITH_ELINDEX true
#ifndef NDEBUG
#define WITH_ELINDEX true
#else
#define WITH_ELINDEX false
#define WITH_ELINDEX false
#endif
namespace AMDiS {
......
......@@ -47,7 +47,7 @@ namespace AMDiS {
inline T& get()
{
#if (DEBUG != 0)
#ifndef NDEBUG
if (omp_get_thread_num() >= data.size()) {
std::cout << "Error in ThreadPrivate::get()!\n";
exit(0);
......@@ -58,7 +58,7 @@ namespace AMDiS {
inline void set(T& val)
{
#if (DEBUG != 0)
#ifndef NDEBUG
if (omp_get_thread_num() >= data.size()) {
std::cout << "Error in ThreadPrivate::set()!\n";
exit(0);
......
......@@ -422,7 +422,7 @@ namespace AMDiS {
return true;
int oppVertex = (*elInfo)->getOppVertex(localNeighbour);
#if DEBUG
#ifndef NDEBUG
int testIndex = (*elInfo)->getNeighbour(localNeighbour)->getIndex();
#endif
ElInfo *neighInfo = stack->traverseNeighbour3d((*elInfo), localNeighbour);
......@@ -573,7 +573,7 @@ namespace AMDiS {
if (neighInfo->getNeighbour(i)) {
oppVertex = neighInfo->getOppVertex(i);
#if DEBUG
#ifndef NDEBUG
int testIndex = neighInfo->getNeighbour(i)->getIndex();
#endif
......@@ -607,7 +607,7 @@ namespace AMDiS {
("While looping back domains boundary was reached or i == 0\n");
oppVertex = refineList.getOppVertex(i--, 0);
#if DEBUG
#ifndef NDEBUG
int testIndex = neighInfo->getNeighbour(oppVertex)->getIndex();
#endif
neighInfo = stack->traverseNeighbour3d(neighInfo, oppVertex);
......
......@@ -194,7 +194,7 @@ namespace AMDiS {
Parallel::InteriorBoundary &intBoundary =
Parallel::MeshDistributor::globalMeshDistributor->getIntBoundary(0);
#if (DEBUG != 0)
#ifndef NDEBUG
// Make sure interior boundary is correct
Parallel::ParallelDebug::testInteriorBoundary(*(Parallel::MeshDistributor::globalMeshDistributor));
#endif
......
......@@ -228,7 +228,7 @@ namespace AMDiS { namespace io {
}
for (int j = 0; j < dim; j++) {
#ifdef DEBUG
#ifndef NDEBUG
{
unsigned initData(melVertex[el1][verticesEl1[j]]);
unsigned oldData((*associated)[melVertex[el1][verticesEl1[j]]]);
......@@ -272,7 +272,7 @@ namespace AMDiS { namespace io {
}
}
#if (DEBUG != 0)
#ifndef NDEBUG
std::map<BoundaryType, VertexVector*>::iterator assoc;
std::map<BoundaryType, VertexVector*>::iterator assocEnd =
mesh->periodicAssociations.end();
......
......@@ -54,7 +54,7 @@ namespace AMDiS { namespace Parallel {
createContainer(mesh, boundary, boundary.getOwn(), sendDofs);
createContainer(mesh, boundary, boundary.getOther(), recvDofs);
#if (DEBUG != 0)
#ifndef NDEBUG
{
std::set<DegreeOfFreedom> sds;
for (DofComm::Iterator it(sendDofs, feSpaces[0]);
......
......@@ -452,7 +452,7 @@ namespace AMDiS { namespace Parallel {
// === in a symmetric way, i.e., if A -> B for a specific boundary type, ===
// === there must be a mapping B -> A with the same boundary type. ===
#if (DEBUG != 0)
#ifndef NDEBUG
for (PerBoundMap<DegreeOfFreedom>::iterator it = periodicVertices.begin();
it != periodicVertices.end(); ++it) {
pair<DegreeOfFreedom, DegreeOfFreedom> testVertex =
......
......@@ -334,7 +334,7 @@ namespace AMDiS { namespace Parallel {
onnz[i] = std::min(onnz[i], nOverallCols - nRankCols);
}
#if (DEBUG != 0)
#ifndef NDEBUG
int nMax = 0;
int nSum = 0;
for (int i = 0; i < nRankRows; i++) {
......
......@@ -29,8 +29,8 @@
#include "parallel/MeshDistributor.h"
#include "parallel/MeshManipulation.h"
#if (DEBUG != 0)
#include "parallel/ParallelDebug.h"
#ifndef NDEBUG
#include "parallel/ParallelDebug.h"
#endif
#include "parallel/StdMpi.h"
#include "parallel/MeshPartitioner.h"
......@@ -63,8 +63,8 @@
#include "ProblemStat.h"
#include "ProblemInstat.h"
#include "RefinementManager3d.h"
#if (DEBUG != 0)
#include "Debug.h"
#ifndef NDEBUG
#include "Debug.h"
#endif
#include "Timer.h"
#include "io/MacroReader.h"
......@@ -264,7 +264,7 @@ namespace AMDiS { namespace Parallel {
// already refined in some way.
testForMacroMesh();
#if (DEBUG != 0)
#ifndef NDEBUG
// Check whether meshes come from the same macro mesh. The way is to compare
// the node coords of each macro element in the meshes.
debug::ElementIdxToCoords macroCoords;
......@@ -297,7 +297,7 @@ namespace AMDiS { namespace Parallel {
elObjDb.setData(partitionMap, levelData);
#if (DEBUG != 0)
#ifndef NDEBUG
TEST_EXIT_DBG(dofMaps.size())("No DOF mapping defined!\n");
ParallelDebug::writeDebugFile(feSpaces[feSpaces.size() - 1],
*(dofMaps[0]),
......@@ -313,7 +313,7 @@ namespace AMDiS { namespace Parallel {
createInitialPartitioning();
#if (DEBUG != 0)
#ifndef NDEBUG
std::vector<debug::ElementIdxToDofs> elMap(meshes.size());
for (size_t i = 0; i < meshes.size(); i++) {
debug::createSortedDofs(meshes[i], elMap[i]);
......@@ -407,7 +407,7 @@ namespace AMDiS { namespace Parallel {
// === If in debug mode, make some tests. ===
#if (DEBUG != 0)
#ifndef NDEBUG
MSG("AMDiS runs in debug mode, so make some test ...\n");
ParallelDebug::testAllElements(*this);
......@@ -424,7 +424,7 @@ namespace AMDiS { namespace Parallel {
// Remove periodic boundary conditions in sequential problem definition.
removePeriodicBoundaryConditions();
#if (DEBUG != 0)
#ifndef NDEBUG
ParallelDebug::testPeriodicBoundary(*this);
#endif
......@@ -471,7 +471,7 @@ namespace AMDiS { namespace Parallel {
}
updateDofRelatedStruct(meshes[i]);
#if (DEBUG != 0)
#ifndef NDEBUG
ParallelDebug::testPeriodicBoundary(*this);
#endif
}
......@@ -946,7 +946,7 @@ namespace AMDiS { namespace Parallel {
pair<Element*, int> edge1 =
make_pair(elObjDb.getElementPtr(*elIt, meshes[i]), edgeNoInEl[*elIt]);
#if (DEBUG != 0)
#ifndef NDEBUG
DofEdge dofEdge0 = edge0.first->getEdge(edge0.second);
DofEdge dofEdge1 = edge1.first->getEdge(edge1.second);
......@@ -1226,7 +1226,7 @@ namespace AMDiS { namespace Parallel {
vector<int> meshAllValues(meshes.size(), 0);
for (size_t i = 0; i < meshes.size(); i++) {
#if (DEBUG != 0)
#ifndef NDEBUG
MSG("mesh[%d] change index = %d, stored last index = %d.\n",
i, meshes[i]->getChangeIndex(), lastMeshChangeIndexs[meshes[i]]);
#endif
......@@ -1280,7 +1280,7 @@ namespace AMDiS { namespace Parallel {
bool meshChanged = false;
// === Check the boundaries and adapt mesh if necessary. ===
#if (DEBUG != 0)
#ifndef NDEBUG
MSG("Run checkAndAdaptBoundary for mesh[%d]...\n", i);
#endif
......@@ -1325,7 +1325,7 @@ namespace AMDiS { namespace Parallel {
updateLocalGlobalNumbering();
#if (DEBUG != 0)
#ifndef NDEBUG
debug::writeMesh(feSpaces[0], -1, debugOutputDir + "mesh");
ParallelDebug::testPeriodicBoundary(*this);
#endif
......@@ -1337,7 +1337,7 @@ namespace AMDiS { namespace Parallel {
if (repartitioningFailed > 0) {
#if (DEBUG != 0)
#ifndef NDEBUG
MSG("Repartitioning not tried because it has failed in the past!\n");
#endif
......@@ -1463,7 +1463,7 @@ namespace AMDiS { namespace Parallel {
MeshStructure elCode;
elCode.init(boundIt->rankObj, elObjDb.getElementPtr(boundIt->rankObj.elIndex, mesh));
#if (DEBUG != 0)
#ifndef NDEBUG
ParallelDebug::followBoundary(mesh, *boundIt, elCode);
#endif
......@@ -1581,7 +1581,7 @@ namespace AMDiS { namespace Parallel {
} else {
mpiComm.Bcast(&repartitioning, 1, MPI_INT, 0);
}
#if (DEBUG != 0)
#ifndef NDEBUG
if (repartitioning == 0) {
MSG("imbalanceFactor = %f < %f = imbalanceRepartitionBound\n", imbalanceFactor, imbalanceRepartitionBound);
}
......@@ -1633,7 +1633,7 @@ namespace AMDiS { namespace Parallel {
Timer t;
#if (DEBUG != 0)
#ifndef NDEBUG
for (size_t i = 0; i < meshes.size(); i++)
ParallelDebug::testDoubleDofs(meshes[i]);
int writePartMesh = 1;
......@@ -1709,7 +1709,7 @@ namespace AMDiS { namespace Parallel {
updateLocalGlobalNumbering();
#if (DEBUG != 0)
#ifndef NDEBUG
MSG("AMDiS runs in debug mode, so make some test ...\n");
ParallelDebug::writePartitioningFile(debugOutputDir + "partitioning",
......@@ -1734,7 +1734,7 @@ namespace AMDiS { namespace Parallel {
{
FUNCNAME("MeshDistributor::quickRepartition()");
#if (DEBUG != 0)
#ifndef NDEBUG
MSG("... Run quickRepartition ...\n");
#endif
......@@ -1954,7 +1954,7 @@ namespace AMDiS { namespace Parallel {
{
FUNCNAME("MeshDistributor::fullRepartition()");
#if (DEBUG != 0)
#ifndef NDEBUG
MSG("... Run fullRepartition ...\n");
#endif
......@@ -1966,7 +1966,7 @@ namespace AMDiS { namespace Parallel {
MPI::Intracomm &mpiComm = MPI::COMM_WORLD;
#if (DEBUG != 0)
#ifndef NDEBUG
int nOldLeaves = mesh->getNumberOfLeaves();
mpi::globalAdd(mpiComm, nOldLeaves);
#endif
......@@ -2190,7 +2190,7 @@ namespace AMDiS { namespace Parallel {
interchangeVectors[i],
domainMacroValues[macroId][j++]);
#if (DEBUG != 0)
#ifndef NDEBUG
MeshStructure code;
code.init(mesh, macroId);
TEST_EXIT(code.getCode() == domainMacroCodes[macroId].getCode())
......@@ -2224,7 +2224,7 @@ namespace AMDiS { namespace Parallel {
}
updateDofRelatedStruct(mesh);
#if (DEBUG != 0)
#ifndef NDEBUG
int nNewLeaves = mesh->getNumberOfLeaves();
mpi::globalAdd(mpiComm, nNewLeaves);
......@@ -2242,7 +2242,7 @@ namespace AMDiS { namespace Parallel {
elObjDb.create(partitionMap, levelData);
elObjDb.updateRankData();
#if (DEBUG != 0)
#ifndef NDEBUG
if (mpiRank == 0)
ParallelDebug::writePeriodicElObjInfo(*this, debugOutputDir);
#endif
......@@ -2260,7 +2260,7 @@ namespace AMDiS { namespace Parallel {
intBoundary.create(levelData, elObjDb);
#if (DEBUG != 0)
#ifndef NDEBUG
for (int level = 0; level < levelData.getNumberOfLevels(); level++)
ParallelDebug::printBoundaryInfo(intBoundary[level]);
#endif
......@@ -2383,7 +2383,7 @@ namespace AMDiS { namespace Parallel {
mesh->dofCompress();
#if (DEBUG != 0)
#ifndef NDEBUG
debug::ElementIdxToDofs elMap;
debug::createSortedDofs(mesh, elMap);
#endif
......@@ -2400,7 +2400,7 @@ namespace AMDiS { namespace Parallel {
lastMeshChangeIndexs[mesh] = mesh->getChangeIndex();
#if (DEBUG != 0)
#ifndef NDEBUG
static int fileNumber(0); //improvised counter for adapt Iteration
stringstream ss;
ss << debugOutputDir << "elementMaps." << fileNumber ;
......@@ -2434,14 +2434,14 @@ namespace AMDiS { namespace Parallel {
FUNCNAME("MeshDistributor::updateLocalGlobalNumbering()");
Timer t;
#if (DEBUG != 0)
#ifndef NDEBUG
bool printInfo = true;
Parameters::get("parallel->print dofmap info", printInfo);
#endif
for (size_t i = 0; i < dofMaps.size(); i++) {
dofMaps[i]->update();
#if (DEBUG != 0)
#ifndef NDEBUG
if (printInfo)
dofMaps[i]->printInfo();
#endif
......@@ -2456,7 +2456,7 @@ namespace AMDiS { namespace Parallel {
dofMaps[i]->updateMatIndex();
}
#if (DEBUG != 0)
#ifndef NDEBUG
if (printInfo) {
int test = 0;
Parameters::get("parallel->remove periodic boundary", test);
......
......@@ -98,7 +98,7 @@ namespace AMDiS { namespace Parallel {
elInfo = stack.traverseNext(elInfo);
}
#if (DEBUG != 0)
#ifndef NDEBUG
DOFVector<WorldVector<double> > coords(feSpace, "dofCorrds");
feSpace->getMesh()->getDofIndexCoords(coords);
#endif
......@@ -173,7 +173,7 @@ namespace AMDiS { namespace Parallel {
el1->getAllDofs(feSpace, b1, dofs1, true, &dofGeoIndex1);
#if (DEBUG != 0)
#ifndef NDEBUG
if (feSpaces.size())
debug::testDofsByCoords(coords, dofs0, dofs1);
else
......@@ -222,7 +222,7 @@ namespace AMDiS { namespace Parallel {
el0->getAllDofs(feSpace, b0, dofs0, true, &dofGeoIndex0);
el1->getAllDofs(feSpace, b1, dofs1, true, &dofGeoIndex1);
#if (DEBUG != 0)
#ifndef NDEBUG
if (feSpaces.size())
debug::testDofsByCoords(coords, dofs0, dofs1);
else
......@@ -327,7 +327,7 @@ namespace AMDiS { namespace Parallel {
// Create traverse stack and traverse within the mesh until the element,
// which should be fitted to the mesh structure code, is reached.
TraverseStack stack;
#if (DEBUG != 0)
#ifndef NDEBUG
ElInfo *elInfo =