From: Daniel Arndt Date: Fri, 18 Aug 2017 17:13:30 +0000 (+0200) Subject: Fix failing MPI tests X-Git-Tag: v9.0.0-rc1~1210^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=719c7914972b68d2fe49e074bb467fcb479ec4ff;p=dealii.git Fix failing MPI tests --- diff --git a/include/deal.II/distributed/grid_tools.h b/include/deal.II/distributed/grid_tools.h index c794a707ca..3cc8761238 100644 --- a/include/deal.II/distributed/grid_tools.h +++ b/include/deal.II/distributed/grid_tools.h @@ -337,12 +337,8 @@ namespace parallel { internal::CellDataTransferBuffer &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 }