aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/gdata.hh
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2004-12-30 21:21:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2004-12-30 21:21:00 +0000
commitf527714bcb9e2a2c672cee14c7e612a177475309 (patch)
treea061092722eab7d8fd46c7d71c673803a6ba3005 /Carpet/CarpetLib/src/gdata.hh
parent191478e48a3c8236e023d4c302145d6b443fc8f2 (diff)
CarpetLib: Collect more timing statistics
Collect more timing statistics in the data class. Print these statistics to stdout when the Cactus parameter print_timestats is set. Create a timer class "timestat". This is a timer that can be started, stopped, and it prints the total time as well as some statistics. For memory allocation statistics, count the number of objects as well as the number of bytes. darcs-hash:20041230212136-891bb-c14edfa7d539ae9b135eee76afadaad51fd0b098.gz
Diffstat (limited to 'Carpet/CarpetLib/src/gdata.hh')
-rw-r--r--Carpet/CarpetLib/src/gdata.hh46
1 files changed, 43 insertions, 3 deletions
diff --git a/Carpet/CarpetLib/src/gdata.hh b/Carpet/CarpetLib/src/gdata.hh
index fc65004e6..de4d512c3 100644
--- a/Carpet/CarpetLib/src/gdata.hh
+++ b/Carpet/CarpetLib/src/gdata.hh
@@ -50,6 +50,49 @@ public:
+// Time (in seconds) spend during various operations
+struct timestat {
+ double wtime;
+ double wtime2;
+ double count;
+ timestat ();
+private:
+ bool running;
+ double starttime;
+public:
+ void start();
+ void stop();
+private:
+ void addstat (double const t);
+};
+
+ostream& operator<< (ostream& os, const timestat& wt);
+
+extern timestat wtime_copyfrom_recv;
+extern timestat wtime_copyfrom_send;
+extern timestat wtime_copyfrom_wait;
+
+extern timestat wtime_copyfrom_recv_maketyped;
+extern timestat wtime_copyfrom_recv_allocate;
+extern timestat wtime_copyfrom_recv_changeproc_recv;
+extern timestat wtime_copyfrom_send_copyfrom_nocomm1;
+extern timestat wtime_copyfrom_send_copyfrom_nocomm2;
+extern timestat wtime_copyfrom_send_changeproc_send;
+extern timestat wtime_copyfrom_wait_changeproc_wait;
+extern timestat wtime_copyfrom_wait_copyfrom_nocomm;
+extern timestat wtime_copyfrom_wait_delete;
+
+extern timestat wtime_changeproc_recv;
+extern timestat wtime_changeproc_send;
+extern timestat wtime_changeproc_wait;
+
+extern timestat wtime_irecv;
+extern timestat wtime_isend;
+extern timestat wtime_irecvwait;
+extern timestat wtime_isendwait;
+
+
+
// A generic data storage without type information
template<int D>
class gdata {
@@ -64,9 +107,6 @@ protected: // should be readonly
const int varindex; // Cactus variable index, or -1
operator_type transport_operator;
- double wtime_isend, wtime_isendwait;
- double wtime_irecv, wtime_irecvwait;
-
bool _has_storage; // has storage associated (on some processor)
bool _owns_storage; // owns the storage
// (only valid if there is storage on this processor; it means that