From: Peter Munch Date: Sun, 3 Apr 2022 21:04:26 +0000 (+0200) Subject: LA::d::V:reinit() add check X-Git-Tag: v9.4.0-rc1~337^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9545137b03ecde9c8d0fc145cbfcd5a7560fd984;p=dealii.git LA::d::V:reinit() add check --- 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();