......@@ -42,6 +42,8 @@
# -BUILD_IA_TESTS=OFF; [ON]
# 8. FFT options:
# -USE_FFTW=OFF; [ON]
# 9. Split MPI communicators
# -USE_SPLITTED_COMMS=OFF; [ON]
#---------------------------------------------------------------------------------------#
# If no project directory is set yet assume that M++ is the project itself
......@@ -117,6 +119,12 @@ if (BUILD_IA_VERIFY_QUAD)
endif ()
#---------------------------------------------------------------------------------------#
if (USE_SPLITTED_COMMS)
message(STATUS "Fully splitted MPI world communicator")
add_definitions(-DSPLIT_COMM)
endif ()
#---------------------------------------------------------------------------------------#
# MPI
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
......
......@@ -44,7 +44,9 @@ ParallelProgrammingModel::~ParallelProgrammingModel() {
void ParallelProgrammingModel::Initialize(int argc, char **argv) {
if (IsInitialized()) Exit("PPM already initialized!")
ppm = new ParallelProgrammingModel(&argc, &argv);
#ifdef SPLIT_COMM
PPM->FullSplit();
#endif
}
bool ParallelProgrammingModel::IsInitialized() {
......
......@@ -20,7 +20,7 @@ Mpp &Mpp::instance() {
// Todo change signature to
// Mpp::Mpp(int argc, char **argv)
Mpp::Mpp(int *argc, char **argv) {
ParallelProgrammingModel::Initialize(*argc, argv);
ParallelProgrammingModel::Initialize(*argc, argv);
Config::initialize(argc, argv);
config.get("DebugLevel", DebugLevel);
......