]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix failing MPI tests 4904/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 18 Aug 2017 17:13:30 +0000 (19:13 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 18 Aug 2017 23:53:56 +0000 (01:53 +0200)
include/deal.II/distributed/grid_tools.h

index c794a707ca2d13c9098cb4048568574efda0addb..3cc8761238d7bbcef8e2e292501c3eed7cc76a8f 100644 (file)
@@ -337,12 +337,8 @@ namespace parallel
         {
           internal::CellDataTransferBuffer<dim, DataType> &data = destination_to_data_buffer_map[*it];
 
-          // pack all the data into
-          // the buffer for this
-          // recipient and send
-          // it. keep data around
-          // till we can make sure
-          // that the packet has been
+          // pack all the data into the buffer for this recipient and send it.
+          // keep data around till we can make sure that the packet has been
           // received
           sendbuffers[idx] = data.pack_data ();
           const int ierr = MPI_Isend(sendbuffers[idx].data(), sendbuffers[idx].size(),
@@ -384,6 +380,14 @@ namespace parallel
               unpack(cell, *data);
             }
         }
+
+      // make sure that all communication is finished
+      // when we leave this function.
+      if (requests.size())
+        {
+          const int ierr = MPI_Waitall(requests.size(), &requests[0], MPI_STATUSES_IGNORE);
+          AssertThrowMPI(ierr);
+        }
 #endif // DEAL_II_WITH_MPI
     }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.