]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Two more MPI_Allreduce commands that should not be called when using a single processor.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 27 Dec 2012 16:41:06 +0000 (16:41 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 27 Dec 2012 16:41:06 +0000 (16:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@27861 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/parallel_vector.h

index a5cc144f9c7c9b417303d95a8085cb821e4251c8..9404d915b21ebc37d2f07421d836a4051787456b 100644 (file)
@@ -1085,8 +1085,11 @@ namespace parallel
         {
           unsigned int local_ranges_different_loc = (local_range() !=
                                                      c.local_range());
-          if (Utilities::MPI::max(local_ranges_different_loc,
-                                  partitioner->get_communicator()) != 0)
+          if ((partitioner->n_mpi_processes() > 1 &&
+               Utilities::MPI::max(local_ranges_different_loc,
+                                   partitioner->get_communicator()) != 0)
+              ||
+              local_ranges_different_loc)
             reinit (c, true);
         }
       vector_view = c.vector_view;
@@ -1114,8 +1117,11 @@ namespace parallel
         {
           unsigned int local_ranges_different_loc = (local_range() !=
                                                      c.local_range());
-          if (Utilities::MPI::max(local_ranges_different_loc,
-                                  partitioner->get_communicator()) != 0)
+          if ((partitioner->n_mpi_processes() > 1 &&
+               Utilities::MPI::max(local_ranges_different_loc,
+                                   partitioner->get_communicator()) != 0)
+              ||
+              local_ranges_different_loc)
             reinit (c, true);
         }
       vector_view.reinit (partitioner->local_size(), val);

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.