]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add a barrier to avoid MPI race in ConsensusAlgorithm 8935/head
authorTimo Heister <timo.heister@gmail.com>
Mon, 21 Oct 2019 11:19:43 +0000 (13:19 +0200)
committerTimo Heister <timo.heister@gmail.com>
Mon, 21 Oct 2019 11:19:43 +0000 (13:19 +0200)
As discussed in #8929, messages exchanged in this function can be mixed
up if called twice in succesion. Add a Barrier to make sure this won't
happen.

include/deal.II/base/mpi_compute_index_owner_internal.h

index dea27428e494f5cf37df7a3c6c81f9755f1b429c..00642c81b5936871b499053f840eeb591b1ff55e 100644 (file)
@@ -759,6 +759,11 @@ namespace Utilities
               }
 #  endif
 
+            // This barrier is important to make sure that two successive calls
+            // to this functions do not overlap and we confuse messages. See the
+            // discussion in https://github.com/dealii/dealii/issues/8929
+            MPI_Barrier(comm);
+
 #endif // DEAL_II_WITH_MPI
 
             return requested_indices;

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.