diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2011-06-02 11:13:18 +0200 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2011-12-14 18:26:31 +0000 |
commit | 354e98350a75316f2976b7ccdd43938797485a7c (patch) | |
tree | 949469c4e5735a15f0edd26d557387ab28cb3e0a /Carpet/CarpetIOHDF5/src/OutputSlice.cc | |
parent | 26ee29ba4a30a2111bf0e130b916a657ba139a97 (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/src/OutputSlice.cc')
-rw-r--r-- | Carpet/CarpetIOHDF5/src/OutputSlice.cc | 14 |
1 files changed, 6 insertions, 8 deletions
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; } |