From d0bc46bdc6a4ec913b702bf728ebf5d80338c2d6 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 17 Dec 2013 17:29:38 +0000 Subject: [PATCH] take over r32039 and r32040 git-svn-id: https://svn.dealii.org/branches/releases/Branch-8-1@32041 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/8.0.0-vs-8.1.0.h | 7 ++++ deal.II/include/deal.II/base/subscriptor.h | 46 ---------------------- deal.II/source/base/subscriptor.cc | 23 +++++++---- 3 files changed, 22 insertions(+), 54 deletions(-) diff --git a/deal.II/doc/news/8.0.0-vs-8.1.0.h b/deal.II/doc/news/8.0.0-vs-8.1.0.h index 4afef43f2f..bf47fc3f32 100644 --- a/deal.II/doc/news/8.0.0-vs-8.1.0.h +++ b/deal.II/doc/news/8.0.0-vs-8.1.0.h @@ -259,6 +259,13 @@ inconvenience this causes.

Specific improvements

    +
  1. Fixed: Move the implementation of Subscriptor::(un)subscribe() to + the .cc file so that it is possible to link against the debug library + without specifying -DDEBUG +
    + (Wolfgang Bangerth, 2013/12/13) +
  2. +
  3. Fixed: Since the introduction of ThreadLocalStorage in version 8.0, the way in which FEValues objects visit cells in a parallel assembly loop is no longer deterministic. Therefore, the detection of CellSimilarity that can diff --git a/deal.II/include/deal.II/base/subscriptor.h b/deal.II/include/deal.II/base/subscriptor.h index 44d425865c..f7319cb6b5 100644 --- a/deal.II/include/deal.II/base/subscriptor.h +++ b/deal.II/include/deal.II/base/subscriptor.h @@ -180,20 +180,6 @@ public: void serialize(Archive &ar, const unsigned int version); private: - /** - * Register a subscriber for - * debugging purposes. Called by - * subscribe() in debug mode. - */ - void do_subscribe(const char *id) const; - - /** - * Deregister a subscriber for - * debugging purposes. Called by - * unsubscribe() in debug mode. - */ - void do_unsubscribe(const char *id) const; - /** * The data type used in * #counter_map. @@ -274,38 +260,6 @@ Subscriptor::serialize(Archive &, // documentation of this function } -// If we are in optimized mode, the subscription checking is turned -// off. Therefore, we provide inline definitions of subscribe and -// unsubscribe here. The definitions for debug mode are in -// subscriptor.cc. - -#ifdef DEBUG - -inline void -Subscriptor::subscribe(const char *id) const -{ - do_subscribe(id); -} - - -inline void -Subscriptor::unsubscribe(const char *id) const -{ - do_unsubscribe(id); -} - -#else - -inline void -Subscriptor::subscribe(const char *) const -{} - - -inline void -Subscriptor::unsubscribe(const char *) const -{} - -#endif DEAL_II_NAMESPACE_CLOSE #endif diff --git a/deal.II/source/base/subscriptor.cc b/deal.II/source/base/subscriptor.cc index 505eff1214..422c2311e6 100644 --- a/deal.II/source/base/subscriptor.cc +++ b/deal.II/source/base/subscriptor.cc @@ -142,10 +142,10 @@ Subscriptor &Subscriptor::operator = (const Subscriptor &s) return *this; } -// These are the implementations for debug mode. The optimized -// versions are inlined in the header file. -void Subscriptor::do_subscribe (const char *id) const + +void +Subscriptor::subscribe(const char *id) const { #ifdef DEBUG if (object_info == 0) @@ -153,7 +153,7 @@ void Subscriptor::do_subscribe (const char *id) const Threads::Mutex::ScopedLock lock (subscription_lock); ++counter; -#ifndef DEAL_II_WITH_THREADS +# ifndef DEAL_II_WITH_THREADS const char *const name = (id != 0) ? id : unknown_subscriber; map_iterator it = counter_map.find(name); @@ -162,12 +162,15 @@ void Subscriptor::do_subscribe (const char *id) const else it->second++; -#endif +# endif +#else + (void)id; #endif } -void Subscriptor::do_unsubscribe (const char *id) const +void +Subscriptor::unsubscribe(const char *id) const { #ifdef DEBUG const char *name = (id != 0) ? id : unknown_subscriber; @@ -180,23 +183,27 @@ void Subscriptor::do_unsubscribe (const char *id) const Threads::Mutex::ScopedLock lock (subscription_lock); --counter; -#ifndef DEAL_II_WITH_THREADS +# ifndef DEAL_II_WITH_THREADS map_iterator it = counter_map.find(name); AssertNothrow (it != counter_map.end(), ExcNoSubscriber(object_info->name(), name)); AssertNothrow (it->second > 0, ExcNoSubscriber(object_info->name(), name)); it->second--; -#endif +# endif +#else + (void)id; #endif } + unsigned int Subscriptor::n_subscriptions () const { return counter; } + void Subscriptor::list_subscribers () const { #ifndef DEAL_II_WITH_THREADS -- 2.39.5