Skip to content
Snippets Groups Projects
Commit 32ff3bee authored by Steffen Müthing's avatar Steffen Müthing
Browse files

Merge branch 'feature/FS1612-improve-error-massage-for-missing-MPIHelper'

* feature/FS1612-improve-error-massage-for-missing-MPIHelper:
  [MPI] Check that MPI was initialized when constructing a CollectiveCommunication
parents 04e45ce5 d7a14f78
No related branches found
No related tags found
No related merge requests found
...@@ -150,6 +150,10 @@ namespace Dune ...@@ -150,6 +150,10 @@ namespace Dune
: communicator(c) : communicator(c)
{ {
if(communicator!=MPI_COMM_NULL) { if(communicator!=MPI_COMM_NULL) {
int initialized = 0;
MPI_Initialized(&initialized);
if (!initialized)
DUNE_THROW(ParallelError,"You must call MPIHelper::instance(argc,argv) in your main() function before using the MPI CollectiveCommunication!");
MPI_Comm_rank(communicator,&me); MPI_Comm_rank(communicator,&me);
MPI_Comm_size(communicator,&procs); MPI_Comm_size(communicator,&procs);
}else{ }else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment