From e30a80a2340275774e464b5ce7b328f0ece84b44 Mon Sep 17 00:00:00 2001 From: Christopher Kelly Date: Thu, 15 Feb 2018 17:13:36 +0000 Subject: [PATCH] Relaxed constraints on MPI thread mode when not using multiple comms threads --- lib/communicator/Communicator_mpi3.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/communicator/Communicator_mpi3.cc b/lib/communicator/Communicator_mpi3.cc index 6732dcdf..eb0144f0 100644 --- a/lib/communicator/Communicator_mpi3.cc +++ b/lib/communicator/Communicator_mpi3.cc @@ -44,7 +44,10 @@ void CartesianCommunicator::Init(int *argc, char ***argv) MPI_Initialized(&flag); // needed to coexist with other libs apparently if ( !flag ) { MPI_Init_thread(argc,argv,MPI_THREAD_MULTIPLE,&provided); - assert (provided == MPI_THREAD_MULTIPLE); + //If only 1 comms thread we require any threading mode other than SINGLE, but for multiple comms threads we need MULTIPLE + if( (nCommThreads == 1 && provided == MPI_THREAD_SINGLE) || + (nCommThreads > 1 && provided != MPI_THREAD_MULTIPLE) ) + assert(0); } Grid_quiesce_nodes();