summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-08-19 22:46:31 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-08-19 22:46:31 (GMT)
commite455040749ca1d47fb218b9bb35d78247fb9561d (patch)
tree2d26f2ae1fea1ff393f00eb36e3f2155dec690b6 /src/H5S.c
parent4322bfe90ab7de7245ff770155867fa5da78147c (diff)
downloadhdf5-e455040749ca1d47fb218b9bb35d78247fb9561d.zip
hdf5-e455040749ca1d47fb218b9bb35d78247fb9561d.tar.gz
hdf5-e455040749ca1d47fb218b9bb35d78247fb9561d.tar.bz2
[svn-r606] Debugging can be enabled/disabled at runtime though code is still
conditionally included at compile time. Tracing and debugging share the same environment variable. All is documented in Debugging.html.
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c138
1 files changed, 71 insertions, 67 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 7fb1088..48bde7c 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -105,73 +105,77 @@ H5S_term_interface(void)
/*
* Print statistics about each conversion path.
*/
- for (i=0; i<H5S_nconv_g; i++) {
- path = H5S_conv_g[i];
- for (j=0; j<2; j++) {
- if (0==path->stats[j].gath_ncalls &&
- 0==path->stats[j].scat_ncalls &&
- 0==path->stats[j].bkg_ncalls) {
- continue;
- }
- if (0==nprints++) {
- fprintf(stderr, "H5S: data space conversion statistics "
- "accumulated over life of library:\n");
- fprintf(stderr, " %-16s %10s %10s %8s %8s %8s %10s\n",
- "Memory <> File", "Bytes", "Calls",
- "User", "System", "Elapsed", "Bandwidth");
- fprintf(stderr, " %-16s %10s %10s %8s %8s %8s %10s\n",
- "--------------", "-----", "-----",
- "----", "------", "-------", "---------");
- }
-
- /* Summary */
- sprintf(buf, "%s %c %s",
- path->m->name, 0==j?'>':'<', path->f->name);
- fprintf(stderr, " %-16s\n", buf);
-
- /* Gather */
- if (path->stats[j].gath_ncalls) {
- H5_bandwidth(buf, (double)(path->stats[j].gath_nbytes),
- path->stats[j].gath_timer.etime);
- HDfprintf(stderr,
- " %16s %10Hu %10Hu %8.2f %8.2f %8.2f %10s\n",
- "gather",
- path->stats[j].gath_nbytes,
- path->stats[j].gath_ncalls,
- path->stats[j].gath_timer.utime,
- path->stats[j].gath_timer.stime,
- path->stats[j].gath_timer.etime,
- buf);
- }
-
- /* Scatter */
- if (path->stats[j].scat_ncalls) {
- H5_bandwidth(buf, (double)(path->stats[j].scat_nbytes),
- path->stats[j].scat_timer.etime);
- HDfprintf(stderr,
- " %16s %10Hu %10Hu %8.2f %8.2f %8.2f %10s\n",
- "scatter",
- path->stats[j].scat_nbytes,
- path->stats[j].scat_ncalls,
- path->stats[j].scat_timer.utime,
- path->stats[j].scat_timer.stime,
- path->stats[j].scat_timer.etime,
- buf);
- }
-
- /* Background */
- if (path->stats[j].bkg_ncalls) {
- H5_bandwidth(buf, (double)(path->stats[j].bkg_nbytes),
- path->stats[j].bkg_timer.etime);
- HDfprintf(stderr,
- " %16s %10Hu %10Hu %8.2f %8.2f %8.2f %10s\n",
- "background",
- path->stats[j].bkg_nbytes,
- path->stats[j].bkg_ncalls,
- path->stats[j].bkg_timer.utime,
- path->stats[j].bkg_timer.stime,
- path->stats[j].bkg_timer.etime,
- buf);
+ if (H5DEBUG(S)) {
+ for (i=0; i<H5S_nconv_g; i++) {
+ path = H5S_conv_g[i];
+ for (j=0; j<2; j++) {
+ if (0==path->stats[j].gath_ncalls &&
+ 0==path->stats[j].scat_ncalls &&
+ 0==path->stats[j].bkg_ncalls) {
+ continue;
+ }
+ if (0==nprints++) {
+ fprintf(H5DEBUG(S), "H5S: data space conversion "
+ "statistics accumulated over life of library:\n");
+ fprintf(H5DEBUG(S),
+ " %-16s %10s %10s %8s %8s %8s %10s\n",
+ "Memory <> File", "Bytes", "Calls",
+ "User", "System", "Elapsed", "Bandwidth");
+ fprintf(H5DEBUG(S),
+ " %-16s %10s %10s %8s %8s %8s %10s\n",
+ "--------------", "-----", "-----",
+ "----", "------", "-------", "---------");
+ }
+
+ /* Summary */
+ sprintf(buf, "%s %c %s",
+ path->m->name, 0==j?'>':'<', path->f->name);
+ fprintf(H5DEBUG(S), " %-16s\n", buf);
+
+ /* Gather */
+ if (path->stats[j].gath_ncalls) {
+ H5_bandwidth(buf, (double)(path->stats[j].gath_nbytes),
+ path->stats[j].gath_timer.etime);
+ HDfprintf(H5DEBUG(S),
+ " %16s %10Hu %10Hu %8.2f %8.2f %8.2f %10s\n",
+ "gather",
+ path->stats[j].gath_nbytes,
+ path->stats[j].gath_ncalls,
+ path->stats[j].gath_timer.utime,
+ path->stats[j].gath_timer.stime,
+ path->stats[j].gath_timer.etime,
+ buf);
+ }
+
+ /* Scatter */
+ if (path->stats[j].scat_ncalls) {
+ H5_bandwidth(buf, (double)(path->stats[j].scat_nbytes),
+ path->stats[j].scat_timer.etime);
+ HDfprintf(H5DEBUG(S),
+ " %16s %10Hu %10Hu %8.2f %8.2f %8.2f %10s\n",
+ "scatter",
+ path->stats[j].scat_nbytes,
+ path->stats[j].scat_ncalls,
+ path->stats[j].scat_timer.utime,
+ path->stats[j].scat_timer.stime,
+ path->stats[j].scat_timer.etime,
+ buf);
+ }
+
+ /* Background */
+ if (path->stats[j].bkg_ncalls) {
+ H5_bandwidth(buf, (double)(path->stats[j].bkg_nbytes),
+ path->stats[j].bkg_timer.etime);
+ HDfprintf(H5DEBUG(S),
+ " %16s %10Hu %10Hu %8.2f %8.2f %8.2f %10s\n",
+ "background",
+ path->stats[j].bkg_nbytes,
+ path->stats[j].bkg_ncalls,
+ path->stats[j].bkg_timer.utime,
+ path->stats[j].bkg_timer.stime,
+ path->stats[j].bkg_timer.etime,
+ buf);
+ }
}
}
}