From: Timo Heister Date: Fri, 17 Apr 2015 19:01:43 +0000 (-0400) Subject: remove unnecessary communication in Triangulation::update_number_cache X-Git-Tag: v8.3.0-rc1~252^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccfe3f30a0f40247a4baa851ee373e71761bf5cf;p=dealii.git remove unnecessary communication in Triangulation::update_number_cache --- diff --git a/source/distributed/tria.cc b/source/distributed/tria.cc index c9f25b85d0..77c9234e4a 100644 --- a/source/distributed/tria.cc +++ b/source/distributed/tria.cc @@ -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::active_cell_iterator cell = this->begin_active();