]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make sure to actually zero the ghost entries in partitioner import call. 5303/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 23 Oct 2017 13:39:15 +0000 (15:39 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 23 Oct 2017 13:39:15 +0000 (15:39 +0200)
include/deal.II/base/partitioner.templates.h
tests/mpi/parallel_partitioner_07.cc

index 0b0a45e567f484299ade3471ded51f1eaca429fe..4ffc40f4682fff0f302c864121924fec84e394af 100644 (file)
@@ -402,9 +402,7 @@ namespace Utilities
 
       // clear the ghost array in case we did not yet do that in the _start
       // function
-      if (n_ghost_indices_in_larger_set == n_ghost_indices() ||
-          ghost_array.size() != n_ghost_indices_in_larger_set)
-        std::memset(ghost_array.begin(), 0, sizeof(Number)*n_ghost_indices());
+      std::memset(ghost_array.begin(), 0, sizeof(Number)*n_ghost_indices());
 
       // clear the compress requests
       requests.resize(0);
index f669b8663c747d4e7b6a5e2654bdf0e5cb9f4fa3..a78aaa65331f4a5fe2b08b02d2b02a7ddde2666b 100644 (file)
@@ -97,6 +97,9 @@ void test ()
                                            temp_array.size()),
                                        make_array_view(locally_owned_array),
                                        make_array_view(ghosts), requests);
+    // check that the ghost entries are zeroed out in these calls
+    for (unsigned int i=0; i<v.n_ghost_indices(); ++i)
+      AssertDimension(ghosts[i], 0);
   }
   deallog << "From all ghosts: ";
   for (unsigned int i=0; i<locally_owned_array.size(); ++i)
@@ -117,6 +120,10 @@ void test ()
                                            temp_array.size()),
                                        make_array_view(locally_owned_array),
                                        make_array_view(ghosts), requests);
+
+    // check that the ghost entries are zeroed out in these calls
+    for (unsigned int i=0; i<w.n_ghost_indices(); ++i)
+      AssertDimension(ghosts[i], 0);
   }
   deallog << "From reduced ghosts 1: ";
   for (unsigned int i=0; i<locally_owned_array.size(); ++i)
@@ -137,6 +144,10 @@ void test ()
                                            temp_array.size()),
                                        make_array_view(locally_owned_array),
                                        make_array_view(ghosts), requests);
+
+    // check that the ghost entries are zeroed out in these calls
+    for (unsigned int i=0; i<x.n_ghost_indices(); ++i)
+      AssertDimension(ghosts[i], 0);
   }
   deallog << "From reduced ghosts 2: ";
   for (unsigned int i=0; i<locally_owned_array.size(); ++i)

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.