--- /dev/null
+Fixed: The destructor of TimerOutput::Scope will now always exit the subsection
+it entered in its constructor, instead of just exiting the last subsection that
+was created in the provided TimerOutput object. This fixes timing output
+measurements for multithreaded applications and cases where subsections are
+nested.
+<br>
+(David Wells, 2017/09/14)
* Reference to the TimerOutput object
*/
dealii::TimerOutput &timer;
+
+ /**
+ * Name of the section we need to exit
+ */
+ const std::string section_name;
+
/**
* Do we still need to exit the section we are in?
*/
}
inline
-TimerOutput::Scope::Scope(dealii::TimerOutput &timer_, const std::string §ion_name)
+TimerOutput::Scope::Scope(dealii::TimerOutput &timer_,
+ const std::string §ion_name_)
:
- timer(timer_), in(true)
+ timer(timer_),
+ section_name(section_name_),
+ in(true)
{
timer.enter_section(section_name);
}
if (!in) return;
in=false;
- timer.exit_section();
+ timer.exit_section(section_name);
}