aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOASCII
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2007-08-25 06:07:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2007-08-25 06:07:00 +0000
commitd1783e3751269db1174648df0381962bc6cd99c6 (patch)
tree53964dbb97d3b427f0c88e1cc9b9e14c7a954cfa /Carpet/CarpetIOASCII
parentdd542437f74530d2fd939cae8994501fd3e198a0 (diff)
CarpetIOASCII: Add a timer around OutputGH
darcs-hash:20070825060722-dae7b-6ec39b08fbd400e5ad719974090714d409b5b3af.gz
Diffstat (limited to 'Carpet/CarpetIOASCII')
-rw-r--r--Carpet/CarpetIOASCII/interface.ccl1
-rw-r--r--Carpet/CarpetIOASCII/src/ioascii.cc12
2 files changed, 13 insertions, 0 deletions
diff --git a/Carpet/CarpetIOASCII/interface.ccl b/Carpet/CarpetIOASCII/interface.ccl
index e2cad7979..36f675c55 100644
--- a/Carpet/CarpetIOASCII/interface.ccl
+++ b/Carpet/CarpetIOASCII/interface.ccl
@@ -3,6 +3,7 @@
IMPLEMENTS: IOASCII
uses include header: carpet.hh
+uses include header: CarpetTimers.hh
uses include header: dist.hh
diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc
index f47c7d060..b21638be8 100644
--- a/Carpet/CarpetIOASCII/src/ioascii.cc
+++ b/Carpet/CarpetIOASCII/src/ioascii.cc
@@ -11,6 +11,7 @@
#include <map>
#include <ostream>
#include <sstream>
+#include <string>
#include "cctk.h"
#include "cctk_Parameters.h"
@@ -21,6 +22,7 @@
#include "CactusBase/IOUtil/src/ioutil_Utils.h"
#include "carpet.hh"
+#include "CarpetTimers.hh"
#include "ioascii.hh"
@@ -238,11 +240,21 @@ namespace CarpetIOASCII {
int IOASCII<outdim>
::OutputGH (const cGH* const cctkGH)
{
+ static Carpet::Timer * restrict timer = 0;
+ if (not timer) {
+ ostringstream timer_name;
+ timer_name << "CarpetIOASCII<" << outdim << ">::OutputVarAs";
+ timer = new Carpet::Timer (timer_name.str().c_str());
+ }
+
+ timer->start();
for (int vindex=0; vindex<CCTK_NumVars(); ++vindex) {
if (TimeToOutput(cctkGH, vindex)) {
TriggerOutput(cctkGH, vindex);
}
}
+ timer->stop();
+
return 0;
}