Skip to content
Snippets Groups Projects
Commit eda99c75 authored by Christoph Schwarzmeier's avatar Christoph Schwarzmeier
Browse files

Merge branch '73-segfaults-with-openmpi-2-1-1' into 'master'

Resolve "Segfaults with OpenMPI 2.1.1"

Closes #73

See merge request walberla/walberla!148
parents 2b8fedf4 23120264
No related merge requests found
...@@ -22,12 +22,14 @@ ...@@ -22,12 +22,14 @@
//====================================================================================================================== //======================================================================================================================
#include "MPIManager.h" #include "MPIManager.h"
#include "core/logging/Logging.h"
#include <boost/exception_ptr.hpp> #include <boost/exception_ptr.hpp>
#include <exception> #include <exception>
#include <iostream> #include <iostream>
#include <stdexcept> #include <stdexcept>
#include <vector> #include <vector>
#include <string>
namespace walberla{ namespace walberla{
...@@ -107,6 +109,22 @@ void MPIManager::initializeMPI( int* argc, char*** argv, bool abortOnException ) ...@@ -107,6 +109,22 @@ void MPIManager::initializeMPI( int* argc, char*** argv, bool abortOnException )
MPI_Comm_size( MPI_COMM_WORLD, &numProcesses_ ); MPI_Comm_size( MPI_COMM_WORLD, &numProcesses_ );
MPI_Comm_rank( MPI_COMM_WORLD, &worldRank_ ); MPI_Comm_rank( MPI_COMM_WORLD, &worldRank_ );
// Avoid using the Cartesian MPI-communicator with certain versions of OpenMPI (see waLBerla issue #73)
#if defined(OMPI_MAJOR_VERSION) && defined(OMPI_MINOR_VERSION) && defined(OMPI_RELEASE_VERSION)
std::string ompi_ver = std::to_string(OMPI_MAJOR_VERSION) + "." + std::to_string(OMPI_MINOR_VERSION) + "." +
std::to_string(OMPI_RELEASE_VERSION);
if (ompi_ver == "2.0.0" || ompi_ver == "2.0.1" || ompi_ver == "2.0.2" || ompi_ver == "2.0.3" ||
ompi_ver == "2.1.0" || ompi_ver == "2.1.1") {
useWorldComm();
WALBERLA_LOG_WARNING_ON_ROOT( "Your version of OpenMPI (" << ompi_ver << ") contains a bug. See waLBerla "
"issue #73 for more information. Using MPI_COMM_WORLD instead of a Cartesian "
"MPI communicator as a workaround." );
}
#endif
if( abortOnException ) if( abortOnException )
std::set_terminate( customTerminateHandler ); std::set_terminate( customTerminateHandler );
} }
......
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