summaryrefslogtreecommitdiffstats
path: root/src/H5Tdbg.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2020-07-02 15:36:44 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2020-07-02 15:36:44 (GMT)
commitd05b58b5d4806d694f16d0fc698c5e1c057a411b (patch)
tree1931c3ebb10d98d90b694adb1588945d9519c394 /src/H5Tdbg.c
parent7cbb5fe2d177e49417401e1dc0b2a4c9d618cc67 (diff)
parent7371c83f9777b34b31909e99e052398b93c31bed (diff)
downloadhdf5-d05b58b5d4806d694f16d0fc698c5e1c057a411b.zip
hdf5-d05b58b5d4806d694f16d0fc698c5e1c057a411b.tar.gz
hdf5-d05b58b5d4806d694f16d0fc698c5e1c057a411b.tar.bz2
Merge pull request #2668 in HDFFV/hdf5 from monotonic_timer to develop
* commit '7371c83f9777b34b31909e99e052398b93c31bed': Remove non-existent example Add new source files to CMake build Clean up warnings va_arg -> HDva_arg Refactor code to remove remaining checks for H5_HAVE_GETTIMEOFDAY scattered around in various places. Also clean up iopipe.c. Correct mistake in H5_now_usec calculation for clock_gettime. Remove detection for mach/mach/time.h, since we're no longer using the time routines from that header. Update H5_now_usec to prefer using clock_gettime. Changes to make timers within the library monotonic.
Diffstat (limited to 'src/H5Tdbg.c')
-rw-r--r--src/H5Tdbg.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c
index 605310a..693174a 100644
--- a/src/H5Tdbg.c
+++ b/src/H5Tdbg.c
@@ -95,25 +95,24 @@
herr_t
H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/*in,out*/)
{
-#ifdef H5T_DEBUG
- hsize_t nbytes;
- char bandwidth[32];
-#endif
-
FUNC_ENTER_PACKAGE_NOERR
#ifdef H5T_DEBUG
- if (H5DEBUG(T) && path->stats.ncalls > 0) {
- if (nprint && 0 == (*nprint)++) {
- HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n");
- HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n",
- "Conversion", "Elmts", "Calls", "User",
- "System", "Elapsed", "Bandwidth");
- HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n",
- "----------", "-----", "-----", "----",
- "------", "-------", "---------");
- }
- if (path->src && path->dst)
+ if(H5DEBUG(T) && path->stats.ncalls > 0) {
+ hsize_t nbytes;
+ char bandwidth[32];
+
+ if(nprint && 0 == (*nprint)++) {
+ HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n");
+ HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n",
+ "Conversion", "Elmts", "Calls", "User",
+ "System", "Elapsed", "Bandwidth");
+ HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n",
+ "----------", "-----", "-----", "----",
+ "------", "-------", "---------");
+ } /* end if */
+
+ if(path->src && path->dst)
nbytes = MAX(H5T_get_size(path->src), H5T_get_size(path->dst));
else if (path->src)
nbytes = H5T_get_size(path->src);
@@ -121,18 +120,20 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/*
nbytes = H5T_get_size(path->dst);
else
nbytes = 0;
- nbytes *= path->stats.nelmts;
- H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime);
- HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n",
- path->name,
- path->stats.nelmts,
- path->stats.ncalls,
- path->stats.timer.utime,
- path->stats.timer.stime,
- path->stats.timer.etime,
- bandwidth);
- }
+
+ nbytes *= path->stats.nelmts;
+ H5_bandwidth(bandwidth, (double)nbytes, path->stats.times.elapsed);
+ HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8T %8T %8T %10s\n",
+ path->name,
+ path->stats.nelmts,
+ path->stats.ncalls,
+ path->stats.times.user,
+ path->stats.times.system,
+ path->stats.times.elapsed,
+ bandwidth);
+ } /* end if */
#endif
+
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5T__print_stats() */