From b5a8c179373d2fd87d10af08702c3ea91f71e699 Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Fri, 26 Oct 2012 00:56:32 +0200 Subject: Support more than one hierarchy of timers * Introduce a TimerTree class which contains a pointer to the root and current TimerNodes of that tree * Adapt TimerNode and Timer classes to use TimerTrees rather than static variables * Declare a main_timer_tree variable, which is the default tree to use if you don't specify one in Timer timer("timername") --- Carpet/Carpet/src/Evolve.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Carpet/Carpet/src/Evolve.cc') diff --git a/Carpet/Carpet/src/Evolve.cc b/Carpet/Carpet/src/Evolve.cc index 936414d40..aa51efe23 100644 --- a/Carpet/Carpet/src/Evolve.cc +++ b/Carpet/Carpet/src/Evolve.cc @@ -97,8 +97,7 @@ namespace Carpet { cctkGH->cctk_iteration % output_timer_tree_every == 0 and cctkGH->cctk_iteration % do_every == 0) { - TimerNode *rt = TimerNode::getRootTimer(); - TimerNode *et = rt->getChildTimer("Evolve"); + TimerNode *et = main_timer_tree.root->getChildTimer("Evolve"); et->print(cout, et->getTime(), 0, timer_tree_threshold_percentage, timer_tree_output_precision); } timer.stop(); -- cgit v1.2.3