From 9545137b03ecde9c8d0fc145cbfcd5a7560fd984 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sun, 3 Apr 2022 23:04:26 +0200 Subject: [PATCH] LA::d::V:reinit() add check --- include/deal.II/lac/la_parallel_vector.templates.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index 06a79961fe..f1eca66944 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -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(); -- 2.39.5