]> https://gitweb.dealii.org/ - dealii.git/commitdiff
remove unnecessary communication in Triangulation::update_number_cache 827/head
authorTimo Heister <timo.heister@gmail.com>
Fri, 17 Apr 2015 19:01:43 +0000 (15:01 -0400)
committerTimo Heister <timo.heister@gmail.com>
Fri, 17 Apr 2015 19:01:43 +0000 (15:01 -0400)
source/distributed/tria.cc

index c9f25b85d073bc64b353cab2ed50b2894c468a90..77c9234e4a9f94fcc8638f490c4ffe0d26e16361 100644 (file)
@@ -3526,6 +3526,18 @@ namespace parallel
                  number_cache.n_locally_owned_active_cells.end(),
                  0);
 
+      if (this->n_levels() == 0)
+        {
+          // Skip communication done below if we do not have any cells
+          // (meaning the Triangulation is empty on all processors). This will
+          // happen when called from the destructor of Triangulation, which
+          // can get called during exception handling causing a hang in this
+          // function.
+          number_cache.n_global_active_cells = 0;
+          number_cache.n_global_levels = 0;
+          return;
+        }
+
       if (this->n_levels() > 0)
         for (typename Triangulation<dim,spacedim>::active_cell_iterator
              cell = this->begin_active();

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.