summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2018-03-15 21:54:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2018-03-15 21:54:30 (GMT)
commit4a17aff4085ad6ee265b95730aca3f493056dec8 (patch)
tree8bfb665c6d95a2e3520fa1bb0ff54d95aff3923f /testpar
parent853ae26333592faf69cd8c454ef92ffea8549df5 (diff)
downloadhdf5-4a17aff4085ad6ee265b95730aca3f493056dec8.zip
hdf5-4a17aff4085ad6ee265b95730aca3f493056dec8.tar.gz
hdf5-4a17aff4085ad6ee265b95730aca3f493056dec8.tar.bz2
Add API context interface and use it throughout the library.
Diffstat (limited to 'testpar')
-rw-r--r--testpar/t_cache.c11
-rw-r--r--testpar/t_file.c101
-rw-r--r--testpar/t_pread.c2
-rw-r--r--testpar/t_shapesame.c2
-rw-r--r--testpar/t_span_tree.c6
5 files changed, 73 insertions, 49 deletions
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 700e993..0a19167 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -3061,7 +3061,7 @@ expunge_entry(H5F_t * file_ptr,
if ( nerrors == 0 ) {
- result = H5AC_expunge_entry(file_ptr, (hid_t)-1, &(types[0]),
+ result = H5AC_expunge_entry(file_ptr, &(types[0]),
entry_ptr->header.addr, H5AC__NO_FLAGS_SET);
if ( result < 0 ) {
@@ -3148,7 +3148,7 @@ insert_entry(H5C_t * cache_ptr,
(entry_ptr->ver)++;
entry_ptr->dirty = TRUE;
- result = H5AC_insert_entry(file_ptr, H5AC_ind_read_dxpl_id, &(types[0]),
+ result = H5AC_insert_entry(file_ptr, &(types[0]),
entry_ptr->base_addr, (void *)(&(entry_ptr->header)), flags);
if ( ( result < 0 ) ||
@@ -3547,7 +3547,6 @@ lock_entry(H5F_t * file_ptr,
HDassert( ! (entry_ptr->locked) );
cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr,
- H5AC_ind_read_dxpl_id,
&(types[0]), entry_ptr->base_addr,
&entry_ptr->base_addr,
H5AC__NO_FLAGS_SET);
@@ -3844,7 +3843,7 @@ move_entry(H5F_t * file_ptr,
new_entry_ptr->local_len = tmp_len;
} /* end if */
- result = H5AC_move_entry(file_ptr, &(types[0]), old_addr, new_addr, H5AC_ind_read_dxpl_id);
+ result = H5AC_move_entry(file_ptr, &(types[0]), old_addr, new_addr);
if ( ( result < 0 ) || ( old_entry_ptr->header.addr != new_addr ) ) {
@@ -4227,7 +4226,7 @@ setup_cache_for_test(hid_t * fid_ptr,
*/
if ( success ) { /* allocate space for test entries */
- actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, H5AC_ind_read_dxpl_id,
+ actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT,
(hsize_t)(max_addr + BASE_ADDR));
if ( actual_base_addr == HADDR_UNDEF ) {
@@ -5047,7 +5046,7 @@ unlock_entry(H5F_t * file_ptr,
entry_ptr->dirty = TRUE;
}
- result = H5AC_unprotect(file_ptr, H5AC_ind_read_dxpl_id, &(types[0]),
+ result = H5AC_unprotect(file_ptr, &(types[0]),
entry_ptr->base_addr, (void *)(&(entry_ptr->header)), flags);
if ( ( result < 0 ) ||
diff --git a/testpar/t_file.c b/testpar/t_file.c
index 1b6978f..f8bf7b3 100644
--- a/testpar/t_file.c
+++ b/testpar/t_file.c
@@ -17,21 +17,22 @@
#include "testphdf5.h"
-#include "H5PBprivate.h"
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
+#include "H5PBprivate.h"
/*
* This file needs to access private information from the H5F package.
*/
-#define H5C_FRIEND /*suppress error about including H5Cpkg */
-#include "H5Cpkg.h"
#define H5AC_FRIEND /*suppress error about including H5ACpkg */
#include "H5ACpkg.h"
-#define H5MF_FRIEND /*suppress error about including H5MFpkg */
-#include "H5MFpkg.h"
+#define H5C_FRIEND /*suppress error about including H5Cpkg */
+#include "H5Cpkg.h"
#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_TESTING
#include "H5Fpkg.h"
+#define H5MF_FRIEND /*suppress error about including H5MFpkg */
+#include "H5MFpkg.h"
#define NUM_DSETS 5
@@ -120,7 +121,6 @@ test_page_buffer_access(void)
{
hid_t file_id = -1; /* File ID */
hid_t fcpl, fapl, fapl_self;
- hid_t dxpl_id = H5P_DATASET_XFER_DEFAULT;
size_t page_count = 0;
int i, num_elements = 200;
haddr_t raw_addr, meta_addr;
@@ -128,6 +128,7 @@ test_page_buffer_access(void)
H5F_t *f = NULL;
herr_t ret; /* generic return value */
const char *filename;
+hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
@@ -193,6 +194,9 @@ test_page_buffer_access(void)
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl_self);
VRFY((file_id >= 0), "");
+ret = H5CX_push();
+VRFY((ret == 0), "H5CX_push()");
+api_ctx_pushed = TRUE;
/* Get a pointer to the internal file object */
f = (H5F_t *)H5I_object(file_id);
@@ -200,19 +204,19 @@ test_page_buffer_access(void)
VRFY((f->shared->page_buf != NULL), "Page Buffer created with 1 process");
/* allocate space for 200 raw elements */
- raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements);
+ raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements);
VRFY((raw_addr != HADDR_UNDEF), "");
/* allocate space for 200 metadata elements */
- meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements);
+ meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements);
VRFY((meta_addr != HADDR_UNDEF), "");
page_count = 0;
- ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, data);
VRFY((ret == 0), "");
- ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, H5AC_ind_read_dxpl_id, data);
- ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, data);
+ ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
@@ -220,10 +224,10 @@ test_page_buffer_access(void)
/* update the first 50 elements */
for(i=0 ; i<50 ; i++)
data[i] = i;
- ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data);
H5Eprint2(H5E_DEFAULT, stderr);
VRFY((ret == 0), "");
- ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
page_count += 2;
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
@@ -231,43 +235,43 @@ test_page_buffer_access(void)
/* update the second 50 elements */
for(i=0 ; i<50 ; i++)
data[i] = i+50;
- ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*50), sizeof(int)*50, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*50), sizeof(int)*50, data);
VRFY((ret == 0), "");
- ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*50), sizeof(int)*50, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*50), sizeof(int)*50, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
/* update 100 - 200 */
for(i=0 ; i<100 ; i++)
data[i] = i+100;
- ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, data);
VRFY((ret == 0), "");
- ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*100, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
- ret = H5PB_flush(f, dxpl_id, FALSE);
+ ret = H5PB_flush(f, FALSE);
VRFY((ret == 0), "");
/* read elements 0 - 200 */
- ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*200, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*200, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
for (i=0; i < 200; i++)
VRFY((data[i] == i), "Read different values than written");
- ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*200, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*200, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
for (i=0; i < 200; i++)
VRFY((data[i] == i), "Read different values than written");
/* read elements 0 - 50 */
- ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
for (i=0; i < 50; i++)
VRFY((data[i] == i), "Read different values than written");
- ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
for (i=0; i < 50; i++)
@@ -278,6 +282,7 @@ test_page_buffer_access(void)
VRFY((ret >= 0), "H5Fclose succeeded");
ret = H5Pclose(fapl_self);
VRFY((ret>=0), "H5Pclose succeeded");
+if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; }
}
#endif
@@ -292,6 +297,9 @@ test_page_buffer_access(void)
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
VRFY((file_id >= 0), "");
+ret = H5CX_push();
+VRFY((ret == 0), "H5CX_push()");
+api_ctx_pushed = TRUE;
/* Get a pointer to the internal file object */
f = (H5F_t *)H5I_object(file_id);
@@ -299,17 +307,17 @@ test_page_buffer_access(void)
VRFY((f->shared->page_buf != NULL), "Page Buffer created with 1 process");
/* allocate space for 200 raw elements */
- raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements);
+ raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements);
VRFY((raw_addr != HADDR_UNDEF), "");
/* allocate space for 200 metadata elements */
- meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements);
+ meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements);
VRFY((meta_addr != HADDR_UNDEF), "");
page_count = 0;
- ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, data);
VRFY((ret == 0), "");
- ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
@@ -317,27 +325,27 @@ test_page_buffer_access(void)
/* update the first 50 elements */
for(i=0 ; i<50 ; i++)
data[i] = i;
- ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
- ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
/* update the second 50 elements */
for(i=0 ; i<50 ; i++)
data[i] = i+50;
- ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*50), sizeof(int)*50, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*50), sizeof(int)*50, data);
VRFY((ret == 0), "");
- ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*50), sizeof(int)*50, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*50), sizeof(int)*50, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
/* update 100 - 200 */
for(i=0 ; i<100 ; i++)
data[i] = i+100;
- ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, data);
VRFY((ret == 0), "");
- ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*100, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
@@ -345,24 +353,24 @@ test_page_buffer_access(void)
VRFY((ret == 0), "");
/* read elements 0 - 200 */
- ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*200, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*200, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
for (i=0; i < 200; i++)
VRFY((data[i] == i), "Read different values than written");
- ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*200, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*200, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
for (i=0; i < 200; i++)
VRFY((data[i] == i), "Read different values than written");
/* read elements 0 - 50 */
- ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
for (i=0; i < 50; i++)
VRFY((data[i] == i), "Read different values than written");
- ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
page_count += 1;
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
@@ -373,20 +381,20 @@ test_page_buffer_access(void)
/* reset the first 50 elements to -1*/
for(i=0 ; i<50 ; i++)
data[i] = -1;
- ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
- ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
/* read elements 0 - 50 */
- ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data);
+ ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
for (i=0; i < 50; i++)
VRFY((data[i] == -1), "Read different values than written");
- ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data);
+ ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data);
VRFY((ret == 0), "");
VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB");
for (i=0; i < 50; i++)
@@ -401,6 +409,7 @@ test_page_buffer_access(void)
VRFY((ret>=0), "H5Pclose succeeded");
ret = H5Pclose(fcpl);
VRFY((ret>=0), "H5Pclose succeeded");
+if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; }
HDfree(data);
data = NULL;
@@ -424,6 +433,7 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str
H5F_t *f = NULL;
H5C_t *cache_ptr = NULL;
H5AC_cache_config_t config;
+hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
herr_t ret;
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
@@ -431,6 +441,9 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str
ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
VRFY((ret == 0), "");
+ret = H5CX_push();
+VRFY((ret == 0), "H5CX_push()");
+api_ctx_pushed = TRUE;
f = (H5F_t *)H5I_object(file_id);
VRFY((f != NULL), "");
@@ -548,6 +561,7 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str
VRFY((ret == 0), "");
ret = H5Sclose(mem_dataspace);
VRFY((ret == 0), "");
+if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; }
MPI_Barrier(MPI_COMM_WORLD);
HDfree(data_array);
@@ -572,6 +586,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy,
H5F_t *f = NULL;
H5C_t *cache_ptr = NULL;
H5AC_cache_config_t config;
+hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
herr_t ret;
config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
@@ -586,6 +601,9 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy,
file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl);
H5Eprint2(H5E_DEFAULT, stderr);
VRFY((file_id >= 0), "");
+ret = H5CX_push();
+VRFY((ret == 0), "H5CX_push()");
+api_ctx_pushed = TRUE;
ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
VRFY((ret == 0), "");
@@ -677,7 +695,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy,
HDassert(entry_ptr->is_dirty == FALSE);
if(!entry_ptr->is_pinned && !entry_ptr->is_protected) {
- ret = H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, entry_ptr->type, entry_ptr->addr, 0);
+ ret = H5AC_expunge_entry(f, entry_ptr->type, entry_ptr->addr, 0);
VRFY((ret == 0), "");
}
@@ -699,6 +717,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy,
VRFY((ret == 0), "");
ret = H5Sclose(mem_dataspace);
VRFY((ret == 0), "");
+if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; }
HDfree(data_array);
return nerrors;
diff --git a/testpar/t_pread.c b/testpar/t_pread.c
index a527503..5b75d6c 100644
--- a/testpar/t_pread.c
+++ b/testpar/t_pread.c
@@ -102,7 +102,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id )
FILE *header = NULL;
const char *fcn_name = "generate_test_file()";
const char *failure_mssg = NULL;
- char *group_filename = NULL;
+ const char *group_filename = NULL;
char data_filename[FILENAME_BUF_SIZE];
char reloc_data_filename[FILENAME_BUF_SIZE];
char prolog_filename[FILENAME_BUF_SIZE];
diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c
index 1052a69..9913225 100644
--- a/testpar/t_shapesame.c
+++ b/testpar/t_shapesame.c
@@ -24,8 +24,8 @@
#include "hdf5.h"
#include "H5private.h"
-#include "testphdf5.h"
#include "H5Spkg.h" /* Dataspaces */
+#include "testphdf5.h"
/* On Lustre (and perhaps other parallel file systems?), we have severe
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index a42df95..8fe1c8d 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -32,8 +32,14 @@
*/
+#define H5S_FRIEND /*suppress error about including H5Spkg */
+
+/* Define this macro to indicate that the testing APIs should be available */
+#define H5S_TESTING
+
#include "hdf5.h"
#include "H5private.h"
+#include "H5Spkg.h" /* Dataspaces */
#include "testphdf5.h"