6 Dec
2010
6 Dec
'10
10:58 a.m.
(1) You must initialize MPI with MPI_Init_thread() instead of MPI_Init(). The boost::mpi::communicator ctor uses MPI_Init(), so you must run the initialization yourself and *then* create the communicator object. For instance:: MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED) // ... mpi::communicator world;
Riccardo,
I have the following code in my main:
int main(int argc, char* argv[])
{
boost::mpi::environment env(argc, argv);
const int mpi_thread_support = MPI::Init_thread(argc, argv, MPI_THREAD_SERIALIZED );
if (mpi_thread_support != MPI_THREAD_SERIALIZED)
{
std::cerr<< "MPI implementation does not support threads" <