]> https://gitweb.dealii.org/ - dealii.git/commitdiff
LA::d::V:reinit() add check 13589/head
authorPeter Munch <peterrmuench@gmail.com>
Sun, 3 Apr 2022 21:04:26 +0000 (23:04 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Sun, 3 Apr 2022 21:04:26 +0000 (23:04 +0200)
include/deal.II/lac/la_parallel_vector.templates.h

index 06a79961fe3e4eaca8c3acc3c5c9fd1b1f6050b3..f1eca66944b3154b3472075b3a96dfa4b87392f2 100644 (file)
@@ -643,14 +643,17 @@ namespace LinearAlgebra
       const MPI_Comm &                                          comm_sm)
     {
       clear_mpi_requests();
-      partitioner = partitioner_in;
 
       this->comm_sm = comm_sm;
 
       // set vector size and allocate memory
-      const size_type new_allocated_size =
-        partitioner->locally_owned_size() + partitioner->n_ghost_indices();
-      resize_val(new_allocated_size, comm_sm);
+      if (partitioner.get() != partitioner_in.get())
+        {
+          partitioner = partitioner_in;
+          const size_type new_allocated_size =
+            partitioner->locally_owned_size() + partitioner->n_ghost_indices();
+          resize_val(new_allocated_size, comm_sm);
+        }
 
       // initialize to zero
       *this = Number();

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.