Commit 379e8d5c authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'master' into 'issue/cmake_configuration'

# Conflicts:
#   AMDiS/cmake3/CMakeLists.txt
parents 39c59db5 d272ab51
......@@ -6,7 +6,6 @@ cache:
before_script:
- tools/install_boost.sh
- tools/install_petsc.sh
build:9-debug-gcc:
stage: build
......@@ -28,6 +27,7 @@ build:9-parallel-debug-gcc:
stage: build
image: duneci/base:9
script:
- tools/install_petsc.sh
- tools/build_parallel_amdis.sh Debug
only:
- master
......@@ -36,6 +36,7 @@ build:9-parallel-release-gcc:
stage: build
image: duneci/base:9
script:
- tools/install_petsc.sh
- tools/build_parallel_amdis.sh Release
only:
- master
......@@ -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)
......
......@@ -193,10 +193,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
......@@ -233,8 +230,7 @@ if (MSVC)
_CRT_SECURE_NO_WARNINGS)
endif (MSVC)
target_link_libraries(amdis AMDiS::base muparser
$<$<NOT:$<CONFIG:Release>>:amdis_debug>)
target_link_libraries(amdis AMDiS::base muparser)
# specify how to install this target:
# -----------------------------------
......@@ -259,4 +255,4 @@ configure_file(${BASE_DIR}/cmake3/AMDISConfig.cmake.in
install(FILES ${AMDiS_BINARY_DIR}/AMDISConfig.cmake DESTINATION share/amdis/)
install(FILES ${BASE_DIR}/cmake3/AMDISUse.cmake DESTINATION share/amdis/)
install(FILES ${BASE_DIR}/cmake3/test_compile_features.cmake DESTINATION share/amdis/)
install(FILES ${BASE_DIR}/cmake3/test_compile_features.cmake DESTINATION share/amdis/)
\ No newline at end of file
......@@ -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)
......
......@@ -59,8 +59,8 @@ struct view_code<mtl::matrix::hermitian_view<Matrix> >
template <unsigned Value>
struct view_normalize_const
{
static const unsigned tmp2= Value == 0 || Value == 4 ? Value | 1 : Value, // if matrix ref or transposed, make it const
value= (tmp2 & 3) == 3 ? tmp2 ^ 1 : tmp2; // for conj turn off const
static const unsigned tmp2= Value == 0 || Value == 4 ? Value | 1 : Value; // if matrix ref or transposed, make it const
static const unsigned value= (tmp2 & 3) == 3 ? tmp2 ^ 1 : tmp2; // for conj turn off const
};
template <typename ViewCode>
......
......@@ -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);
......
......@@ -703,7 +703,7 @@ namespace AMDiS {
public StandardProblemIteration
{
using ProblemStatType::getName;
using ProblemStatSeq::info;
using ProblemStatType::info;
/// Constructor
ProblemStat(std::string nameStr,
......
......@@ -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 =
......
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