From ccfe3f30a0f40247a4baa851ee373e71761bf5cf Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Fri, 17 Apr 2015 15:01:43 -0400 Subject: [PATCH] remove unnecessary communication in Triangulation::update_number_cache --- source/distributed/tria.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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(); -- 2.39.5