Commit 1d66354e authored by Praetorius, Simon's avatar Praetorius, Simon

added flag ENABLE_MPI to cmake

parent 1f023756
......@@ -179,6 +179,11 @@ add_library(amdis
${SOURCE_DIR}/ProblemStatDbg.cc
)
if (ENABLE_MPI)
target_enable_mpi(amdis_base INTERFACE)
target_compile_definitions(amdis_base INTERFACE HAVE_MPI=1)
endif (ENABLE_MPI)
include(amdis_parallel) # adds sources to amdis
include(amdis_extensions) # -> target AMDiS::extensions
include(muparser) # -> target muparser
......
......@@ -39,7 +39,7 @@ namespace AMDiS {
const char *funcName = NULL;
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) || defined(HAVE_OPENMP)
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) || defined(HAVE_OPENMP) || defined(HAVE_MPI)
bool Msg::outputMainRank = true;
#endif
......@@ -132,7 +132,7 @@ namespace AMDiS {
void Msg::print_funcname(const char *funcName)
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) || defined(HAVE_MPI)
if (outputMainRank && MPI::COMM_WORLD.Get_rank() != 0)
return;
#endif
......@@ -227,7 +227,7 @@ namespace AMDiS {
const char *file,
int line)
{
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) && defined(NDEBUG)
#if (defined(HAVE_PARALLEL_DOMAIN_AMDIS) || defined(HAVE_MPI)) && defined(NDEBUG)
if (outputMainRank && MPI::COMM_WORLD.Get_rank() != 0)
return;
#endif
......@@ -265,7 +265,7 @@ namespace AMDiS {
void Msg::print_warn(const char *format, ...)
{
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) && defined(NDEBUG)
#if (defined(HAVE_PARALLEL_DOMAIN_AMDIS) || defined(HAVE_MPI)) && defined(NDEBUG)
if (outputMainRank && MPI::COMM_WORLD.Get_rank() != 0)
return;
#endif
......@@ -289,7 +289,7 @@ namespace AMDiS {
void Msg::print(const char *format, ...)
{
#ifndef SUPPRESS_OUTPUT
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) || defined(HAVE_MPI)
if (outputMainRank && MPI::COMM_WORLD.Get_rank() != 0)
return;
#endif
......
......@@ -53,7 +53,7 @@
#include <unistd.h>
#endif
#if HAVE_PARALLEL_DOMAIN_AMDIS
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) || defined(HAVE_MPI)
#include <mpi.h>
#endif
......@@ -131,7 +131,7 @@ namespace AMDiS {
#if SUPPRESS_OUTPUT
#define PRINT_LINE(stream, line)
#else
#if HAVE_PARALLEL_DOMAIN_AMDIS
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) || defined(HAVE_MPI)
#define PRINT_LINE(stream, line) stream << "[" << MPI::COMM_WORLD.Get_rank() << "] " << line
#elif defined(HAVE_OPENMP)
#define PRINT_LINE(stream, line) stream << "[" << omp_get_thread_num() << "] " << line
......@@ -333,7 +333,7 @@ namespace AMDiS {
}
public:
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) || defined(HAVE_OPENMP)
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) || defined(HAVE_OPENMP) || defined(HAVE_MPI)
/// In parallel computations, when this variable is true, only the 0 rank will
/// print messages to the output stream. Error messages and warnings are always
/// printed from all ranks.
......
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