summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2018-12-02 06:17:15 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2018-12-02 06:17:15 (GMT)
commit49f45640f6b1a3f162027f22a0f00b6eb7f3f433 (patch)
treeefd0f1ec87de84e17969c0d079d1ffa32aab3a8c
parentce2748f0114cb1eae00799f8349a5451152c7fa3 (diff)
downloadhdf5-49f45640f6b1a3f162027f22a0f00b6eb7f3f433.zip
hdf5-49f45640f6b1a3f162027f22a0f00b6eb7f3f433.tar.gz
hdf5-49f45640f6b1a3f162027f22a0f00b6eb7f3f433.tar.bz2
(1) Fix for accumulator issue #1 as described in John's previous checkin
(2) Test files for encoding/decoding property lists (3) Fix test failures for PB statistics in test/page_buffer.c (Will double check with John later about PB statistics collection)
-rw-r--r--src/H5PB.c19
-rw-r--r--src/H5Pfapl.c3
-rw-r--r--test/page_buffer.c42
-rw-r--r--test/testfiles/plist_files/def_fapl_32bebin1711 -> 3801 bytes
-rw-r--r--test/testfiles/plist_files/def_fapl_32lebin1711 -> 3801 bytes
-rw-r--r--test/testfiles/plist_files/def_fapl_64bebin1711 -> 3801 bytes
-rw-r--r--test/testfiles/plist_files/def_fapl_64lebin1711 -> 3801 bytes
-rw-r--r--test/testfiles/plist_files/fapl_32bebin1713 -> 3803 bytes
-rw-r--r--test/testfiles/plist_files/fapl_32lebin1713 -> 3803 bytes
-rw-r--r--test/testfiles/plist_files/fapl_64bebin1713 -> 3803 bytes
-rw-r--r--test/testfiles/plist_files/fapl_64lebin1713 -> 3803 bytes
-rw-r--r--test/testfiles/plist_files/lapl_32bebin1816 -> 3906 bytes
-rw-r--r--test/testfiles/plist_files/lapl_32lebin1816 -> 3906 bytes
-rw-r--r--test/testfiles/plist_files/lapl_64bebin1816 -> 3906 bytes
-rw-r--r--test/testfiles/plist_files/lapl_64lebin1816 -> 3906 bytes
15 files changed, 36 insertions, 28 deletions
diff --git a/src/H5PB.c b/src/H5PB.c
index dbee611..2df8837 100644
--- a/src/H5PB.c
+++ b/src/H5PB.c
@@ -57,7 +57,7 @@
* The following #define controls this. Set VFD_IO to FALSE to reproduce
* the bug.
*/
-#define VFD_IO TRUE
+#define VFD_IO FALSE
/******************/
@@ -1951,8 +1951,7 @@ H5PB__load_page(H5F_t *f, H5PB_t *pb_ptr, haddr_t addr, H5FD_mem_t type,
* written. Skip the read if addr > EOF. In this case, tell
* H5PB__create_new_page() to zero the page image.
*/
- skip_read = (addr >= eof);
-
+ /* Remove "skip_read = (addr >= eof);" when accumulator is used */
/* make space in the page buffer if necessary */
if ( ( pb_ptr->curr_pages >= pb_ptr->max_pages ) &&
@@ -2533,7 +2532,7 @@ H5PB__read_meta(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size,
if ( entry_ptr == NULL ) { /* case 7 */
/* update hit rate stats */
- H5PB__UPDATE_PB_HIT_RATE_STATS(pb_ptr, FALSE, TRUE, TRUE)
+ H5PB__UPDATE_PB_HIT_RATE_STATS(pb_ptr, FALSE, TRUE, size > pb_ptr->page_size)
/* If the read is for metadata, is page aligned, is larger
* than one page, and there is no entry in the page buffer,
@@ -2547,6 +2546,8 @@ H5PB__read_meta(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size,
HGOTO_ERROR(H5E_PAGEBUF, H5E_READERROR, FAIL, \
"driver read request failed (1)")
+
+ H5PB__UPDATE_STATS_FOR_BYPASS(pb_ptr, type, size);
} else {
HDassert( entry_ptr );
@@ -2590,6 +2591,8 @@ H5PB__read_meta(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size,
HGOTO_ERROR(H5E_PAGEBUF, H5E_READERROR, FAIL, \
"driver read request failed (2)")
+
+ H5PB__UPDATE_STATS_FOR_BYPASS(pb_ptr, type, size);
} else {
HDassert( entry_ptr->image_ptr );
@@ -2609,7 +2612,7 @@ H5PB__read_meta(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size,
}
/* update hit rate stats */
- H5PB__UPDATE_PB_HIT_RATE_STATS(pb_ptr, TRUE, TRUE, TRUE)
+ H5PB__UPDATE_PB_HIT_RATE_STATS(pb_ptr, TRUE, TRUE, FALSE)
}
} else { /* case 9 */
@@ -2814,6 +2817,9 @@ H5PB__read_raw(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size,
"read through metadata accumulator failed")
+ H5PB__UPDATE_STATS_FOR_BYPASS(pb_ptr, type, size);
+
+
/* For each page that intersects with the above read, check to see
* if it exists in the page buffer, and if so, if it is dirty.
*
@@ -3346,6 +3352,9 @@ H5PB__write_raw(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size,
HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, \
"write through metadata accumulator failed")
+
+ H5PB__UPDATE_STATS_FOR_BYPASS(pb_ptr, type, size);
+
/* For each page that intersects with the above write, check to see
* if it exists in the page buffer.
*
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index fbac84d..71ab475 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -3985,7 +3985,8 @@ H5P__facc_vfd_swmr_config_enc(const void *value, void **_pp, size_t *size)
} /* end if */
/* Compute encoded size */
- *size += ( (4 * sizeof(int32_t)) + sizeof(unsigned) +
+ *size += ( (4 * sizeof(int32_t)) +
+ (2 * sizeof(unsigned)) +
(2 * (H5F__MAX_VFD_SWMR_FILE_NAME_LEN + 1)) );
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/test/page_buffer.c b/test/page_buffer.c
index 58e6323..c537ad7 100644
--- a/test/page_buffer.c
+++ b/test/page_buffer.c
@@ -2053,22 +2053,22 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if ( ( f->shared->pb_ptr->accesses[0] != 10 ) ||
+ if ( ( f->shared->pb_ptr->accesses[0] != 9 ) ||
( f->shared->pb_ptr->accesses[1] != 16 ) ||
( f->shared->pb_ptr->accesses[2] != 0 ) ) {
- HDfprintf(stderr, "accesses[] = {%d, %d, %d}. {10, 16, 0} expected\n",
+ HDfprintf(stderr, "accesses[] = {%d, %d, %d}. {9, 16, 0} expected\n",
f->shared->pb_ptr->accesses[0],
f->shared->pb_ptr->accesses[1],
f->shared->pb_ptr->accesses[2]);
TEST_ERROR;
}
- if ( ( f->shared->pb_ptr->bypasses[0] != 0 ) ||
- ( f->shared->pb_ptr->bypasses[1] != 0 ) ||
+ if ( ( f->shared->pb_ptr->bypasses[0] != 2 ) ||
+ ( f->shared->pb_ptr->bypasses[1] != 1 ) ||
( f->shared->pb_ptr->bypasses[2] != 1 ) ) {
- HDfprintf(stderr, "bypasses[] = {%d, %d, %d}. {0, 0, 1} expected\n",
+ HDfprintf(stderr, "bypasses[] = {%d, %d, %d}. {2, 1, 1} expected\n",
f->shared->pb_ptr->bypasses[0],
f->shared->pb_ptr->bypasses[1],
f->shared->pb_ptr->bypasses[2]);
@@ -2086,26 +2086,25 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
}
- if ( ( f->shared->pb_ptr->misses[0] != 10 ) ||
+ if ( ( f->shared->pb_ptr->misses[0] != 9 ) ||
( f->shared->pb_ptr->misses[1] != 16 ) ||
( f->shared->pb_ptr->misses[2] != 0 ) ) {
- HDfprintf(stderr, "misses[] = {%d, %d, %d}. {10, 16, 0} expected\n",
+ HDfprintf(stderr, "misses[] = {%d, %d, %d}. {9, 16, 0} expected\n",
f->shared->pb_ptr->misses[0],
f->shared->pb_ptr->misses[1],
f->shared->pb_ptr->misses[2]);
TEST_ERROR;
}
- if ( ( f->shared->pb_ptr->evictions[0] != 7 + base_meta_cnt ) ||
- ( f->shared->pb_ptr->evictions[1] != 9 + base_raw_cnt ) ||
+ if ( ( f->shared->pb_ptr->evictions[0] != 7) ||
+ ( f->shared->pb_ptr->evictions[1] != 9) ||
( f->shared->pb_ptr->evictions[2] != 0 ) ) {
HDfprintf(stderr, "evictions[] = {%d, %d, %d}. {%d, %d, 0} expected\n",
f->shared->pb_ptr->evictions[0],
f->shared->pb_ptr->evictions[1],
- f->shared->pb_ptr->evictions[2],
- 7 + base_meta_cnt, 9 + base_raw_cnt);
+ f->shared->pb_ptr->evictions[2], 7, 9);
TEST_ERROR;
}
@@ -2120,21 +2119,21 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
evictions, bypasses) < 0)
FAIL_STACK_ERROR;
- if ( ( accesses[0] != 10 ) ||
+ if ( ( accesses[0] != 9 ) ||
( accesses[1] != 16 ) ||
( accesses[2] != 0 ) ) {
HDfprintf(stderr,
- "accesses[] = {%d, %d, %d}. {10, 16, 0} expected\n",
+ "accesses[] = {%d, %d, %d}. {9, 16, 0} expected\n",
accesses[0], accesses[1], accesses[2]);
TEST_ERROR;
}
- if ( ( bypasses[0] != 0 ) ||
- ( bypasses[1] != 0 ) ||
+ if ( ( bypasses[0] != 2 ) ||
+ ( bypasses[1] != 1 ) ||
( bypasses[2] != 1 ) ) {
- HDfprintf(stderr, "bypasses[] = {%d, %d, %d}. {0, 0, 1} expected\n",
+ HDfprintf(stderr, "bypasses[] = {%d, %d, %d}. {2, 1, 1} expected\n",
bypasses[0], bypasses[1], bypasses[2]);
TEST_ERROR;
}
@@ -2148,23 +2147,22 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
}
- if ( ( misses[0] != 10 ) ||
+ if ( ( misses[0] != 9 ) ||
( misses[1] != 16 ) ||
( misses[2] != 0 ) ) {
- HDfprintf(stderr, "misses[] = {%d, %d, %d}. {10, 16, 0} expected\n",
+ HDfprintf(stderr, "misses[] = {%d, %d, %d}. {9, 16, 0} expected\n",
misses[0], misses[1], misses[2]);
TEST_ERROR;
}
- if ( ( evictions[0] != 7 + base_meta_cnt ) ||
- ( evictions[1] != 9 + base_raw_cnt ) ||
+ if ( ( evictions[0] != 7 ) ||
+ ( evictions[1] != 9 ) ||
( evictions[2] != 0 ) ) {
HDfprintf(stderr,
"evictions[] = {%d, %d, %d}. {%d, %d, 0} expected\n",
- evictions[0], evictions[1], evictions[2],
- 7 + base_meta_cnt, 9 + base_raw_cnt);
+ evictions[0], evictions[1], evictions[2], 7, 9);
TEST_ERROR;
}
diff --git a/test/testfiles/plist_files/def_fapl_32be b/test/testfiles/plist_files/def_fapl_32be
index 6e94011..ed36a07 100644
--- a/test/testfiles/plist_files/def_fapl_32be
+++ b/test/testfiles/plist_files/def_fapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/def_fapl_32le b/test/testfiles/plist_files/def_fapl_32le
index 6e94011..ed36a07 100644
--- a/test/testfiles/plist_files/def_fapl_32le
+++ b/test/testfiles/plist_files/def_fapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/def_fapl_64be b/test/testfiles/plist_files/def_fapl_64be
index 6e94011..ed36a07 100644
--- a/test/testfiles/plist_files/def_fapl_64be
+++ b/test/testfiles/plist_files/def_fapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/def_fapl_64le b/test/testfiles/plist_files/def_fapl_64le
index 6e94011..ed36a07 100644
--- a/test/testfiles/plist_files/def_fapl_64le
+++ b/test/testfiles/plist_files/def_fapl_64le
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_32be b/test/testfiles/plist_files/fapl_32be
index 237b291..27afb11 100644
--- a/test/testfiles/plist_files/fapl_32be
+++ b/test/testfiles/plist_files/fapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_32le b/test/testfiles/plist_files/fapl_32le
index 237b291..27afb11 100644
--- a/test/testfiles/plist_files/fapl_32le
+++ b/test/testfiles/plist_files/fapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_64be b/test/testfiles/plist_files/fapl_64be
index 237b291..27afb11 100644
--- a/test/testfiles/plist_files/fapl_64be
+++ b/test/testfiles/plist_files/fapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_64le b/test/testfiles/plist_files/fapl_64le
index 237b291..27afb11 100644
--- a/test/testfiles/plist_files/fapl_64le
+++ b/test/testfiles/plist_files/fapl_64le
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_32be b/test/testfiles/plist_files/lapl_32be
index 9d81759..1d61295 100644
--- a/test/testfiles/plist_files/lapl_32be
+++ b/test/testfiles/plist_files/lapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_32le b/test/testfiles/plist_files/lapl_32le
index 9d81759..1d61295 100644
--- a/test/testfiles/plist_files/lapl_32le
+++ b/test/testfiles/plist_files/lapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_64be b/test/testfiles/plist_files/lapl_64be
index 9d81759..1d61295 100644
--- a/test/testfiles/plist_files/lapl_64be
+++ b/test/testfiles/plist_files/lapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_64le b/test/testfiles/plist_files/lapl_64le
index 9d81759..1d61295 100644
--- a/test/testfiles/plist_files/lapl_64le
+++ b/test/testfiles/plist_files/lapl_64le
Binary files differ