diff options
-rw-r--r-- | Carpet/Carpet/param.ccl | 11 | ||||
-rw-r--r-- | Carpet/Carpet/src/Evolve.cc | 10 | ||||
-rw-r--r-- | Carpet/Carpet/src/Initialise.cc | 10 |
3 files changed, 30 insertions, 1 deletions
diff --git a/Carpet/Carpet/param.ccl b/Carpet/Carpet/param.ccl index bb1566534..b9a106548 100644 --- a/Carpet/Carpet/param.ccl +++ b/Carpet/Carpet/param.ccl @@ -523,3 +523,14 @@ STRING timer_xml_clock "Which clock to use in the XML timer output file" { ".*" :: "must be a legal clock name" } "gettimeofday" + + +BOOLEAN output_initialise_timer_tree "Output timing information in tree form to standard output for Initialise" +{ +} "no" + +INT output_timer_tree_every "Output timing information in tree form to standard output for Evolve every so many iterations" +{ + 0 :: "don't report" + 1:* :: "report every so many iterations" +} 0 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 <carpet.hh> #include <Timers.hh> #include <TimerSet.hh> +#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 diff --git a/Carpet/Carpet/src/Initialise.cc b/Carpet/Carpet/src/Initialise.cc index 23b6e6457..3ff57aa4e 100644 --- a/Carpet/Carpet/src/Initialise.cc +++ b/Carpet/Carpet/src/Initialise.cc @@ -14,6 +14,7 @@ #include <carpet.hh> #include <Timers.hh> #include <TimerSet.hh> +#include <TimerNode.hh> @@ -133,7 +134,14 @@ namespace Carpet { if (output_timers_every > 0) { TimerSet::writeData (cctkGH, timer_file); } - + + if (output_initialise_timer_tree) + { + TimerNode *rt = TimerNode::getRootTimer(); + TimerNode *it = rt->getChildTimer("Initialise"); + it->print(cout, it->getTime(), 0, 1.0); + } + Waypoint ("Done with initialisation"); return 0; |