summaryrefslogtreecommitdiffstats
path: root/test/cache_common.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2017-03-14 04:30:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2017-03-14 04:30:37 (GMT)
commit0313cbb91d974b153dbe8747d193ac3c619eea3b (patch)
treeaf6c4a631d5753685ee0033a6a8415a25fc97672 /test/cache_common.c
parent847d675f2743ec420ef6c9efdd6e52ae93b4fe44 (diff)
downloadhdf5-0313cbb91d974b153dbe8747d193ac3c619eea3b.zip
hdf5-0313cbb91d974b153dbe8747d193ac3c619eea3b.tar.gz
hdf5-0313cbb91d974b153dbe8747d193ac3c619eea3b.tar.bz2
Final merge of page buffering branch to develop
Diffstat (limited to 'test/cache_common.c')
-rw-r--r--test/cache_common.c54
1 files changed, 50 insertions, 4 deletions
diff --git a/test/cache_common.c b/test/cache_common.c
index d1bbf10..52dbb52 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -39,6 +39,12 @@ hid_t saved_fapl_id = H5P_DEFAULT; /* store the fapl id here between
* close.
*/
+hid_t saved_fcpl_id = H5P_DEFAULT; /* store the fcpl id here between
+ * cache setup and takedown. Note
+ * that if saved_fcpl_id == H5P_DEFAULT,
+ * we assume that there is no fcpl to
+ * close.
+ */
hid_t saved_fid = -1; /* store the file id here between cache setup
* and takedown.
*/
@@ -1632,9 +1638,12 @@ free_icr(test_entry_t *entry, int32_t entry_type)
HDassert(entry->cache_ptr->magic == H5C__H5C_T_MAGIC);
HDassert((entry->header.destroy_in_progress) ||
(entry->header.addr == entry->addr));
+ HDassert(entry->header.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC);
HDassert(entry->header.size == entry->size);
HDassert((entry->type == VARIABLE_ENTRY_TYPE) ||
(entry->size == entry_sizes[entry->type]));
+ HDassert(entry->header.tl_next == NULL);
+ HDassert(entry->header.tl_prev == NULL);
if(entry->num_pins > 0) {
int i;
@@ -3165,7 +3174,8 @@ verify_unprotected(void)
H5F_t *
setup_cache(size_t max_cache_size,
- size_t min_clean_size)
+ size_t min_clean_size,
+ unsigned paged)
{
char filename[512];
hbool_t show_progress = FALSE;
@@ -3177,6 +3187,7 @@ setup_cache(size_t max_cache_size,
H5F_t * ret_val = NULL;
haddr_t actual_base_addr;
hid_t fapl_id = H5P_DEFAULT;
+ hid_t fcpl_id = H5P_DEFAULT;
if(show_progress) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
@@ -3184,6 +3195,36 @@ setup_cache(size_t max_cache_size,
saved_fid = -1;
+ if(pass) {
+ if((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) == FAIL) {
+ pass = FALSE;
+ failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n";
+ }
+ }
+
+ if(pass && paged) {
+ /* Set up paged aggregation strategy */
+ if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)1) == FAIL) {
+ pass = FALSE;
+ failure_mssg = "H5Pset_file_space_strategy() failed.\n";
+ H5Pclose(fcpl_id);
+ fcpl_id = H5P_DEFAULT;
+ }
+ }
+
+ if(pass && paged) {
+ /* Set up file space page size to BASE_ADDR */
+ if(H5Pset_file_space_page_size(fcpl_id, (hsize_t)BASE_ADDR) == FAIL) {
+ pass = FALSE;
+ failure_mssg = "H5Pset_file_space_page_size() failed.\n";
+ H5Pclose(fcpl_id);
+ fcpl_id = H5P_DEFAULT;
+ }
+ }
+
+ if(pass)
+ saved_fcpl_id = fcpl_id;
+
/* setup the file name */
if(pass) {
if(NULL == h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))) {
@@ -3207,7 +3248,7 @@ setup_cache(size_t max_cache_size,
pass = FALSE;
failure_mssg = "H5P_set_fapl_core() failed.\n";
}
- else if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) {
+ else if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) {
core_file_driver_failed = TRUE;
if(verbose)
@@ -3226,8 +3267,8 @@ setup_cache(size_t max_cache_size,
* If this fails, we are cooked.
*/
if(pass && fid < 0) {
- fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
- saved_fid = fid;
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id);
+ saved_fid = fid;
if(fid < 0) {
pass = FALSE;
@@ -3438,6 +3479,11 @@ takedown_cache(H5F_t * file_ptr,
saved_fapl_id = H5P_DEFAULT;
}
+ if ( saved_fcpl_id != H5P_DEFAULT ) {
+ H5Pclose(saved_fcpl_id);
+ saved_fcpl_id = H5P_DEFAULT;
+ }
+
if ( saved_fid != -1 ) {
if ( H5F_addr_defined(saved_actual_base_addr) ) {