aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOASCII
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2011-06-02 11:13:18 +0200
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 18:26:31 +0000
commit354e98350a75316f2976b7ccdd43938797485a7c (patch)
tree949469c4e5735a15f0edd26d557387ab28cb3e0a /Carpet/CarpetIOASCII
parent26ee29ba4a30a2111bf0e130b916a657ba139a97 (diff)
Adapt Carpet to hierarchical timers
Specifically, remove any hierarchy information that has been added to the name of timers, as well as any code for creating timers dynamically, as these are now unnecessary. Additionally, time some previously-untimed parts of the code and make timer names in some places more consistent.
Diffstat (limited to 'Carpet/CarpetIOASCII')
-rw-r--r--Carpet/CarpetIOASCII/src/ioascii.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc
index cb3419037..31e61e5fd 100644
--- a/Carpet/CarpetIOASCII/src/ioascii.cc
+++ b/Carpet/CarpetIOASCII/src/ioascii.cc
@@ -228,20 +228,17 @@ namespace CarpetIOASCII {
template<int outdim>
int IOASCII<outdim>::OutputGH (const cGH* const cctkGH)
{
- static Carpet::Timer * timer = NULL;
- if (not timer) {
- ostringstream timer_name;
- timer_name << "CarpetIOASCII<" << outdim << ">::OutputGH";
- timer = new Carpet::Timer (timer_name.str().c_str());
- }
-
- timer->start();
+ ostringstream timer_name;
+ timer_name << "OutputGH<" << outdim << ">";
+ Carpet::Timer timer(timer_name.str());
+
+ timer.start();
for (int vi=0; vi<CCTK_NumVars(); ++vi) {
if (TimeToOutput(cctkGH, vi)) {
TriggerOutput(cctkGH, vi);
}
}
- timer->stop();
+ timer.stop();
return 0;
}