]> https://gitweb.dealii.org/ - dealii.git/commitdiff
documentation: workload_imbalance and assert valid 9912/head
authorTimo Heister <timo.heister@gmail.com>
Thu, 16 Apr 2020 21:45:52 +0000 (17:45 -0400)
committerTimo Heister <timo.heister@gmail.com>
Sun, 19 Apr 2020 19:26:54 +0000 (15:26 -0400)
include/deal.II/multigrid/mg_tools.h
source/multigrid/mg_tools.cc

index 1d3f6240d5745d38dabaa2921e960992f63da3ae..c57546fa1d492421702755b2b90de26caaa9eb6c 100644 (file)
@@ -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 <int dim, int spacedim>
   double
index 70a3fa81d84ed9664503d863ebcf5681de03bde4..9dac385c6382b38e9e873cce0508635fb94d2c1b 100644 (file)
@@ -1668,6 +1668,11 @@ namespace MGTools
           dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
             &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();

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.