]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Update vectors if *one* processor has changed, not if *every* processor has changed.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 28 Oct 2009 04:31:18 +0000 (04:31 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 28 Oct 2009 04:31:18 +0000 (04:31 +0000)
git-svn-id: https://svn.dealii.org/trunk@19998 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/petsc_parallel_vector.cc

index 38b2efa4e11632c0dde0402fd82b499a6b343556..7945fadb6ae657549848ce656ba4d9f120a23499 100644 (file)
@@ -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

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.