From: Timo Heister Date: Thu, 16 Apr 2020 21:45:52 +0000 (-0400) Subject: documentation: workload_imbalance and assert valid X-Git-Tag: v9.2.0-rc1~204^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=baf940a8eaec3fced3496cedf3d8ac33376a1cd3;p=dealii.git documentation: workload_imbalance and assert valid --- diff --git a/include/deal.II/multigrid/mg_tools.h b/include/deal.II/multigrid/mg_tools.h index 1d3f6240d5..c57546fa1d 100644 --- a/include/deal.II/multigrid/mg_tools.h +++ b/include/deal.II/multigrid/mg_tools.h @@ -290,6 +290,15 @@ namespace MGTools * globally refined meshes). Values greater than 1 estimate the slowdown * one should see in a geometric multigrid v-cycle as compared with the same * computation on a perfectly distributed mesh hierarchy. + * + * This function is a collective MPI call between all ranks of the + * Triangulation and therefore needs to be called from all ranks. + * + * @note This function requires that + * parallel::TriangulationBase::is_multilevel_hierarchy_constructed() + * is true, which can be controlled by setting the + * construct_multigrid_hierarchy flag when constructing the + * Triangulation. */ template double diff --git a/source/multigrid/mg_tools.cc b/source/multigrid/mg_tools.cc index 70a3fa81d8..9dac385c63 100644 --- a/source/multigrid/mg_tools.cc +++ b/source/multigrid/mg_tools.cc @@ -1668,6 +1668,11 @@ namespace MGTools dynamic_cast *>( &tria)) { + Assert( + tr->is_multilevel_hierarchy_constructed(), + ExcMessage( + "We can only compute the workload imbalance if the multilevel hierarchy has been constructed!")); + const unsigned int n_proc = Utilities::MPI::n_mpi_processes(tr->get_communicator()); const unsigned int n_global_levels = tr->n_global_levels();