From 1f3fc4527263561a854f233f8d41c9624f0e8fad Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 5 May 2021 19:06:14 -0400 Subject: [PATCH] Move barrier between step-6 and step-7 --- include/deal.II/base/aligned_vector.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/deal.II/base/aligned_vector.h b/include/deal.II/base/aligned_vector.h index 6f0eddc8b0..9f093a09d4 100644 --- a/include/deal.II/base/aligned_vector.h +++ b/include/deal.II/base/aligned_vector.h @@ -1510,6 +1510,10 @@ AlignedVector::replicate_across_communicator(const MPI_Comm & communicator, new (&aligned_shmem_pointer[i]) T(std::move(elements[i])); } + // Make sure that the shared memory host has copied the data before we try to + // access it. + MPI_Barrier(shmem_group_communicator); + // **** Step 7 **** // Finally, we need to set the pointers of this object to what we just // learned. This also releases all memory that may have been in use @@ -1553,10 +1557,6 @@ AlignedVector::replicate_across_communicator(const MPI_Comm & communicator, used_elements_end = elements.get() + array_size; allocated_elements_end = used_elements_end; - // Make sure that the shared memory host has copied the data before we try to - // access it. - MPI_Barrier(shmem_group_communicator); - // **** Consistency check **** // At this point, each process should have a copy of the data. // Verify this in some sort of round-about way -- 2.39.5