summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-09-04 15:20:58 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-09-04 15:20:58 (GMT)
commitfb838d175ca20b9a105e9e0f9b0ff6bc11aee041 (patch)
treef7f28a1f6264a8fb60d8c389ad5729cf61de880b
parente589c2ed3d14a825d1befae65ec7ee156b6c976e (diff)
downloadhdf5-fb838d175ca20b9a105e9e0f9b0ff6bc11aee041.zip
hdf5-fb838d175ca20b9a105e9e0f9b0ff6bc11aee041.tar.gz
hdf5-fb838d175ca20b9a105e9e0f9b0ff6bc11aee041.tar.bz2
[svn-r670] Fixed a bandwidth calculation for the partial read test.
-rw-r--r--test/ragged.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/test/ragged.c b/test/ragged.c
index c23cafe..981663d 100644
--- a/test/ragged.c
+++ b/test/ragged.c
@@ -430,6 +430,7 @@ ragged_read_short(hid_t ra, hsize_t rows_at_once, hsize_t width)
hsize_t i, j;
hssize_t row; /*current row number */
hsize_t interval_nelmts; /*elmts/interval timer */
+ hsize_t read_nelmts=0; /*total elements read */
hsize_t *size=NULL; /*size of each row */
C_MTYPE **buf=NULL; /*buffer for each row */
H5_timer_t timer, timer_total; /*performance timers */
@@ -484,8 +485,13 @@ ragged_read_short(hid_t ra, hsize_t rows_at_once, hsize_t width)
interval_nelmts += MIN(width, size[i]);
/*
- * Total number of elements for all the rows read so far. This
- * is used to calculate the percent done.
+ * Total number of elements actually read for rows so far.
+ */
+ read_nelmts += MIN(width, size[i]);
+
+ /*
+ * Total number of elements attributed to the rows read so far.
+ * This is used to calculate the percent done.
*/
total_nelmts += size[i];
@@ -510,7 +516,7 @@ ragged_read_short(hid_t ra, hsize_t rows_at_once, hsize_t width)
H5_bandwidth(s, (double)interval_nelmts*sizeof(C_MTYPE),
timer.etime);
printf(" %8lu %8lu %7.3f%% %10s%s\n",
- (unsigned long)(row+i), (unsigned long)total_nelmts,
+ (unsigned long)(row+i), (unsigned long)read_nelmts,
100.0*total_nelmts/MAX_NELMTS, s,
0==timeout_g?" (aborting)":"");
interval_nelmts = 0;
@@ -531,11 +537,11 @@ ragged_read_short(hid_t ra, hsize_t rows_at_once, hsize_t width)
H5_timer_end(&timer_total, &timer);
H5_bandwidth(s, (double)interval_nelmts*sizeof(C_MTYPE), timer.etime);
printf(" %8lu %8lu %7.3f%% %10s\n",
- (unsigned long)row, (unsigned long)total_nelmts,
+ (unsigned long)row, (unsigned long)read_nelmts,
100.0*total_nelmts/MAX_NELMTS, s);
}
printf(" -------- -------- -------- ----------\n");
- H5_bandwidth(s, (double)total_nelmts*sizeof(C_MTYPE), timer_total.etime);
+ H5_bandwidth(s, (double)read_nelmts*sizeof(C_MTYPE), timer_total.etime);
printf(" %27s%10s\n", "", s);
/* Cleanup */