]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move barrier between step-6 and step-7 12148/head
authorDaniel Arndt <arndtd@ornl.gov>
Wed, 5 May 2021 23:06:14 +0000 (19:06 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Wed, 5 May 2021 23:06:14 +0000 (19:06 -0400)
include/deal.II/base/aligned_vector.h

index 6f0eddc8b028bdf641258fb426640360097480e4..9f093a09d4575bf378c6683cebc221fb20a6b981 100644 (file)
@@ -1510,6 +1510,10 @@ AlignedVector<T>::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<T>::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

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.