]> https://gitweb.dealii.org/ - dealii.git/commitdiff
locally_owned_size() in PETScVector and PETScVectorBase
authorDavid Wells <drwells@email.unc.edu>
Mon, 25 May 2020 16:29:52 +0000 (12:29 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 11 Feb 2021 16:52:47 +0000 (11:52 -0500)
source/lac/petsc_parallel_vector.cc
source/lac/petsc_vector_base.cc

index e370c65667a37875324758854ba2fbacf1f7ee32..4e7e83d3649e3eba7e00790a877a992207e42329 100644 (file)
@@ -90,9 +90,11 @@ namespace PETScWrappers
       , communicator(v.communicator)
     {
       if (v.has_ghost_elements())
-        Vector::create_vector(v.size(), v.local_size(), v.ghost_indices);
+        Vector::create_vector(v.size(),
+                              v.locally_owned_size(),
+                              v.ghost_indices);
       else
-        Vector::create_vector(v.size(), v.local_size());
+        Vector::create_vector(v.size(), v.locally_owned_size());
 
       this->operator=(v);
     }
@@ -128,7 +130,7 @@ namespace PETScWrappers
           if (v.has_ghost_elements())
             reinit(v.locally_owned_elements(), v.ghost_indices, v.communicator);
           else
-            reinit(v.communicator, v.size(), v.local_size(), true);
+            reinit(v.communicator, v.size(), v.locally_owned_size(), true);
         }
 
       PetscErrorCode ierr = VecCopy(v.vector, vector);
@@ -168,7 +170,7 @@ namespace PETScWrappers
       // only do something if the sizes
       // mismatch (may not be true for every proc)
 
-      int k_global, k = ((size() != n) || (local_size() != local_sz));
+      int k_global, k = ((size() != n) || (locally_owned_size() != local_sz));
       {
         const int ierr =
           MPI_Allreduce(&k, &k_global, 1, MPI_INT, MPI_LOR, communicator);
@@ -213,7 +215,10 @@ namespace PETScWrappers
             }
         }
       else
-        reinit(v.communicator, v.size(), v.local_size(), omit_zeroing_entries);
+        reinit(v.communicator,
+               v.size(),
+               v.locally_owned_size(),
+               omit_zeroing_entries);
     }
 
 
index 3b9cf737fa355f21f2d0ba3e4388a26c127a1ada..204cf4ba24e276a8ba22e3be3e5b89bf3ee30bb0 100644 (file)
@@ -606,8 +606,9 @@ namespace PETScWrappers
     PetscErrorCode ierr = VecGetArray(vector, &start_ptr);
     AssertThrow(ierr == 0, ExcPETScError(ierr));
 
-    const PetscScalar *ptr = start_ptr, *eptr = start_ptr + local_size();
-    bool               flag = true;
+    const PetscScalar *ptr  = start_ptr,
+                      *eptr = start_ptr + locally_owned_size();
+    bool flag               = true;
     while (ptr != eptr)
       {
         if (*ptr != value_type())
@@ -659,8 +660,9 @@ namespace PETScWrappers
     PetscErrorCode ierr = VecGetArray(vector, &start_ptr);
     AssertThrow(ierr == 0, ExcPETScError(ierr));
 
-    const PetscScalar *ptr = start_ptr, *eptr = start_ptr + local_size();
-    bool               flag = true;
+    const PetscScalar *ptr  = start_ptr,
+                      *eptr = start_ptr + locally_owned_size();
+    bool flag               = true;
     while (ptr != eptr)
       {
         if (!internal::is_non_negative(*ptr))

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.