From: Wolfgang Bangerth Date: Wed, 28 Oct 2009 04:31:18 +0000 (+0000) Subject: Update vectors if *one* processor has changed, not if *every* processor has changed. X-Git-Tag: v8.0.0~6871 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55e48d7cc8dafffedf5f5d21ec9c5fc95b39689c;p=dealii.git 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 --- 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