aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOHDF5
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/CarpetIOHDF5
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/CarpetIOHDF5')
-rw-r--r--Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc2
-rw-r--r--Carpet/CarpetIOHDF5/src/OutputSlice.cc14
2 files changed, 7 insertions, 9 deletions
diff --git a/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc b/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc
index 1305a49d1..d3b40c187 100644
--- a/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc
+++ b/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc
@@ -522,7 +522,7 @@ static void CheckSteerableParameters (const cGH *const cctkGH,
static int OutputGH (const cGH* const cctkGH)
{
- static Carpet::Timer timer ("CarpetIOHDF5::OutputGH");
+ static Carpet::Timer timer ("OutputGH");
timer.start();
for (int vindex = CCTK_NumVars () - 1; vindex >= 0; vindex--) {
if (TimeToOutput (cctkGH, vindex)) {
diff --git a/Carpet/CarpetIOHDF5/src/OutputSlice.cc b/Carpet/CarpetIOHDF5/src/OutputSlice.cc
index 28b92e716..e01d80f40 100644
--- a/Carpet/CarpetIOHDF5/src/OutputSlice.cc
+++ b/Carpet/CarpetIOHDF5/src/OutputSlice.cc
@@ -231,20 +231,18 @@ namespace CarpetIOHDF5 {
template<int outdim>
int IOHDF5<outdim>::OutputGH (const cGH* const cctkGH)
{
- static Carpet::Timer * timer = NULL;
- if (not timer) {
- ostringstream timer_name;
- timer_name << "CarpetIOHDF5<" << outdim << ">::OutputGH";
- timer = new Carpet::Timer (timer_name.str().c_str());
- }
+ ostringstream timer_name;
+ timer_name << "OutputGH<" << outdim << ">";
+
+ Carpet::Timer timer(timer_name.str());
- timer->start();
+ timer.start();
for (int vi=0; vi<CCTK_NumVars(); ++vi) {
if (TimeToOutput(cctkGH, vi)) {
TriggerOutput(cctkGH, vi);
}
}
- timer->stop();
+ timer.stop();
return 0;
}