From 43a12f69aeb248aa43242e32b96688abc38bbd97 Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 28 Oct 2009 04:31:18 +0000 Subject: [PATCH] Update vectors if *one* processor has changed, not if *every* processor has changed. git-svn-id: https://svn.dealii.org/trunk@19998 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/source/petsc_parallel_vector.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/deal.II/lac/source/petsc_parallel_vector.cc b/deal.II/lac/source/petsc_parallel_vector.cc index 38b2efa4e1..7945fadb6a 100644 --- a/deal.II/lac/source/petsc_parallel_vector.cc +++ b/deal.II/lac/source/petsc_parallel_vector.cc @@ -74,8 +74,13 @@ namespace PETScWrappers communicator = comm; // only do something if the sizes - // mismatch - if ((size() != n) || (local_size() != local_sz)) + // mismatch (may not be true for every proc) + + int k_global, k = ((size() != n) || (local_size() != local_sz)); + MPI_Allreduce (&k, &k_global, 1, + MPI_INT, MPI_LOR, communicator); + + if (k_global) { // FIXME: I'd like to use this here, // but somehow it leads to odd errors -- 2.39.5