summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fortner <fortnern@gmail.com>2022-03-26 18:18:01 (GMT)
committerGitHub <noreply@github.com>2022-03-26 18:18:01 (GMT)
commitb7f2de9c00f37e535a02c973779bbc2a7413d5b1 (patch)
treeab4d69624285d232fafd1df886da0fc29cd222d8
parenta7b37b6ac5ef3703b52447a9e60419f435a7c082 (diff)
parentda2d4fe937776bb7370f03b931eec595281a02e8 (diff)
downloadhdf5-b7f2de9c00f37e535a02c973779bbc2a7413d5b1.zip
hdf5-b7f2de9c00f37e535a02c973779bbc2a7413d5b1.tar.gz
hdf5-b7f2de9c00f37e535a02c973779bbc2a7413d5b1.tar.bz2
Merge pull request #1530 from fortnern/selection_io
Selection io
-rw-r--r--config/cmake/HDF5_Examples.cmake.in3
-rw-r--r--config/cmake/HDFFortranCompilerFlags.cmake6
-rw-r--r--config/intel-warnings/ifort-general2
-rw-r--r--config/intel-warnings/win-ifort-general1
-rw-r--r--src/H5Dchunk.c10
-rw-r--r--src/H5Dcontig.c6
-rw-r--r--src/H5FDint.c167
-rw-r--r--src/H5PB.c26
-rw-r--r--src/H5PBprivate.h2
-rw-r--r--test/test_flush_refresh.sh.in10
-rw-r--r--test/test_swmr.sh.in5
-rw-r--r--test/test_use_cases.sh.in5
-rw-r--r--test/test_vds_swmr.sh.in5
-rw-r--r--test/vfd.c203
-rw-r--r--testpar/CMakeLists.txt1
15 files changed, 216 insertions, 236 deletions
diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in
index 9ff9b6f..795399e 100644
--- a/config/cmake/HDF5_Examples.cmake.in
+++ b/config/cmake/HDF5_Examples.cmake.in
@@ -81,14 +81,13 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDN
#endif()
###############################################################################################################
+set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ROOT:PATH=${INSTALLDIR}")
if(WIN32)
set(SITE_OS_NAME "Windows")
- set(ENV{HDF5_ROOT} "${INSTALLDIR}")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else()
- set(ENV{HDF5_ROOT} "${INSTALLDIR}")
set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake
index 754259e..84b3ebe 100644
--- a/config/cmake/HDFFortranCompilerFlags.cmake
+++ b/config/cmake/HDFFortranCompilerFlags.cmake
@@ -62,7 +62,7 @@ if (NOT MSVC AND NOT MINGW)
# General flags
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/ifort-general")
- list (APPEND HDF5_CMAKE_Fortran_FLAGS "-stand:f03" "-free")
+ list (APPEND HDF5_CMAKE_Fortran_FLAGS "-stand f03" "-free")
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-general")
list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ffree-form" "-fimplicit-none")
@@ -118,8 +118,8 @@ if (NOT MSVC AND NOT MINGW)
endif ()
else ()
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
- #ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-ifort-general")
- list (APPEND HDF5_CMAKE_Fortran_FLAGS "/warn:all" "/stand:f03" "/free")
+ ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/intel-warnings/win-ifort-general")
+ list (APPEND HDF5_CMAKE_Fortran_FLAGS "/stand:f03" "/free")
endif ()
endif ()
diff --git a/config/intel-warnings/ifort-general b/config/intel-warnings/ifort-general
index a9da0e5..1644c7c 100644
--- a/config/intel-warnings/ifort-general
+++ b/config/intel-warnings/ifort-general
@@ -1 +1 @@
--warn:all
+-warn all
diff --git a/config/intel-warnings/win-ifort-general b/config/intel-warnings/win-ifort-general
new file mode 100644
index 0000000..a335959
--- /dev/null
+++ b/config/intel-warnings/win-ifort-general
@@ -0,0 +1 @@
+/warn:all
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 9715ae3..8374b17 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -2483,13 +2483,15 @@ done:
static htri_t
H5D__chunk_may_use_select_io(const H5D_io_info_t *io_info)
{
- const H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */
- htri_t ret_value = FAIL; /* Return value */
+ const H5D_t *dataset = NULL; /* Local pointer to dataset info */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_STATIC
/* Sanity check */
HDassert(io_info);
+
+ dataset = io_info->dset;
HDassert(dataset);
/* Don't use selection I/O if it's globally disabled, there is a type
@@ -2498,12 +2500,12 @@ H5D__chunk_may_use_select_io(const H5D_io_info_t *io_info)
dataset->shared->dcpl_cache.pline.nused > 0)
ret_value = FALSE;
else {
- htri_t page_buf_enabled;
+ hbool_t page_buf_enabled;
HDassert(io_info->io_ops.single_write == H5D__select_write);
/* Check if the page buffer is enabled */
- if ((page_buf_enabled = H5PB_enabled(io_info->f_sh, H5FD_MEM_DRAW)) < 0)
+ if (H5PB_enabled(io_info->f_sh, H5FD_MEM_DRAW, &page_buf_enabled) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if page buffer is enabled")
if (page_buf_enabled)
ret_value = FALSE;
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index d2cd5e4..840c7ec 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -595,7 +595,7 @@ done:
* Purpose: A small internal function to if it may be possible to use
* selection I/O.
*
- * Return: TRUE or FALSE
+ * Return: TRUE/FALSE/FAIL
*
* Programmer: Neil Fortner
* 3 August 2021
@@ -624,13 +624,13 @@ H5D__contig_may_use_select_io(const H5D_io_info_t *io_info, H5D_io_op_type_t op_
(op_type == H5D_IO_OP_WRITE && io_info->dset->shared->cache.contig.sieve_buf))
ret_value = FALSE;
else {
- htri_t page_buf_enabled;
+ hbool_t page_buf_enabled;
HDassert(io_info->io_ops.single_write == H5D__select_write);
HDassert(io_info->layout_ops.writevv == H5D__contig_writevv);
/* Check if the page buffer is enabled */
- if ((page_buf_enabled = H5PB_enabled(io_info->f_sh, H5FD_MEM_DRAW)) < 0)
+ if (H5PB_enabled(io_info->f_sh, H5FD_MEM_DRAW, &page_buf_enabled) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if page buffer is enabled")
if (page_buf_enabled)
ret_value = FALSE;
diff --git a/src/H5FDint.c b/src/H5FDint.c
index 6830f48..bec9dfb 100644
--- a/src/H5FDint.c
+++ b/src/H5FDint.c
@@ -45,6 +45,17 @@
/* Length of sequence lists requested from dataspace selections */
#define H5FD_SEQ_LIST_LEN 128
+/* Length of stack allocated arrays for building vector I/O operations.
+ * Corresponds to the number of contiguous blocks in a selection I/O operation.
+ * If more space is needed dynamic allocation will be used instead. */
+#define H5FD_LOCAL_VECTOR_LEN 8
+
+/* Length of stack allocated arrays for dataspace IDs/structs for selction I/O
+ * operations. Corresponds to the number of file selection/memory selection
+ * pairs (along with addresses, etc.) in a selection I/O operation. If more
+ * space is needed dynamic allocation will be used instead */
+#define H5FD_LOCAL_SEL_ARR_LEN 8
+
/******************/
/* Local Typedefs */
/******************/
@@ -747,12 +758,12 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin
size_t element_size;
void * buf;
hbool_t use_vector = FALSE;
- haddr_t addrs_static[8];
- haddr_t * addrs = addrs_static;
- size_t sizes_static[8];
- size_t * sizes = sizes_static;
- void * vec_bufs_static[8];
- void ** vec_bufs = vec_bufs_static;
+ haddr_t addrs_local[H5FD_LOCAL_VECTOR_LEN];
+ haddr_t * addrs = addrs_local;
+ size_t sizes_local[H5FD_LOCAL_VECTOR_LEN];
+ size_t * sizes = sizes_local;
+ void * vec_bufs_local[H5FD_LOCAL_VECTOR_LEN];
+ void ** vec_bufs = vec_bufs_local;
hsize_t file_off[H5FD_SEQ_LIST_LEN];
size_t file_len[H5FD_SEQ_LIST_LEN];
hsize_t mem_off[H5FD_SEQ_LIST_LEN];
@@ -770,7 +781,7 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin
hbool_t file_iter_init = FALSE;
hbool_t mem_iter_init = FALSE;
H5FD_mem_t types[2] = {type, H5FD_MEM_NOLIST};
- size_t vec_arr_nalloc = sizeof(addrs_static) / sizeof(addrs_static[0]);
+ size_t vec_arr_nalloc = H5FD_LOCAL_VECTOR_LEN;
size_t vec_arr_nused = 0;
herr_t ret_value = SUCCEED;
@@ -779,8 +790,6 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin
/* Sanity checks */
HDassert(file);
HDassert(file->cls);
- HDassert(vec_arr_nalloc == sizeof(sizes_static) / sizeof(sizes_static[0]));
- HDassert(vec_arr_nalloc == sizeof(vec_bufs_static) / sizeof(vec_bufs_static[0]));
HDassert(mem_spaces);
HDassert(file_spaces);
HDassert(offsets);
@@ -895,25 +904,25 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin
/* Check if we need to extend the arrays */
if (vec_arr_nused == vec_arr_nalloc) {
/* Check if we're using the static arrays */
- if (addrs == addrs_static) {
- HDassert(sizes == sizes_static);
- HDassert(vec_bufs == vec_bufs_static);
+ if (addrs == addrs_local) {
+ HDassert(sizes == sizes_local);
+ HDassert(vec_bufs == vec_bufs_local);
/* Allocate dynamic arrays */
- if (NULL == (addrs = H5MM_malloc(sizeof(addrs_static) * 2)))
+ if (NULL == (addrs = H5MM_malloc(sizeof(addrs_local) * 2)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL,
"memory allocation failed for address list")
- if (NULL == (sizes = H5MM_malloc(sizeof(sizes_static) * 2)))
+ if (NULL == (sizes = H5MM_malloc(sizeof(sizes_local) * 2)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL,
"memory allocation failed for size list")
- if (NULL == (vec_bufs = H5MM_malloc(sizeof(vec_bufs_static) * 2)))
+ if (NULL == (vec_bufs = H5MM_malloc(sizeof(vec_bufs_local) * 2)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL,
"memory allocation failed for buffer list")
/* Copy the existing data */
- (void)H5MM_memcpy(addrs, addrs_static, sizeof(addrs_static));
- (void)H5MM_memcpy(sizes, sizes_static, sizeof(sizes_static));
- (void)H5MM_memcpy(vec_bufs, vec_bufs_static, sizeof(vec_bufs_static));
+ (void)H5MM_memcpy(addrs, addrs_local, sizeof(addrs_local));
+ (void)H5MM_memcpy(sizes, sizes_local, sizeof(sizes_local));
+ (void)H5MM_memcpy(vec_bufs, vec_bufs_local, sizeof(vec_bufs_local));
}
else {
void *tmp_ptr;
@@ -1003,18 +1012,18 @@ done:
/* Cleanup vector arrays */
if (use_vector) {
- if (addrs != addrs_static)
+ if (addrs != addrs_local)
addrs = H5MM_xfree(addrs);
- if (sizes != sizes_static)
+ if (sizes != sizes_local)
sizes = H5MM_xfree(sizes);
- if (vec_bufs != vec_bufs_static)
+ if (vec_bufs != vec_bufs_local)
vec_bufs = H5MM_xfree(vec_bufs);
}
/* Make sure we cleaned up */
- HDassert(!addrs || addrs == addrs_static);
- HDassert(!sizes || sizes == sizes_static);
- HDassert(!vec_bufs || vec_bufs == vec_bufs_static);
+ HDassert(!addrs || addrs == addrs_local);
+ HDassert(!sizes || sizes == sizes_local);
+ HDassert(!vec_bufs || vec_bufs == vec_bufs_local);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__read_selection_translate() */
@@ -1065,10 +1074,10 @@ H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_s
haddr_t offsets[], size_t element_sizes[], void *bufs[] /* out */)
{
hbool_t offsets_cooked = FALSE;
- hid_t mem_space_ids_static[8];
- hid_t * mem_space_ids = mem_space_ids_static;
- hid_t file_space_ids_static[8];
- hid_t * file_space_ids = file_space_ids_static;
+ hid_t mem_space_ids_local[H5FD_LOCAL_SEL_ARR_LEN];
+ hid_t * mem_space_ids = mem_space_ids_local;
+ hid_t file_space_ids_local[H5FD_LOCAL_SEL_ARR_LEN];
+ hid_t * file_space_ids = file_space_ids_local;
uint32_t num_spaces = 0;
hid_t dxpl_id = H5I_INVALID_HID; /* DXPL for operation */
uint32_t i;
@@ -1143,9 +1152,9 @@ H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_s
/* if the underlying VFD supports selection read, make the call */
if (file->cls->read_selection) {
- /* Allocate array of space IDs if necessary, otherwise use static
+ /* Allocate array of space IDs if necessary, otherwise use local
* buffers */
- if (count > sizeof(mem_space_ids_static) / sizeof(mem_space_ids_static[0])) {
+ if (count > sizeof(mem_space_ids_local) / sizeof(mem_space_ids_local[0])) {
if (NULL == (mem_space_ids = H5MM_malloc(count * sizeof(hid_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for dataspace list")
if (NULL == (file_space_ids = H5MM_malloc(count * sizeof(hid_t))))
@@ -1196,9 +1205,9 @@ done:
if (H5I_dec_app_ref(file_space_ids[i]) < 0)
HDONE_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "problem freeing id")
}
- if (mem_space_ids != mem_space_ids_static)
+ if (mem_space_ids != mem_space_ids_local)
mem_space_ids = H5MM_xfree(mem_space_ids);
- if (file_space_ids != file_space_ids_static)
+ if (file_space_ids != file_space_ids_local)
file_space_ids = H5MM_xfree(file_space_ids);
FUNC_LEAVE_NOAPI(ret_value)
@@ -1230,10 +1239,10 @@ H5FD_read_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_
void *bufs[] /* out */)
{
hbool_t offsets_cooked = FALSE;
- H5S_t * mem_spaces_static[8];
- H5S_t ** mem_spaces = mem_spaces_static;
- H5S_t * file_spaces_static[8];
- H5S_t ** file_spaces = file_spaces_static;
+ H5S_t * mem_spaces_local[H5FD_LOCAL_SEL_ARR_LEN];
+ H5S_t ** mem_spaces = mem_spaces_local;
+ H5S_t * file_spaces_local[H5FD_LOCAL_SEL_ARR_LEN];
+ H5S_t ** file_spaces = file_spaces_local;
hid_t dxpl_id = H5I_INVALID_HID; /* DXPL for operation */
uint32_t i;
herr_t ret_value = SUCCEED; /* Return value */
@@ -1316,9 +1325,9 @@ H5FD_read_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_
* or vector read calls.
*/
- /* Allocate arrays of space objects if necessary, otherwise use static
+ /* Allocate arrays of space objects if necessary, otherwise use local
* buffers */
- if (count > sizeof(mem_spaces_static) / sizeof(mem_spaces_static[0])) {
+ if (count > sizeof(mem_spaces_local) / sizeof(mem_spaces_local[0])) {
if (NULL == (mem_spaces = H5MM_malloc(count * sizeof(H5S_t *))))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for dataspace list")
if (NULL == (file_spaces = H5MM_malloc(count * sizeof(H5S_t *))))
@@ -1352,9 +1361,9 @@ done:
}
/* Cleanup dataspace arrays */
- if (mem_spaces != mem_spaces_static)
+ if (mem_spaces != mem_spaces_local)
mem_spaces = H5MM_xfree(mem_spaces);
- if (file_spaces != file_spaces_static)
+ if (file_spaces != file_spaces_local)
file_spaces = H5MM_xfree(file_spaces);
FUNC_LEAVE_NOAPI(ret_value)
@@ -1390,12 +1399,12 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui
size_t element_size;
const void * buf;
hbool_t use_vector = FALSE;
- haddr_t addrs_static[8];
- haddr_t * addrs = addrs_static;
- size_t sizes_static[8];
- size_t * sizes = sizes_static;
- const void * vec_bufs_static[8];
- const void ** vec_bufs = vec_bufs_static;
+ haddr_t addrs_local[H5FD_LOCAL_VECTOR_LEN];
+ haddr_t * addrs = addrs_local;
+ size_t sizes_local[H5FD_LOCAL_VECTOR_LEN];
+ size_t * sizes = sizes_local;
+ const void * vec_bufs_local[H5FD_LOCAL_VECTOR_LEN];
+ const void ** vec_bufs = vec_bufs_local;
hsize_t file_off[H5FD_SEQ_LIST_LEN];
size_t file_len[H5FD_SEQ_LIST_LEN];
hsize_t mem_off[H5FD_SEQ_LIST_LEN];
@@ -1413,7 +1422,7 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui
hbool_t file_iter_init = FALSE;
hbool_t mem_iter_init = FALSE;
H5FD_mem_t types[2] = {type, H5FD_MEM_NOLIST};
- size_t vec_arr_nalloc = sizeof(addrs_static) / sizeof(addrs_static[0]);
+ size_t vec_arr_nalloc = H5FD_LOCAL_VECTOR_LEN;
size_t vec_arr_nused = 0;
herr_t ret_value = SUCCEED;
@@ -1422,8 +1431,6 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui
/* Sanity checks */
HDassert(file);
HDassert(file->cls);
- HDassert(vec_arr_nalloc == sizeof(sizes_static) / sizeof(sizes_static[0]));
- HDassert(vec_arr_nalloc == sizeof(vec_bufs_static) / sizeof(vec_bufs_static[0]));
HDassert(mem_spaces);
HDassert(file_spaces);
HDassert(offsets);
@@ -1538,25 +1545,25 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui
/* Check if we need to extend the arrays */
if (vec_arr_nused == vec_arr_nalloc) {
/* Check if we're using the static arrays */
- if (addrs == addrs_static) {
- HDassert(sizes == sizes_static);
- HDassert(vec_bufs == vec_bufs_static);
+ if (addrs == addrs_local) {
+ HDassert(sizes == sizes_local);
+ HDassert(vec_bufs == vec_bufs_local);
/* Allocate dynamic arrays */
- if (NULL == (addrs = H5MM_malloc(sizeof(addrs_static) * 2)))
+ if (NULL == (addrs = H5MM_malloc(sizeof(addrs_local) * 2)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL,
"memory allocation failed for address list")
- if (NULL == (sizes = H5MM_malloc(sizeof(sizes_static) * 2)))
+ if (NULL == (sizes = H5MM_malloc(sizeof(sizes_local) * 2)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL,
"memory allocation failed for size list")
- if (NULL == (vec_bufs = H5MM_malloc(sizeof(vec_bufs_static) * 2)))
+ if (NULL == (vec_bufs = H5MM_malloc(sizeof(vec_bufs_local) * 2)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL,
"memory allocation failed for buffer list")
/* Copy the existing data */
- (void)H5MM_memcpy(addrs, addrs_static, sizeof(addrs_static));
- (void)H5MM_memcpy(sizes, sizes_static, sizeof(sizes_static));
- (void)H5MM_memcpy(vec_bufs, vec_bufs_static, sizeof(vec_bufs_static));
+ (void)H5MM_memcpy(addrs, addrs_local, sizeof(addrs_local));
+ (void)H5MM_memcpy(sizes, sizes_local, sizeof(sizes_local));
+ (void)H5MM_memcpy(vec_bufs, vec_bufs_local, sizeof(vec_bufs_local));
}
else {
void *tmp_ptr;
@@ -1646,18 +1653,18 @@ done:
/* Cleanup vector arrays */
if (use_vector) {
- if (addrs != addrs_static)
+ if (addrs != addrs_local)
addrs = H5MM_xfree(addrs);
- if (sizes != sizes_static)
+ if (sizes != sizes_local)
sizes = H5MM_xfree(sizes);
- if (vec_bufs != vec_bufs_static)
+ if (vec_bufs != vec_bufs_local)
vec_bufs = H5MM_xfree(vec_bufs);
}
/* Make sure we cleaned up */
- HDassert(!addrs || addrs == addrs_static);
- HDassert(!sizes || sizes == sizes_static);
- HDassert(!vec_bufs || vec_bufs == vec_bufs_static);
+ HDassert(!addrs || addrs == addrs_local);
+ HDassert(!sizes || sizes == sizes_local);
+ HDassert(!vec_bufs || vec_bufs == vec_bufs_local);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__write_selection_translate() */
@@ -1706,10 +1713,10 @@ H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_
haddr_t offsets[], size_t element_sizes[], const void *bufs[])
{
hbool_t offsets_cooked = FALSE;
- hid_t mem_space_ids_static[8];
- hid_t * mem_space_ids = mem_space_ids_static;
- hid_t file_space_ids_static[8];
- hid_t * file_space_ids = file_space_ids_static;
+ hid_t mem_space_ids_local[H5FD_LOCAL_SEL_ARR_LEN];
+ hid_t * mem_space_ids = mem_space_ids_local;
+ hid_t file_space_ids_local[H5FD_LOCAL_SEL_ARR_LEN];
+ hid_t * file_space_ids = file_space_ids_local;
uint32_t num_spaces = 0;
hid_t dxpl_id = H5I_INVALID_HID; /* DXPL for operation */
uint32_t i;
@@ -1778,9 +1785,9 @@ H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_
/* if the underlying VFD supports selection write, make the call */
if (file->cls->write_selection) {
- /* Allocate array of space IDs if necessary, otherwise use static
+ /* Allocate array of space IDs if necessary, otherwise use local
* buffers */
- if (count > sizeof(mem_space_ids_static) / sizeof(mem_space_ids_static[0])) {
+ if (count > sizeof(mem_space_ids_local) / sizeof(mem_space_ids_local[0])) {
if (NULL == (mem_space_ids = H5MM_malloc(count * sizeof(hid_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for dataspace list")
if (NULL == (file_space_ids = H5MM_malloc(count * sizeof(hid_t))))
@@ -1831,9 +1838,9 @@ done:
if (H5I_dec_app_ref(file_space_ids[i]) < 0)
HDONE_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "problem freeing id")
}
- if (mem_space_ids != mem_space_ids_static)
+ if (mem_space_ids != mem_space_ids_local)
mem_space_ids = H5MM_xfree(mem_space_ids);
- if (file_space_ids != file_space_ids_static)
+ if (file_space_ids != file_space_ids_local)
file_space_ids = H5MM_xfree(file_space_ids);
FUNC_LEAVE_NOAPI(ret_value)
@@ -1862,10 +1869,10 @@ H5FD_write_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem
hid_t file_space_ids[], haddr_t offsets[], size_t element_sizes[], const void *bufs[])
{
hbool_t offsets_cooked = FALSE;
- H5S_t * mem_spaces_static[8];
- H5S_t ** mem_spaces = mem_spaces_static;
- H5S_t * file_spaces_static[8];
- H5S_t ** file_spaces = file_spaces_static;
+ H5S_t * mem_spaces_local[H5FD_LOCAL_SEL_ARR_LEN];
+ H5S_t ** mem_spaces = mem_spaces_local;
+ H5S_t * file_spaces_local[H5FD_LOCAL_SEL_ARR_LEN];
+ H5S_t ** file_spaces = file_spaces_local;
hid_t dxpl_id = H5I_INVALID_HID; /* DXPL for operation */
uint32_t i;
herr_t ret_value = SUCCEED; /* Return value */
@@ -1942,9 +1949,9 @@ H5FD_write_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem
* or vector write calls.
*/
- /* Allocate arrays of space objects if necessary, otherwise use static
+ /* Allocate arrays of space objects if necessary, otherwise use local
* buffers */
- if (count > sizeof(mem_spaces_static) / sizeof(mem_spaces_static[0])) {
+ if (count > sizeof(mem_spaces_local) / sizeof(mem_spaces_local[0])) {
if (NULL == (mem_spaces = H5MM_malloc(count * sizeof(H5S_t *))))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for dataspace list")
if (NULL == (file_spaces = H5MM_malloc(count * sizeof(H5S_t *))))
@@ -1978,9 +1985,9 @@ done:
}
/* Cleanup dataspace arrays */
- if (mem_spaces != mem_spaces_static)
+ if (mem_spaces != mem_spaces_local)
mem_spaces = H5MM_xfree(mem_spaces);
- if (file_spaces != file_spaces_static)
+ if (file_spaces != file_spaces_local)
file_spaces = H5MM_xfree(file_spaces);
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5PB.c b/src/H5PB.c
index 4fc9a52..b7c3526 100644
--- a/src/H5PB.c
+++ b/src/H5PB.c
@@ -1314,14 +1314,14 @@ done:
*
*-------------------------------------------------------------------------
*/
-htri_t
-H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type)
+herr_t
+H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, hbool_t *enabled)
{
- H5PB_t *page_buf; /* Page buffering info for this file */
- hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */
- htri_t ret_value; /* Return value */
+ H5PB_t *page_buf; /* Page buffering info for this file */
+ hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI_NOERR
/* Sanity checks */
HDassert(f_sh);
@@ -1345,9 +1345,12 @@ H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type)
} /* end if */
#endif
- /* If page buffering is disabled, or the I/O size is larger than that of a
- * single page, or if this is a parallel raw data access, bypass page
- * buffering.
+ /* If page buffering is disabled, or if this is a parallel raw data access,
+ * bypass page buffering. Note that page buffering may stil be disabled for
+ * large metadata access or large non-parallel raw data access, but this
+ * function doesn't take I/O size into account so if it returns TRUE the
+ * page buffer may still be disabled for some I/O. If it returns FALSE it is
+ * always disabled for this access type.
*/
if (NULL == page_buf || (bypass_pb && H5FD_MEM_DRAW == type)) {
/* Update statistics, since wherever this function is called, if it
@@ -1359,13 +1362,12 @@ H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type)
} /* end if */
/* Page buffer is disabled, at least for this data access type */
- ret_value = FALSE;
+ *enabled = FALSE;
} /* end if */
else
/* Page buffer may be enabled */
- ret_value = TRUE;
+ *enabled = TRUE;
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PB_enabled() */
diff --git a/src/H5PBprivate.h b/src/H5PBprivate.h
index 2fc70c6..f5d4536 100644
--- a/src/H5PBprivate.h
+++ b/src/H5PBprivate.h
@@ -91,7 +91,7 @@ H5_DLL herr_t H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, con
H5_DLL herr_t H5PB_remove_entry(const H5F_shared_t *f_sh, haddr_t addr);
H5_DLL herr_t H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void *buf /*out*/);
H5_DLL herr_t H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf);
-H5_DLL htri_t H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type);
+H5_DLL herr_t H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, hbool_t *enabled);
/* Statistics routines */
H5_DLL herr_t H5PB_reset_stats(H5PB_t *page_buf);
diff --git a/test/test_flush_refresh.sh.in b/test/test_flush_refresh.sh.in
index 37d1c7e..209d370 100644
--- a/test/test_flush_refresh.sh.in
+++ b/test/test_flush_refresh.sh.in
@@ -62,16 +62,6 @@ srcdir=@srcdir@
utils_testdir=@abs_top_builddir@/@H5_UTILS_TEST_BUILDDIR@
testdir=@abs_top_builddir@/@H5_TEST_BUILDDIR@
-# If the bindir directory is not set just use current (.).
-if test -z "$bindir"; then
- bindir=.
-fi
-
-# If the testdir directory is not set just use current (.).
-if test -z "$testdir"; then
- testdir=.
-fi
-
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
$utils_testdir/swmr_check_compat_vfd
diff --git a/test/test_swmr.sh.in b/test/test_swmr.sh.in
index 6736349..771fe4a 100644
--- a/test/test_swmr.sh.in
+++ b/test/test_swmr.sh.in
@@ -95,11 +95,6 @@ WAIT_MESSAGE() {
##
###############################################################################
-# If the testdir directory is not set just use current (.).
-if test -z "$testdir"; then
- testdir=.
-fi
-
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
$utils_testdir/swmr_check_compat_vfd
diff --git a/test/test_use_cases.sh.in b/test/test_use_cases.sh.in
index da32827..fd30afd 100644
--- a/test/test_use_cases.sh.in
+++ b/test/test_use_cases.sh.in
@@ -38,11 +38,6 @@ srcdir=@srcdir@
utils_testdir=@abs_top_builddir@/@H5_UTILS_TEST_BUILDDIR@
testdir=@abs_top_builddir@/@H5_TEST_BUILDDIR@
-# If the testdir directory is not set just use current (.).
-if test -z "$testdir"; then
- testdir=.
-fi
-
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
$utils_testdir/swmr_check_compat_vfd
diff --git a/test/test_vds_swmr.sh.in b/test/test_vds_swmr.sh.in
index c9aed13..399fdef 100644
--- a/test/test_vds_swmr.sh.in
+++ b/test/test_vds_swmr.sh.in
@@ -81,11 +81,6 @@ WAIT_MESSAGE() {
## Main
###############################################################################
-# If the testdir directory is not set just use current (.).
-if test -z "$testdir"; then
- testdir=.
-fi
-
# Check to see if the VFD specified by the HDF5_DRIVER environment variable
# supports SWMR.
$utils_testdir/swmr_check_compat_vfd
diff --git a/test/vfd.c b/test/vfd.c
index d1c95ce..74889fd 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -3488,10 +3488,6 @@ error:
*
* Programmer: JRM -- 6/20/20
*
- * Modifications:
- *
- * None.
- *
*****************************************************************************/
static void
setup_rand(void)
@@ -4180,7 +4176,7 @@ test_vector_io__setup_fixed_size_v(uint32_t count, H5FD_mem_t types[], haddr_t a
write_bufs[i] = NULL;
read_bufs[i] = NULL;
types[i] = H5FD_MEM_NTYPES;
- sizes[i] = ULONG_MAX;
+ sizes[i] = SIZE_MAX;
}
/* randomly select the point in the vector after which all entries are
@@ -4296,7 +4292,7 @@ test_vector_io__read_v_indiv(H5FD_t *lf, uint32_t count, H5FD_mem_t types[], had
hbool_t result = TRUE; /* will set to FALSE on failure */
hbool_t verbose = FALSE;
uint32_t i;
- size_t size = ULONG_MAX;
+ size_t size = SIZE_MAX;
H5FD_mem_t type = H5FD_MEM_NTYPES;
for (i = 0; i < count; i++) {
@@ -4309,7 +4305,7 @@ test_vector_io__read_v_indiv(H5FD_t *lf, uint32_t count, H5FD_mem_t types[], had
if (verbose) {
- HDfprintf(stdout, "%s: HDread() failed on entry %d.\n", __func__, i);
+ HDfprintf(stdout, "%s: H5FDread() failed on entry %d.\n", __func__, i);
}
result = FALSE;
break;
@@ -4351,7 +4347,7 @@ test_vector_io__write_v_indiv(H5FD_t *lf, uint32_t count, H5FD_mem_t types[], ha
hbool_t result = TRUE; /* will set to FALSE on failure */
hbool_t verbose = FALSE;
uint32_t i;
- size_t size = ULONG_MAX;
+ size_t size = SIZE_MAX;
H5FD_mem_t type = H5FD_MEM_NTYPES;
for (i = 0; i < count; i++) {
@@ -4402,13 +4398,13 @@ test_vector_io__verify_v(uint32_t count, H5FD_mem_t types[], size_t sizes[], voi
hbool_t identical = TRUE;
hbool_t verbose = TRUE;
uint32_t i;
- uint32_t j;
+ size_t j;
uint32_t buf_size;
char * w_buf;
char * r_buf;
const char *mem_type_names[7] = {"H5FD_MEM_DEFAULT", "H5FD_MEM_SUPER", "H5FD_MEM_BTREE", "H5FD_MEM_DRAW",
"H5FD_MEM_GHEAP", "H5FD_MEM_LHEAP", "H5FD_MEM_OHDR"};
- size_t size = ULONG_MAX;
+ size_t size = SIZE_MAX;
H5FD_mem_t type = H5FD_MEM_NTYPES;
i = 0;
@@ -4419,13 +4415,11 @@ test_vector_io__verify_v(uint32_t count, H5FD_mem_t types[], size_t sizes[], voi
SET_TYPE(type_fixed, types, type, i);
- buf_size = (uint32_t)(size);
-
w_buf = (char *)(write_bufs[i]);
r_buf = (char *)(read_bufs[i]);
j = 0;
- while ((j < buf_size) && (identical)) {
+ while ((j < size) && (identical)) {
if (w_buf[j] != r_buf[j]) {
@@ -4434,8 +4428,9 @@ test_vector_io__verify_v(uint32_t count, H5FD_mem_t types[], size_t sizes[], voi
if (verbose) {
HDfprintf(stdout, "\n\nread/write buf mismatch in vector/entry");
- HDfprintf(stdout, "\"%s\"/%d at offset %d/%d w/r = %c/%c type = %s\n\n", name, i, j,
- buf_size, w_buf[j], r_buf[j], mem_type_names[type]);
+ HDfprintf(stdout, "\"%s\"/%u at offset %llu/%llu w/r = %c/%c type = %s\n\n", name,
+ (unsigned)i, (long long unsigned)j, (long long unsigned)buf_size, w_buf[j],
+ r_buf[j], mem_type_names[type]);
}
}
j++;
@@ -4475,7 +4470,7 @@ test_vector_io__dump_test_vectors(uint32_t count, H5FD_mem_t types[], haddr_t ad
uint32_t i;
const char *mem_type_names[7] = {"H5FD_MEM_DEFAULT", "H5FD_MEM_SUPER", "H5FD_MEM_BTREE", "H5FD_MEM_DRAW",
"H5FD_MEM_GHEAP", "H5FD_MEM_LHEAP", "H5FD_MEM_OHDR"};
- size_t size = ULONG_MAX;
+ size_t size = SIZE_MAX;
H5FD_mem_t type = H5FD_MEM_NTYPES;
char *w_buf;
@@ -4502,8 +4497,8 @@ test_vector_io__dump_test_vectors(uint32_t count, H5FD_mem_t types[], haddr_t ad
r_buf = NULL;
}
- HDfprintf(stdout, "%d: addr/len = %lld/%lld, type = %s, w_buf = \"%s\"\n", i, (long long)(addrs[i]),
- (long long)(size), mem_type_names[type], w_buf);
+ HDfprintf(stdout, "%u: addr/len = %llu/%llu, type = %s, w_buf = \"%s\"\n", (unsigned)i,
+ (long long unsigned)(addrs[i]), (long long unsigned)(size), mem_type_names[type], w_buf);
if (r_buf) {
@@ -4988,13 +4983,12 @@ error:
#define SEL_IO_DIM0 8
#define SEL_IO_DIM1 10
-static hbool_t
+static herr_t
test_selection_io_write(H5FD_t *lf, H5FD_mem_t type, uint32_t count, hid_t mem_spaces[], hid_t file_spaces[],
haddr_t offsets[], size_t element_sizes[], int *wbufs[])
{
- int i;
- int j;
- hbool_t result = TRUE;
+ int i;
+ int j;
/* Update write buffer */
for (i = 0; i < (int)count; i++)
@@ -5007,10 +5001,10 @@ test_selection_io_write(H5FD_t *lf, H5FD_mem_t type, uint32_t count, hid_t mem_s
(const void **)wbufs) < 0)
TEST_ERROR
- return result;
+ return 0;
error:
- return FALSE;
+ return -1;
} /* end test_selection_io_write() */
/*-------------------------------------------------------------------------
@@ -5031,17 +5025,16 @@ error:
*
*-------------------------------------------------------------------------
*/
-static hbool_t
+static herr_t
test_selection_io_read_verify(H5FD_t *lf, H5FD_mem_t type, uint32_t count, hid_t mem_spaces[],
hid_t file_spaces[], haddr_t offsets[], size_t element_sizes[],
uint32_t rbufcount, int *erbufs[], hbool_t shorten_rbufs)
{
- int rbuf1[SEL_IO_DIM0 * SEL_IO_DIM1];
- int rbuf2[SEL_IO_DIM0 * SEL_IO_DIM1];
- int * rbufs[2] = {rbuf1, rbuf2};
- int i;
- int j;
- hbool_t result = TRUE;
+ int rbuf1[SEL_IO_DIM0 * SEL_IO_DIM1];
+ int rbuf2[SEL_IO_DIM0 * SEL_IO_DIM1];
+ int *rbufs[2] = {rbuf1, rbuf2};
+ int i;
+ int j;
/* Initialize read buffer */
for (i = 0; i < (int)rbufcount; i++)
@@ -5066,15 +5059,15 @@ test_selection_io_read_verify(H5FD_t *lf, H5FD_mem_t type, uint32_t count, hid_t
if (rbufs[i][j] != erbufs[i][j]) {
H5_FAILED()
AT()
- printf("data read from file does not match expected values at mapping array location %d\n",
- i);
- printf("expected data: \n");
+ HDprintf("data read from file does not match expected values at mapping array location %d\n",
+ i);
+ HDprintf("expected data: \n");
for (j = 0; j < SEL_IO_DIM0 * SEL_IO_DIM1; j++) {
printf("%6d", erbufs[i][j]);
if (!((j + 1) % SEL_IO_DIM1))
printf("\n");
}
- printf("read data: \n");
+ HDprintf("read data: \n");
for (j = 0; j < SEL_IO_DIM0 * SEL_IO_DIM1; j++) {
printf("%6d", rbufs[i][j]);
if (!((j + 1) % SEL_IO_DIM1))
@@ -5083,10 +5076,10 @@ test_selection_io_read_verify(H5FD_t *lf, H5FD_mem_t type, uint32_t count, hid_t
goto error;
}
- return result;
+ return 0;
error:
- return FALSE;
+ return -1;
} /* end test_selection_io_read_verify() */
/*-------------------------------------------------------------------------
@@ -5204,8 +5197,8 @@ test_selection_io(const char *vfd_name)
* Test 1: Simple 1D contiguous I/O
*/
/* Issue write call */
- if (!test_selection_io_write(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0], element_sizes,
- (int **)&wbufs[0]))
+ if (test_selection_io_write(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0], element_sizes,
+ (int **)&wbufs[0]) < 0)
TEST_ERROR
/* Update file buf */
@@ -5213,16 +5206,16 @@ test_selection_io(const char *vfd_name)
fbuf1[i] = wbuf1[i];
/* Read and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
- element_sizes, 1, (int **)&fbufs[0], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
+ element_sizes, 1, (int **)&fbufs[0], FALSE) < 0)
TEST_ERROR
/*
* Test 2: Simple 2D contiguous I/O
*/
/* Issue write call */
- if (!test_selection_io_write(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1], element_sizes,
- (int **)&wbufs[1]))
+ if (test_selection_io_write(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1], element_sizes,
+ (int **)&wbufs[1]) < 0)
TEST_ERROR
/* Update file buf */
@@ -5231,8 +5224,8 @@ test_selection_io(const char *vfd_name)
fbuf2[i][j] = wbuf2[i][j];
/* Read and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
- element_sizes, 1, (int **)&fbufs[1], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
+ element_sizes, 1, (int **)&fbufs[1], FALSE) < 0)
TEST_ERROR
/*
@@ -5254,8 +5247,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Issue write call */
- if (!test_selection_io_write(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0], element_sizes,
- (int **)&wbufs[0]))
+ if (test_selection_io_write(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0], element_sizes,
+ (int **)&wbufs[0]) < 0)
TEST_ERROR
/* Update file buf */
@@ -5269,8 +5262,8 @@ test_selection_io(const char *vfd_name)
erbuf1[(2 * i) + 1] = wbuf1[(2 * i) + 1];
/* Read and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
- element_sizes, 1, (int **)&erbufs[0], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
+ element_sizes, 1, (int **)&erbufs[0], FALSE) < 0)
TEST_ERROR
/* Reset selections */
@@ -5280,8 +5273,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Read entire file buffer and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
- element_sizes, 1, (int **)&fbufs[0], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
+ element_sizes, 1, (int **)&fbufs[0], FALSE) < 0)
TEST_ERROR
/*
@@ -5303,8 +5296,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Issue write call */
- if (!test_selection_io_write(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0], element_sizes,
- (int **)&wbufs[0]))
+ if (test_selection_io_write(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0], element_sizes,
+ (int **)&wbufs[0]) < 0)
TEST_ERROR
/* Update file buf */
@@ -5318,8 +5311,8 @@ test_selection_io(const char *vfd_name)
erbuf1[i + 1] = wbuf1[i + 1];
/* Read and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
- element_sizes, 1, (int **)&erbufs[0], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
+ element_sizes, 1, (int **)&erbufs[0], FALSE) < 0)
TEST_ERROR
/* Reset selections */
@@ -5329,8 +5322,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Read entire file buffer and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
- element_sizes, 1, (int **)&fbufs[0], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
+ element_sizes, 1, (int **)&fbufs[0], FALSE) < 0)
TEST_ERROR
/*
@@ -5353,8 +5346,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Issue write call */
- if (!test_selection_io_write(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0], element_sizes,
- (int **)&wbufs[0]))
+ if (test_selection_io_write(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0], element_sizes,
+ (int **)&wbufs[0]) < 0)
TEST_ERROR
/* Update file buf */
@@ -5368,8 +5361,8 @@ test_selection_io(const char *vfd_name)
erbuf1[(2 * i) + 1] = wbuf1[(2 * i) + 1];
/* Read and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
- element_sizes, 1, (int **)&erbufs[0], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
+ element_sizes, 1, (int **)&erbufs[0], FALSE) < 0)
TEST_ERROR
/* Reset selections */
@@ -5379,8 +5372,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Read entire file buffer and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
- element_sizes, 1, (int **)&fbufs[0], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[0], &addrs[0],
+ element_sizes, 1, (int **)&fbufs[0], FALSE) < 0)
TEST_ERROR
/*
@@ -5403,8 +5396,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Issue write call */
- if (!test_selection_io_write(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1], element_sizes,
- (int **)&wbufs[1]))
+ if (test_selection_io_write(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1], element_sizes,
+ (int **)&wbufs[1]) < 0)
TEST_ERROR
/* Update file buf */
@@ -5421,8 +5414,8 @@ test_selection_io(const char *vfd_name)
erbuf2[(2 * i) + 1][j] = wbuf2[(2 * i) + 1][j];
/* Read and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
- element_sizes, 1, (int **)&erbufs[1], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
+ element_sizes, 1, (int **)&erbufs[1], FALSE) < 0)
TEST_ERROR
/* Reset selections */
@@ -5432,8 +5425,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Read entire file buffer and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
- element_sizes, 1, (int **)&fbufs[1], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
+ element_sizes, 1, (int **)&fbufs[1], FALSE) < 0)
TEST_ERROR
/*
@@ -5456,8 +5449,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Issue write call */
- if (!test_selection_io_write(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1], element_sizes,
- (int **)&wbufs[1]))
+ if (test_selection_io_write(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1], element_sizes,
+ (int **)&wbufs[1]) < 0)
TEST_ERROR
/* Update file buf */
@@ -5474,8 +5467,8 @@ test_selection_io(const char *vfd_name)
erbuf2[i][j + 1] = wbuf2[i][j + 1];
/* Read and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
- element_sizes, 1, (int **)&erbufs[1], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
+ element_sizes, 1, (int **)&erbufs[1], FALSE) < 0)
TEST_ERROR
/* Reset selections */
@@ -5485,8 +5478,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Read entire file buffer and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
- element_sizes, 1, (int **)&fbufs[1], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
+ element_sizes, 1, (int **)&fbufs[1], FALSE) < 0)
TEST_ERROR
/*
@@ -5521,8 +5514,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Issue write call */
- if (!test_selection_io_write(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1], element_sizes,
- (int **)&wbufs[1]))
+ if (test_selection_io_write(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1], element_sizes,
+ (int **)&wbufs[1]) < 0)
TEST_ERROR
/* Update file buf */
@@ -5544,8 +5537,8 @@ test_selection_io(const char *vfd_name)
erbuf2[i][j] = wbuf2[i][j];
/* Read and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
- element_sizes, 1, (int **)&erbufs[1], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
+ element_sizes, 1, (int **)&erbufs[1], FALSE) < 0)
TEST_ERROR
/* Reset selections */
@@ -5555,8 +5548,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Read entire file buffer and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
- element_sizes, 1, (int **)&fbufs[1], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[1], &addrs[1],
+ element_sizes, 1, (int **)&fbufs[1], FALSE) < 0)
TEST_ERROR
/*
@@ -5583,8 +5576,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Issue write call */
- if (!test_selection_io_write(lf, type, 1, &mem_spaces[0], &file_spaces[1], &addrs[1], element_sizes,
- (int **)&wbufs[0]))
+ if (test_selection_io_write(lf, type, 1, &mem_spaces[0], &file_spaces[1], &addrs[1], element_sizes,
+ (int **)&wbufs[0]) < 0)
TEST_ERROR
/* Update file buf */
@@ -5604,8 +5597,8 @@ test_selection_io(const char *vfd_name)
erbuf1[i] = wbuf1[i];
/* Read and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[1], &addrs[1],
- element_sizes, 1, (int **)&erbufs[0], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[1], &addrs[1],
+ element_sizes, 1, (int **)&erbufs[0], FALSE) < 0)
TEST_ERROR
/* Reset selections */
@@ -5615,8 +5608,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Read entire file buffer and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[1], &addrs[1],
- element_sizes, 1, (int **)&fbufs[1], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[0], &file_spaces[1], &addrs[1],
+ element_sizes, 1, (int **)&fbufs[1], FALSE) < 0)
TEST_ERROR
/*
@@ -5643,8 +5636,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Issue write call */
- if (!test_selection_io_write(lf, type, 1, &mem_spaces[1], &file_spaces[0], &addrs[0], element_sizes,
- (int **)&wbufs[1]))
+ if (test_selection_io_write(lf, type, 1, &mem_spaces[1], &file_spaces[0], &addrs[0], element_sizes,
+ (int **)&wbufs[1]) < 0)
TEST_ERROR
/* Update file buf */
@@ -5663,8 +5656,8 @@ test_selection_io(const char *vfd_name)
erbuf2[i][j] = wbuf2[i][j];
/* Read and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[0], &addrs[0],
- element_sizes, 1, (int **)&erbufs[1], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[0], &addrs[0],
+ element_sizes, 1, (int **)&erbufs[1], FALSE) < 0)
TEST_ERROR
/* Reset selections */
@@ -5674,8 +5667,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Read entire file buffer and verify */
- if (!test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[0], &addrs[0],
- element_sizes, 1, (int **)&fbufs[0], FALSE))
+ if (test_selection_io_read_verify(lf, type, 1, &mem_spaces[1], &file_spaces[0], &addrs[0],
+ element_sizes, 1, (int **)&fbufs[0], FALSE) < 0)
TEST_ERROR
/* Run tests with full and partial element sizes array */
@@ -5724,8 +5717,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Issue write call */
- if (!test_selection_io_write(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes,
- (int **)wbufs))
+ if (test_selection_io_write(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes,
+ (int **)wbufs) < 0)
TEST_ERROR
/* Update file bufs */
@@ -5754,8 +5747,8 @@ test_selection_io(const char *vfd_name)
erbuf2[i][j] = wbuf2[i][j];
/* Read and verify */
- if (!test_selection_io_read_verify(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes, 2,
- (int **)erbufs, FALSE))
+ if (test_selection_io_read_verify(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes, 2,
+ (int **)erbufs, FALSE) < 0)
TEST_ERROR
/* Reset selections */
@@ -5769,8 +5762,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Read entire file buffer and verify */
- if (!test_selection_io_read_verify(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes, 2,
- (int **)fbufs, FALSE))
+ if (test_selection_io_read_verify(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes, 2,
+ (int **)fbufs, FALSE) < 0)
TEST_ERROR
/*
@@ -5833,8 +5826,8 @@ test_selection_io(const char *vfd_name)
wbufs[1] = wbufs[0];
/* Issue write call */
- if (!test_selection_io_write(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes,
- (int **)wbufs))
+ if (test_selection_io_write(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes,
+ (int **)wbufs) < 0)
TEST_ERROR
/* Update file bufs - need to reuse 1D array so data stays consistent, so use math to
@@ -5870,8 +5863,8 @@ test_selection_io(const char *vfd_name)
erbuf2[i][j] = wbuf2[i][j];
/* Read and verify */
- if (!test_selection_io_read_verify(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes, 1,
- (int **)&erbufs[1], shorten_element_sizes ? TRUE : FALSE))
+ if (test_selection_io_read_verify(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes, 1,
+ (int **)&erbufs[1], shorten_element_sizes ? TRUE : FALSE) < 0)
TEST_ERROR
/* Reset selections */
@@ -5885,8 +5878,8 @@ test_selection_io(const char *vfd_name)
TEST_ERROR
/* Read entire file buffer and verify */
- if (!test_selection_io_read_verify(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes, 2,
- (int **)fbufs, FALSE))
+ if (test_selection_io_read_verify(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes, 2,
+ (int **)fbufs, FALSE) < 0)
TEST_ERROR
/* Reset first spaces to 1D */
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index ff4446c..32f4a0f 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -89,6 +89,7 @@ set (H5P_TESTS
t_shapesame
t_filters_parallel
t_2Gio
+ t_vfd
)
foreach (h5_testp ${H5P_TESTS})