From 26ee29ba4a30a2111bf0e130b916a657ba139a97 Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Wed, 1 Jun 2011 08:55:24 +0200 Subject: Add timer tree output and associated parameters New parameters output_initialise_timer_tree and output_timer_tree_every control output of a new "timer tree diagram" to standard output for the Initialise and Evolve timer trees respectively. These diagrams indicate: 1. the value of each timer; 2. the percentage of the given tree taken by each timer; 3. which timers are contained in which other timers; 4. any untimed code for any timer which takes more than 1% of the tree time. --- Carpet/Carpet/src/Evolve.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Carpet/Carpet/src/Evolve.cc') diff --git a/Carpet/Carpet/src/Evolve.cc b/Carpet/Carpet/src/Evolve.cc index 4eb348c96..06a598ca0 100644 --- a/Carpet/Carpet/src/Evolve.cc +++ b/Carpet/Carpet/src/Evolve.cc @@ -19,6 +19,7 @@ #include #include #include +#include "TimerNode.hh" @@ -85,6 +86,15 @@ namespace Carpet { { Carpet::TimerSet::writeData (cctkGH, timer_file); } + + if (output_timer_tree_every > 0 and + cctkGH->cctk_iteration % output_timer_tree_every == 0 and + cctkGH->cctk_iteration % do_every == 0) + { + TimerNode *rt = TimerNode::getRootTimer(); + TimerNode *et = rt->getChildTimer("Evolve"); + et->print(cout, et->getTime(), 0, 1.0); + } } // Ensure that all levels have consistent times -- cgit v1.2.3