summaryrefslogtreecommitdiffstats
path: root/perform/pio_timer.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2002-05-07 15:22:31 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2002-05-07 15:22:31 (GMT)
commit3984d62ca3f7043f428bf0b8e25695ef09482aa7 (patch)
treec6573063a33e98b50f7a0df21fded28df3f1bf94 /perform/pio_timer.c
parent74861bfaeb8553113c56deb306522e53f3531539 (diff)
downloadhdf5-3984d62ca3f7043f428bf0b8e25695ef09482aa7.zip
hdf5-3984d62ca3f7043f428bf0b8e25695ef09482aa7.tar.gz
hdf5-3984d62ca3f7043f428bf0b8e25695ef09482aa7.tar.bz2
[svn-r5368] Purpose:
Bug fix, feature Description: Added code to time pure MPI_File_write_xxx and read_xxx routines. Moved the setting of the timer_g to when timer is created (new) and destroyed. Platforms tested: modi4pp
Diffstat (limited to 'perform/pio_timer.c')
-rw-r--r--perform/pio_timer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/perform/pio_timer.c b/perform/pio_timer.c
index 1bf1b0c..cee7f6d 100644
--- a/perform/pio_timer.c
+++ b/perform/pio_timer.c
@@ -27,6 +27,9 @@
*/
#define MILLISECOND 1000000.0
+/* global variables */
+pio_time *timer_g; /* timer: global for stub functions */
+
/*
* Function: pio_time_new
* Purpose: Build us a brand, spankin', new performance time object.
@@ -43,6 +46,8 @@ pio_time_new(unsigned int type)
pio_time *pt = (pio_time *)calloc(1, sizeof(struct pio_time_));
register int i;
+ /* set global timer variable */
+ timer_g = pt;
for (i = 0; i < NUM_TIMERS; ++i)
pt->total_time[i] = 0.0;
@@ -63,6 +68,8 @@ void
pio_time_destroy(pio_time *pt)
{
free(pt);
+ /* reset the global timer pointer too. */
+ timer_g = NULL;
}
/*