From 7d9b850574453bf7cff91350ea5fa6e657748644 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Thu, 24 Mar 2022 08:27:29 -0500 Subject: Windows and *nix use different forms for warnings (#1515) --- config/cmake/HDFFortranCompilerFlags.cmake | 6 +++--- config/intel-warnings/ifort-general | 2 +- config/intel-warnings/win-ifort-general | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 config/intel-warnings/win-ifort-general 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 -- cgit v0.12 From 25ef608e2f1678c04a81b11ed9443768cdbd9dbd Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Thu, 24 Mar 2022 16:56:06 -0500 Subject: Change ENV to CMake var (#1520) * Change ENV to CMake var * Fix typo deletion * Fix typo --- config/cmake/HDF5_Examples.cmake.in | 3 +-- 1 file changed, 1 insertion(+), 2 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}") -- cgit v0.12 From feff1e58a71f6f8ecc505495287d9b8bc22ddc9a Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Sat, 26 Mar 2022 13:14:37 -0500 Subject: Address comments from selection I/O PR --- src/H5Dchunk.c | 10 ++- src/H5Dcontig.c | 6 +- src/H5FDint.c | 167 +++++++++++++++++++------------------ src/H5PB.c | 26 +++--- src/H5PBprivate.h | 2 +- test/test_flush_refresh.sh.in | 10 --- test/test_swmr.sh.in | 5 -- test/test_use_cases.sh.in | 5 -- test/test_vds_swmr.sh.in | 5 -- test/vfd.c | 186 ++++++++++++++++++++---------------------- testpar/CMakeLists.txt | 1 + 11 files changed, 201 insertions(+), 222 deletions(-) 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..534d7df 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,8 @@ 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 +4469,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 +4496,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 +4982,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; /* Update write buffer */ for (i = 0; i < (int)count; i++) @@ -5007,10 +5000,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,7 +5024,7 @@ 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) @@ -5041,7 +5034,6 @@ test_selection_io_read_verify(H5FD_t *lf, H5FD_mem_t type, uint32_t count, hid_t int * rbufs[2] = {rbuf1, rbuf2}; int i; int j; - hbool_t result = TRUE; /* Initialize read buffer */ for (i = 0; i < (int)rbufcount; i++) @@ -5066,15 +5058,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", + HDprintf("data read from file does not match expected values at mapping array location %d\n", i); - printf("expected data: \n"); + 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 +5075,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 +5196,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 +5205,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 +5223,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 +5246,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 +5261,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 +5272,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 +5295,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 +5310,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 +5321,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 +5345,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 +5360,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 +5371,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 +5395,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 +5413,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 +5424,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 +5448,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 +5466,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 +5477,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 +5513,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 +5536,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 +5547,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 +5575,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 +5596,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 +5607,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 +5635,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 +5655,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 +5666,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 +5716,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 +5746,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 +5761,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 +5825,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 +5862,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 +5877,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}) -- cgit v0.12 From 0595d95d12ecd3646eac67fb40e73e00cbb741cd Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 26 Mar 2022 18:16:33 +0000 Subject: Committing clang-format changes --- test/vfd.c | 55 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/test/vfd.c b/test/vfd.c index 534d7df..74889fd 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -4428,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\"/%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]); + 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++; @@ -4496,8 +4497,8 @@ test_vector_io__dump_test_vectors(uint32_t count, H5FD_mem_t types[], haddr_t ad r_buf = NULL; } - 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); + 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) { @@ -4986,8 +4987,8 @@ 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; + int i; + int j; /* Update write buffer */ for (i = 0; i < (int)count; i++) @@ -5029,11 +5030,11 @@ test_selection_io_read_verify(H5FD_t *lf, H5FD_mem_t type, uint32_t count, hid_t 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; + 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++) @@ -5059,7 +5060,7 @@ test_selection_io_read_verify(H5FD_t *lf, H5FD_mem_t type, uint32_t count, hid_t H5_FAILED() AT() HDprintf("data read from file does not match expected values at mapping array location %d\n", - i); + i); HDprintf("expected data: \n"); for (j = 0; j < SEL_IO_DIM0 * SEL_IO_DIM1; j++) { printf("%6d", erbufs[i][j]); @@ -5206,7 +5207,7 @@ test_selection_io(const char *vfd_name) /* 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) < 0) + element_sizes, 1, (int **)&fbufs[0], FALSE) < 0) TEST_ERROR /* @@ -5262,7 +5263,7 @@ test_selection_io(const char *vfd_name) /* 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) < 0) + element_sizes, 1, (int **)&erbufs[0], FALSE) < 0) TEST_ERROR /* Reset selections */ @@ -5467,7 +5468,7 @@ test_selection_io(const char *vfd_name) /* 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) < 0) + element_sizes, 1, (int **)&erbufs[1], FALSE) < 0) TEST_ERROR /* Reset selections */ @@ -5576,7 +5577,7 @@ test_selection_io(const char *vfd_name) /* Issue write call */ if (test_selection_io_write(lf, type, 1, &mem_spaces[0], &file_spaces[1], &addrs[1], element_sizes, - (int **)&wbufs[0]) < 0) + (int **)&wbufs[0]) < 0) TEST_ERROR /* Update file buf */ @@ -5597,7 +5598,7 @@ test_selection_io(const char *vfd_name) /* 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) < 0) + element_sizes, 1, (int **)&erbufs[0], FALSE) < 0) TEST_ERROR /* Reset selections */ @@ -5608,7 +5609,7 @@ test_selection_io(const char *vfd_name) /* 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) < 0) + element_sizes, 1, (int **)&fbufs[1], FALSE) < 0) TEST_ERROR /* @@ -5636,7 +5637,7 @@ test_selection_io(const char *vfd_name) /* Issue write call */ if (test_selection_io_write(lf, type, 1, &mem_spaces[1], &file_spaces[0], &addrs[0], element_sizes, - (int **)&wbufs[1]) < 0) + (int **)&wbufs[1]) < 0) TEST_ERROR /* Update file buf */ @@ -5656,7 +5657,7 @@ test_selection_io(const char *vfd_name) /* 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) < 0) + element_sizes, 1, (int **)&erbufs[1], FALSE) < 0) TEST_ERROR /* Reset selections */ @@ -5667,7 +5668,7 @@ test_selection_io(const char *vfd_name) /* 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) < 0) + element_sizes, 1, (int **)&fbufs[0], FALSE) < 0) TEST_ERROR /* Run tests with full and partial element sizes array */ @@ -5717,7 +5718,7 @@ test_selection_io(const char *vfd_name) /* Issue write call */ if (test_selection_io_write(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes, - (int **)wbufs) < 0) + (int **)wbufs) < 0) TEST_ERROR /* Update file bufs */ @@ -5747,7 +5748,7 @@ test_selection_io(const char *vfd_name) /* Read and verify */ if (test_selection_io_read_verify(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes, 2, - (int **)erbufs, FALSE) < 0) + (int **)erbufs, FALSE) < 0) TEST_ERROR /* Reset selections */ @@ -5762,7 +5763,7 @@ test_selection_io(const char *vfd_name) /* 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) < 0) + (int **)fbufs, FALSE) < 0) TEST_ERROR /* @@ -5826,7 +5827,7 @@ test_selection_io(const char *vfd_name) /* Issue write call */ if (test_selection_io_write(lf, type, 2, mem_spaces, file_spaces, addrs, element_sizes, - (int **)wbufs) < 0) + (int **)wbufs) < 0) TEST_ERROR /* Update file bufs - need to reuse 1D array so data stays consistent, so use math to @@ -5863,7 +5864,7 @@ test_selection_io(const char *vfd_name) /* 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) < 0) + (int **)&erbufs[1], shorten_element_sizes ? TRUE : FALSE) < 0) TEST_ERROR /* Reset selections */ @@ -5878,7 +5879,7 @@ test_selection_io(const char *vfd_name) /* 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) < 0) + (int **)fbufs, FALSE) < 0) TEST_ERROR /* Reset first spaces to 1D */ -- cgit v0.12