From: kronbichler Date: Thu, 27 Dec 2012 16:41:06 +0000 (+0000) Subject: Two more MPI_Allreduce commands that should not be called when using a single processor. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee4c18e1ff5d5648dd83e4ee720f988e85897c6a;p=dealii-svn.git Two more MPI_Allreduce commands that should not be called when using a single processor. git-svn-id: https://svn.dealii.org/trunk@27861 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/parallel_vector.h b/deal.II/include/deal.II/lac/parallel_vector.h index a5cc144f9c..9404d915b2 100644 --- a/deal.II/include/deal.II/lac/parallel_vector.h +++ b/deal.II/include/deal.II/lac/parallel_vector.h @@ -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);