From 0ba0f1c170ffc9566cd0a7f00312565b3142e555 Mon Sep 17 00:00:00 2001 From: "vchoi-hdfgroup.org" Date: Tue, 2 May 2023 12:16:46 -0500 Subject: [PATCH 01/37] Add H5Pget_actual_selection_io_mode() API. --- src/H5CX.c | 50 ++++++++++++++++++++++++++++++++++++-- src/H5CXprivate.h | 1 + src/H5Dprivate.h | 1 + src/H5FDint.c | 24 ++++++++++++++++++ src/H5Pdxpl.c | 44 +++++++++++++++++++++++++++++++++ src/H5Ppublic.h | 45 ++++++++++++++++++++++++++++++++++ test/select_io_dset.c | 49 ++++++++++++++++++++++++++++++++++--- testpar/t_select_io_dset.c | 38 ++++++++++++++++++++++++++++- 8 files changed, 246 insertions(+), 6 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index e5595b7088b..963fbdd8ca8 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -305,6 +305,9 @@ typedef struct H5CX_t { hbool_t no_selection_io_cause_set; /* Whether reason for not performing selection I/O is set */ hbool_t no_selection_io_cause_valid; /* Whether reason for not performing selection I/O is valid */ + uint32_t actual_selection_io_mode; /* Actual selection I/O mode used (H5D_ACTUAL_SELECTION_IO_MODE_NAME) */ + hbool_t actual_selection_io_mode_set; /* Whether actual selection I/O mode is set */ + /* Cached LCPL properties */ H5T_cset_t encoding; /* Link name character encoding */ hbool_t encoding_valid; /* Whether link name character encoding is valid */ @@ -386,6 +389,8 @@ typedef struct H5CX_dxpl_cache_t { H5D_selection_io_mode_t selection_io_mode; /* Selection I/O mode (H5D_XFER_SELECTION_IO_MODE_NAME) */ uint32_t no_selection_io_cause; /* Reasons for not performing selection I/O (H5D_XFER_NO_SELECTION_IO_CAUSE_NAME) */ + uint32_t actual_selection_io_mode; /* Actual selection I/O mode + (H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME) */ hbool_t modify_write_buf; /* Whether the library can modify write buffers */ } H5CX_dxpl_cache_t; @@ -576,13 +581,18 @@ H5CX_init(void) /* Get the selection I/O mode */ if (H5P_get(dx_plist, H5D_XFER_SELECTION_IO_MODE_NAME, &H5CX_def_dxpl_cache.selection_io_mode) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve parallel transfer method") + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve selection I/O mode") /* Get the local & global reasons for breaking selection I/O values */ if (H5P_get(dx_plist, H5D_XFER_NO_SELECTION_IO_CAUSE_NAME, &H5CX_def_dxpl_cache.no_selection_io_cause) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve cause for no selection I/O") + /* Get the actual selection I/O mode */ + if (H5P_get(dx_plist, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, &H5CX_def_dxpl_cache.actual_selection_io_mode) < + 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve actual selection I/O mode") + /* Get the modify write buffer property */ if (H5P_get(dx_plist, H5D_XFER_MODIFY_WRITE_BUF_NAME, &H5CX_def_dxpl_cache.modify_write_buf) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve modify write buffer property") @@ -3702,7 +3712,42 @@ H5CX_set_no_selection_io_cause(uint32_t no_selection_io_cause) } /* end if */ FUNC_LEAVE_NOAPI_VOID -} /* end H5CX_set_no_selectiion_io_cause() */ +} /* end H5CX_set_no_selection_io_cause() */ + +/*------------------------------------------------------------------------- + * Function: H5CX_set_actual_selecction_io_mode + * + * Purpose: Sets the actual selection I/O mode for the current API + * call context. + * + * Return: + * + * Programmer: Vailin Choi + * April 15, 2023 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_actual_selection_io_mode(uint32_t actual_selection_io_mode) +{ + H5CX_node_t **head = NULL; /* Pointer to head of API context list */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + HDassert(head && *head); + HDassert((*head)->ctx.dxpl_id != H5P_DEFAULT); + + /* If we're using the default DXPL, don't modify it */ + if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.actual_selection_io_mode = actual_selection_io_mode; + (*head)->ctx.actual_selection_io_mode_set = TRUE; + } /* end if */ + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_actual_selection_io_mode() */ /*------------------------------------------------------------------------- * Function: H5CX_get_ohdr_flags @@ -3766,6 +3811,7 @@ H5CX__pop_common(hbool_t update_dxpl_props) /* Check for cached DXPL properties to return to application */ if (update_dxpl_props) { H5CX_SET_PROP(H5D_XFER_NO_SELECTION_IO_CAUSE_NAME, no_selection_io_cause) + H5CX_SET_PROP(H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, actual_selection_io_mode) #ifdef H5_HAVE_PARALLEL H5CX_SET_PROP(H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, mpio_actual_chunk_opt) H5CX_SET_PROP(H5D_MPIO_ACTUAL_IO_MODE_NAME, mpio_actual_io_mode) diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h index f0bec205da7..665363457fb 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -163,6 +163,7 @@ H5_DLL herr_t H5CX_init(void); /* "Setter" routines for cached DXPL properties that must be returned to application */ H5_DLL void H5CX_set_no_selection_io_cause(uint32_t no_selection_io_cause); +H5_DLL void H5CX_set_actual_selection_io_mode(uint32_t actual_selection_io_mode); #ifdef H5_HAVE_PARALLEL H5_DLL void H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t chunk_opt); diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 8265ac25219..fcc9bffa4d4 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -86,6 +86,7 @@ #define H5D_XFER_DSET_IO_SEL_NAME "dset_io_selection" /* Dataset I/O selection */ #define H5D_XFER_SELECTION_IO_MODE_NAME "selection_io_mode" /* Selection I/O mode */ #define H5D_XFER_NO_SELECTION_IO_CAUSE_NAME "no_selection_io_cause" /* Cause for no selection I/O */ +#define H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME "actual_selection_io_mode" /* Actual selection I/O mode */ #define H5D_XFER_MODIFY_WRITE_BUF_NAME "modify_write_buf" /* Modify write buffers */ #ifdef H5_HAVE_INSTRUMENTED_LIBRARY /* Collective chunk instrumentation properties */ diff --git a/src/H5FDint.c b/src/H5FDint.c index 6d90aaecd91..eaaa5987dc3 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -461,6 +461,9 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs if ((file->cls->read_vector)(file, dxpl_id, count, types, addrs, sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read vector request failed") + + /* Set actual selection I/O */ + H5CX_set_actual_selection_io_mode(H5D_VECTOR_IO); } else { @@ -668,6 +671,9 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr if ((file->cls->write_vector)(file, dxpl_id, count, types, addrs, sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write vector request failed") + + /* Set actual selection I/O */ + H5CX_set_actual_selection_io_mode(H5D_VECTOR_IO); } else { /* otherwise, implement the vector write as a sequence of regular @@ -1002,6 +1008,9 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin if ((file->cls->read_vector)(file, dxpl_id, (uint32_t)vec_arr_nused, types, addrs, sizes, vec_bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read vector request failed") + + /* Set actual selection I/O */ + H5CX_set_actual_selection_io_mode(H5D_VECTOR_IO); } else { uint32_t no_selection_io_cause; @@ -1190,6 +1199,9 @@ H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_s if ((file->cls->read_selection)(file, type, dxpl_id, count, mem_space_ids, file_space_ids, offsets, element_sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read selection request failed") + + /* Set actual selection I/O */ + H5CX_set_actual_selection_io_mode(H5D_SELECTION_IO); } else /* Otherwise, implement the selection read as a sequence of regular @@ -1332,6 +1344,9 @@ H5FD_read_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_ if ((file->cls->read_selection)(file, type, dxpl_id, count, mem_space_ids, file_space_ids, offsets, element_sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read selection request failed") + + /* Set actual selection I/O */ + H5CX_set_actual_selection_io_mode(H5D_SELECTION_IO); } else { /* Otherwise, implement the selection read as a sequence of regular @@ -1649,6 +1664,9 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui if ((file->cls->write_vector)(file, dxpl_id, (uint32_t)vec_arr_nused, types, addrs, sizes, vec_bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write vector request failed") + + /* Set actual selection I/O */ + H5CX_set_actual_selection_io_mode(H5D_VECTOR_IO); } else { uint32_t no_selection_io_cause; @@ -1829,6 +1847,9 @@ H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_ if ((file->cls->write_selection)(file, type, dxpl_id, count, mem_space_ids, file_space_ids, offsets, element_sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write selection request failed") + + /* Set actual selection I/O */ + H5CX_set_actual_selection_io_mode(H5D_SELECTION_IO); } else /* Otherwise, implement the selection write as a sequence of regular @@ -1962,6 +1983,9 @@ H5FD_write_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem if ((file->cls->write_selection)(file, type, dxpl_id, count, mem_space_ids, file_space_ids, offsets, element_sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write selection request failed") + + /* Set actual selection I/O */ + H5CX_set_actual_selection_io_mode(H5D_SELECTION_IO); } else { /* Otherwise, implement the selection write as a sequence of regular diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 942d6f21dea..c71766393c1 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -176,6 +176,9 @@ /* Definitions for cause of no selection I/O property */ #define H5D_XFER_NO_SELECTION_IO_CAUSE_SIZE sizeof(uint32_t) #define H5D_XFER_NO_SELECTION_IO_CAUSE_DEF 0 +/* Definitions for actual selection I/O mode property */ +#define H5D_XFER_ACTUAL_SELECTION_IO_MODE_SIZE sizeof(uint32_t) +#define H5D_XFER_ACTUAL_SELECTION_IO_MODE_DEF H5D_SCALAR_IO /* Definitions for modify write buffer property */ #define H5D_XFER_MODIFY_WRITE_BUF_SIZE sizeof(hbool_t) #define H5D_XFER_MODIFY_WRITE_BUF_DEF FALSE @@ -296,6 +299,7 @@ static const H5S_t *H5D_def_dset_io_sel_g = H5D_XFER_DSET_IO_SEL_DEF; /* Default value for dataset I/O selection */ static const H5D_selection_io_mode_t H5D_def_selection_io_mode_g = H5D_XFER_SELECTION_IO_MODE_DEF; static const uint32_t H5D_def_no_selection_io_cause_g = H5D_XFER_NO_SELECTION_IO_CAUSE_DEF; +static const uint32_t H5D_def_actual_selection_io_mode_g = H5D_XFER_ACTUAL_SELECTION_IO_MODE_DEF; static const hbool_t H5D_def_modify_write_buf_g = H5D_XFER_MODIFY_WRITE_BUF_DEF; /*------------------------------------------------------------------------- @@ -473,6 +477,13 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register the actual selection I/O mode property */ + /* (Note: this property should not have an encode/decode callback -QAK) */ + if (H5P__register_real(pclass, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, H5D_XFER_ACTUAL_SELECTION_IO_MODE_SIZE, + &H5D_def_actual_selection_io_mode_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register the modify write buffer property */ if (H5P__register_real(pclass, H5D_XFER_MODIFY_WRITE_BUF_NAME, H5D_XFER_MODIFY_WRITE_BUF_SIZE, &H5D_def_modify_write_buf_g, NULL, NULL, NULL, H5D_XFER_MODIFY_WRITE_BUF_ENC, @@ -2610,6 +2621,39 @@ H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selection_io_cause /*o FUNC_LEAVE_API(ret_value) } /* end H5Pget_no_selection_io_cause() */ +/*------------------------------------------------------------------------- + * Function: H5Pget_actual_selection_io_mode + * + * Purpose: Retrieves actual selection I/O mode + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Vailin Choi + * April 27, 2023 + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_actual_selection_io_mode(hid_t plist_id, uint32_t *actual_selection_io_mode /*out*/) +{ + H5P_genplist_t *plist; + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "ix", plist_id, actual_selection_io_mode); + + /* Get the plist structure */ + if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID") + + /* Return values */ + if (actual_selection_io_mode) + if (H5P_get(plist, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, actual_selection_io_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get actual_selection_io_mode value") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_actual_selection_io_mode() */ + /*------------------------------------------------------------------------- * Function: H5P__dxfr_modify_write_buf_enc * diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 53a455c78ff..f55463c77b1 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -420,6 +420,12 @@ typedef enum H5D_selection_io_mode_t { } H5D_selection_io_mode_t; //! + +/* Actual selection I/O modes for H5Pget_actual_selection_io_mode() property */ +#define H5D_SCALAR_IO 0x1 /* Scalar (or legacy MPIO) I/O was performed */ +#define H5D_VECTOR_IO 0x2 /* Vector I/O was performed */ +#define H5D_SELECTION_IO 0x4 /* Selection I/O was performed */ + /********************/ /* Public Variables */ /********************/ @@ -8394,6 +8400,45 @@ H5_DLL herr_t H5Pget_selection_io(hid_t plist_id, H5D_selection_io_mode_t *selec */ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selection_io_cause); +/** + * \ingroup DXPL + * + * \brief Retrieves the type of I/O that HDF5 actually performed on + * last I/O call (not necessarily the type requested) + * + * \dxpl_id{plist_id} + * \param[out] actual_selection_io_mode A bitwise set value indicating the + * type of I/O performed + * \return \herr_t + * + * \par Motivation: + * A user can request selection I/O to be performed via a data transfer + * property list (DXPL). This can be used to enable collective I/O with + * type conversion, or with custom VFDs that support vector or selection + * I/O. However, there are conditions that can cause HDF5 to forgo + * selection or vector I/O and perform legacy (scalar) I/O instead. + * + * \details H5Pget_actual_selection_io_mode() retrieves the type of I/O + * that was actually performed. + * This property is set after all I/O is completed; + * if I/O fails, it will not be set. + * after the actual I/O takes place. + * + * Valid values returned in \p actual_selection_io_mode are listed + * as follows. + * + * - #H5D_SCALAR_IO + * Scalar (or legacy MPIO) I/O was performed + * - #H5D_VECTOR_IO + * Vector I/O was performed + * - #H5D_SELECTION_IO + * Selection I/O was performed + * + * \since 1.14.2 + * + */ +H5_DLL herr_t H5Pget_actual_selection_io_mode(hid_t plist_id, uint32_t *actual_selection_io_mode); + /** * * \ingroup DXPL diff --git a/test/select_io_dset.c b/test/select_io_dset.c index 0724365b767..2221985019b 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -106,6 +106,22 @@ typedef enum { #define TEST_TCONV_BUF_TOO_SMALL 0x100 #define TEST_IN_PLACE_TCONV 0x200 +static herr_t +check_actual_selection_io_mode(hid_t dxpl, uint32_t sel_io_mode_expected) +{ + uint32_t actual_sel_io_mode; + + if (H5Pget_actual_selection_io_mode(dxpl, &actual_sel_io_mode) < 0) + FAIL_STACK_ERROR; + if(actual_sel_io_mode != sel_io_mode_expected) + TEST_ERROR; + + + return SUCCEED; +error: + return FAIL; +} + /* * Case 1: single dataset read/write, no type conversion (null case) * --create dataset with H5T_NATIVE_INT @@ -184,6 +200,9 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, sizeof(wbuf)); @@ -192,6 +211,9 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) FAIL_STACK_ERROR; + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Verify data or transformed data read */ for (i = 0; i < DSET_SELECT_DIM; i++) if (rbuf[i] != (dtrans ? trans_wbuf[i] : wbuf[i])) { @@ -324,6 +346,9 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Dwrite(did, H5T_STD_I32LE, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, (size_t)(4 * DSET_SELECT_DIM)); @@ -332,6 +357,9 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Dread(did, H5T_STD_I32LE, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0) FAIL_STACK_ERROR; + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Verify data read little endian */ for (i = 0; i < DSET_SELECT_DIM; i++) if (rbuf[4 * i + 0] != wbuf[4 * i + 0] || rbuf[4 * i + 1] != wbuf[4 * i + 1] || @@ -474,6 +502,9 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign if (H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, sizeof(wbuf)); @@ -482,6 +513,9 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign if (H5Dread(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) FAIL_STACK_ERROR; + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Verify data or transformed data read */ for (i = 0; i < DSET_SELECT_DIM; i++) if (rbuf[i] != (long long)(dtrans ? trans_wbuf[i] : wbuf[i])) { @@ -617,6 +651,9 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig if (H5Dwrite(did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, sizeof(wbuf)); @@ -625,6 +662,9 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig if (H5Dread(did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) FAIL_STACK_ERROR; + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Verify data or transformed data read */ for (i = 0; i < DSET_SELECT_DIM; i++) if (rbuf[i] != (dtrans ? trans_wbuf[i] : wbuf[i])) { @@ -2897,9 +2937,6 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR; - /* If default mode, 1st write will trigger cb, 2nd write will trigger sieve */ - /* If on mode, will trigger nothing because the on mode path is different */ - /* Need 2 writes */ if (test_mode & TEST_CONTIGUOUS_SIEVE_BUFFER) { no_selection_io_cause_write_expected |= H5D_SEL_IO_CONTIGUOUS_SIEVE_BUFFER; no_selection_io_cause_read_expected |= H5D_SEL_IO_CONTIGUOUS_SIEVE_BUFFER; @@ -3001,6 +3038,9 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ FAIL_STACK_ERROR; } + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; + if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause_write) < 0) TEST_ERROR; @@ -3019,6 +3059,9 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ if (H5Dread(did, tid, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0) FAIL_STACK_ERROR; + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Verify causes of no selection I/O for write is as expected */ if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause_read) < 0) TEST_ERROR; diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index 10b29e403ea..782b1c86a30 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -154,7 +154,7 @@ set_dxpl(hid_t dxpl, H5D_selection_io_mode_t select_io_mode, H5FD_mpio_xfer_t mp } /* set_dxpl() */ /* - * Helper routine to check actual I/O mode on a dxpl + * Helper routine to check actual parallel I/O mode on a dxpl */ static void check_io_mode(hid_t dxpl, unsigned chunked) @@ -181,6 +181,20 @@ check_io_mode(hid_t dxpl, unsigned chunked) } /* check_io_mode() */ +/* + * Helper routine to check actual selection I/O mode on a dxpl + */ +static void +check_actual_selection_io_mode(hid_t dxpl, uint32_t sel_io_mode_expected) +{ + uint32_t actual_sel_io_mode; + + if (H5Pget_actual_selection_io_mode(dxpl, &actual_sel_io_mode) < 0) + P_TEST_ERROR; + if(actual_sel_io_mode != sel_io_mode_expected) + P_TEST_ERROR; +} + /* * Case 1: single dataset read/write, no type conversion (null case) */ @@ -280,6 +294,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) HDmemcpy(wbuf, wbuf_bak, sizeof(wbuf)); check_io_mode(dxpl, chunked); + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); /* Read data from the dataset (if dtrans, without data transform set in dxpl) */ if (H5Dread(did, H5T_NATIVE_INT, mspace_id, fspace_id, ntrans_dxpl, rbuf) < 0) @@ -421,11 +436,13 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Dwrite(did, H5T_STD_I32LE, mspace_id, fspace_id, dxpl, wbuf) < 0) P_TEST_ERROR; + /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, (size_t)(4 * DSET_SELECT_DIM)); check_io_mode(dxpl, chunked); + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); /* Read the data from the dataset with little endian */ if (H5Dread(did, H5T_STD_I32LE, mspace_id, fspace_id, dxpl, rbuf) < 0) @@ -578,6 +595,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign HDmemcpy(wbuf, wbuf_bak, sizeof(wbuf)); check_io_mode(dxpl, chunked); + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); /* Read data from the dataset (if dtrans, without data transform set in dxpl) */ if (H5Dread(did, H5T_NATIVE_LLONG, mspace_id, fspace_id, ntrans_dxpl, rbuf) < 0) @@ -727,6 +745,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig HDmemcpy(wbuf, wbuf_bak, sizeof(wbuf)); check_io_mode(dxpl, chunked); + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); /* Read data from the dataset (if dtrans, without data transform set in dxpl) */ if (H5Dread(did, H5T_NATIVE_SHORT, mspace_id, fspace_id, ntrans_dxpl, rbuf) < 0) @@ -918,6 +937,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) HDmemcpy(s1_wbuf, s1_wbuf_bak, sizeof(s1_t) * DSET_SELECT_DIM); check_io_mode(dxpl, chunked); + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); /* Read all the data from the dataset */ HDmemset(s1_rbuf, 0, sizeof(s1_t) * DSET_SELECT_DIM); @@ -1224,6 +1244,7 @@ test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned HDmemcpy(lwbuf, lwbuf_bak, sizeof(lwbuf)); check_io_mode(dxpl, chunked); + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); /* Read the data from the dataset: type conversion int-->long */ /* If dtrans, without data transform set in dxpl */ @@ -1552,6 +1573,7 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m HDmemcpy(total_wbuf, total_wbuf_bak, ndsets * DSET_SELECT_DIM * sizeof(int)); check_io_mode(dxpl, chunked); + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); /* Read data from the dataset (if dtrans, without data transform set in dxpl) */ if (H5Dread_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, ntrans_dxpl, rbufs) < 0) @@ -1856,6 +1878,7 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) HDmemcpy(total_wbuf, total_wbuf_bak, buf_size); check_io_mode(dxpl, chunked); + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); if (H5Dread_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, dxpl, rbufs) < 0) P_TEST_ERROR; @@ -2297,6 +2320,7 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) HDmemcpy(total_wbuf, total_wbuf_bak, buf_size); check_io_mode(dxpl, chunked); + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); /* Read data from the dataset */ if (H5Dread_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, dxpl, rbufs) < 0) @@ -2766,6 +2790,7 @@ test_multi_dsets_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, un HDmemcpy(total_wbuf, total_wbuf_bak, buf_size); check_io_mode(dxpl, chunked); + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); /* Initialize buffer indices */ for (i = 0; i < (int)ndsets; i++) { @@ -3243,6 +3268,7 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; check_io_mode(dxpl, chunked); + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); /* Verify result read */ /* for i ndsets */ @@ -3418,6 +3444,8 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) P_TEST_ERROR; + set_dxpl(dxpl, H5D_SELECTION_IO_MODE_ON, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, false); + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) P_TEST_ERROR; @@ -3482,6 +3510,14 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) P_TEST_ERROR; + if (test_mode & TEST_DISABLE_BY_API || + test_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET || + ((test_mode & TEST_TCONV_BUF_TOO_SMALL) && + !(test_mode & TEST_IN_PLACE_TCONV))) + check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO); + else + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause_write) < 0) P_TEST_ERROR; From 4c8570d537fb7378be10cfc53d511cb9ea041e50 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 2 May 2023 17:19:43 +0000 Subject: [PATCH 02/37] Committing clang-format changes --- src/H5CX.c | 15 ++++++++------- src/H5Dprivate.h | 18 +++++++++--------- src/H5Pdxpl.c | 14 +++++++------- src/H5Ppublic.h | 9 ++++----- test/select_io_dset.c | 3 +-- testpar/t_select_io_dset.c | 9 +++------ 6 files changed, 32 insertions(+), 36 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index 963fbdd8ca8..ff8b1d574dd 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -305,8 +305,9 @@ typedef struct H5CX_t { hbool_t no_selection_io_cause_set; /* Whether reason for not performing selection I/O is set */ hbool_t no_selection_io_cause_valid; /* Whether reason for not performing selection I/O is valid */ - uint32_t actual_selection_io_mode; /* Actual selection I/O mode used (H5D_ACTUAL_SELECTION_IO_MODE_NAME) */ - hbool_t actual_selection_io_mode_set; /* Whether actual selection I/O mode is set */ + uint32_t + actual_selection_io_mode; /* Actual selection I/O mode used (H5D_ACTUAL_SELECTION_IO_MODE_NAME) */ + hbool_t actual_selection_io_mode_set; /* Whether actual selection I/O mode is set */ /* Cached LCPL properties */ H5T_cset_t encoding; /* Link name character encoding */ @@ -389,8 +390,8 @@ typedef struct H5CX_dxpl_cache_t { H5D_selection_io_mode_t selection_io_mode; /* Selection I/O mode (H5D_XFER_SELECTION_IO_MODE_NAME) */ uint32_t no_selection_io_cause; /* Reasons for not performing selection I/O (H5D_XFER_NO_SELECTION_IO_CAUSE_NAME) */ - uint32_t actual_selection_io_mode; /* Actual selection I/O mode - (H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME) */ + uint32_t actual_selection_io_mode; /* Actual selection I/O mode + (H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME) */ hbool_t modify_write_buf; /* Whether the library can modify write buffers */ } H5CX_dxpl_cache_t; @@ -589,8 +590,8 @@ H5CX_init(void) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve cause for no selection I/O") /* Get the actual selection I/O mode */ - if (H5P_get(dx_plist, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, &H5CX_def_dxpl_cache.actual_selection_io_mode) < - 0) + if (H5P_get(dx_plist, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, + &H5CX_def_dxpl_cache.actual_selection_io_mode) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve actual selection I/O mode") /* Get the modify write buffer property */ @@ -3742,7 +3743,7 @@ H5CX_set_actual_selection_io_mode(uint32_t actual_selection_io_mode) /* If we're using the default DXPL, don't modify it */ if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT) { /* Cache the value for later, marking it to set in DXPL when context popped */ - (*head)->ctx.actual_selection_io_mode = actual_selection_io_mode; + (*head)->ctx.actual_selection_io_mode = actual_selection_io_mode; (*head)->ctx.actual_selection_io_mode_set = TRUE; } /* end if */ diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index fcc9bffa4d4..285529c8f35 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -78,16 +78,16 @@ #define H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME \ "local_no_collective_cause" /* cause of broken collective I/O in each process */ #define H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME \ - "global_no_collective_cause" /* cause of broken collective I/O in all processes */ -#define H5D_XFER_EDC_NAME "err_detect" /* EDC */ -#define H5D_XFER_FILTER_CB_NAME "filter_cb" /* Filter callback function */ -#define H5D_XFER_CONV_CB_NAME "type_conv_cb" /* Type conversion callback function */ -#define H5D_XFER_XFORM_NAME "data_transform" /* Data transform */ -#define H5D_XFER_DSET_IO_SEL_NAME "dset_io_selection" /* Dataset I/O selection */ -#define H5D_XFER_SELECTION_IO_MODE_NAME "selection_io_mode" /* Selection I/O mode */ -#define H5D_XFER_NO_SELECTION_IO_CAUSE_NAME "no_selection_io_cause" /* Cause for no selection I/O */ + "global_no_collective_cause" /* cause of broken collective I/O in all processes */ +#define H5D_XFER_EDC_NAME "err_detect" /* EDC */ +#define H5D_XFER_FILTER_CB_NAME "filter_cb" /* Filter callback function */ +#define H5D_XFER_CONV_CB_NAME "type_conv_cb" /* Type conversion callback function */ +#define H5D_XFER_XFORM_NAME "data_transform" /* Data transform */ +#define H5D_XFER_DSET_IO_SEL_NAME "dset_io_selection" /* Dataset I/O selection */ +#define H5D_XFER_SELECTION_IO_MODE_NAME "selection_io_mode" /* Selection I/O mode */ +#define H5D_XFER_NO_SELECTION_IO_CAUSE_NAME "no_selection_io_cause" /* Cause for no selection I/O */ #define H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME "actual_selection_io_mode" /* Actual selection I/O mode */ -#define H5D_XFER_MODIFY_WRITE_BUF_NAME "modify_write_buf" /* Modify write buffers */ +#define H5D_XFER_MODIFY_WRITE_BUF_NAME "modify_write_buf" /* Modify write buffers */ #ifdef H5_HAVE_INSTRUMENTED_LIBRARY /* Collective chunk instrumentation properties */ #define H5D_XFER_COLL_CHUNK_LINK_HARD_NAME "coll_chunk_link_hard" diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index c71766393c1..545b333308f 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -178,7 +178,7 @@ #define H5D_XFER_NO_SELECTION_IO_CAUSE_DEF 0 /* Definitions for actual selection I/O mode property */ #define H5D_XFER_ACTUAL_SELECTION_IO_MODE_SIZE sizeof(uint32_t) -#define H5D_XFER_ACTUAL_SELECTION_IO_MODE_DEF H5D_SCALAR_IO +#define H5D_XFER_ACTUAL_SELECTION_IO_MODE_DEF H5D_SCALAR_IO /* Definitions for modify write buffer property */ #define H5D_XFER_MODIFY_WRITE_BUF_SIZE sizeof(hbool_t) #define H5D_XFER_MODIFY_WRITE_BUF_DEF FALSE @@ -299,8 +299,8 @@ static const H5S_t *H5D_def_dset_io_sel_g = H5D_XFER_DSET_IO_SEL_DEF; /* Default value for dataset I/O selection */ static const H5D_selection_io_mode_t H5D_def_selection_io_mode_g = H5D_XFER_SELECTION_IO_MODE_DEF; static const uint32_t H5D_def_no_selection_io_cause_g = H5D_XFER_NO_SELECTION_IO_CAUSE_DEF; -static const uint32_t H5D_def_actual_selection_io_mode_g = H5D_XFER_ACTUAL_SELECTION_IO_MODE_DEF; -static const hbool_t H5D_def_modify_write_buf_g = H5D_XFER_MODIFY_WRITE_BUF_DEF; +static const uint32_t H5D_def_actual_selection_io_mode_g = H5D_XFER_ACTUAL_SELECTION_IO_MODE_DEF; +static const hbool_t H5D_def_modify_write_buf_g = H5D_XFER_MODIFY_WRITE_BUF_DEF; /*------------------------------------------------------------------------- * Function: H5P__dxfr_reg_prop @@ -479,9 +479,9 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) /* Register the actual selection I/O mode property */ /* (Note: this property should not have an encode/decode callback -QAK) */ - if (H5P__register_real(pclass, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, H5D_XFER_ACTUAL_SELECTION_IO_MODE_SIZE, - &H5D_def_actual_selection_io_mode_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL) < 0) + if (H5P__register_real(pclass, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, + H5D_XFER_ACTUAL_SELECTION_IO_MODE_SIZE, &H5D_def_actual_selection_io_mode_g, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the modify write buffer property */ @@ -2624,7 +2624,7 @@ H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selection_io_cause /*o /*------------------------------------------------------------------------- * Function: H5Pget_actual_selection_io_mode * - * Purpose: Retrieves actual selection I/O mode + * Purpose: Retrieves actual selection I/O mode * * Return: Non-negative on success/Negative on failure * diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index f55463c77b1..356f85bdf12 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -420,11 +420,10 @@ typedef enum H5D_selection_io_mode_t { } H5D_selection_io_mode_t; //! - /* Actual selection I/O modes for H5Pget_actual_selection_io_mode() property */ -#define H5D_SCALAR_IO 0x1 /* Scalar (or legacy MPIO) I/O was performed */ -#define H5D_VECTOR_IO 0x2 /* Vector I/O was performed */ -#define H5D_SELECTION_IO 0x4 /* Selection I/O was performed */ +#define H5D_SCALAR_IO 0x1 /* Scalar (or legacy MPIO) I/O was performed */ +#define H5D_VECTOR_IO 0x2 /* Vector I/O was performed */ +#define H5D_SELECTION_IO 0x4 /* Selection I/O was performed */ /********************/ /* Public Variables */ @@ -8420,7 +8419,7 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * * \details H5Pget_actual_selection_io_mode() retrieves the type of I/O * that was actually performed. - * This property is set after all I/O is completed; + * This property is set after all I/O is completed; * if I/O fails, it will not be set. * after the actual I/O takes place. * diff --git a/test/select_io_dset.c b/test/select_io_dset.c index 2221985019b..bdaafdf3a7e 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -113,10 +113,9 @@ check_actual_selection_io_mode(hid_t dxpl, uint32_t sel_io_mode_expected) if (H5Pget_actual_selection_io_mode(dxpl, &actual_sel_io_mode) < 0) FAIL_STACK_ERROR; - if(actual_sel_io_mode != sel_io_mode_expected) + if (actual_sel_io_mode != sel_io_mode_expected) TEST_ERROR; - return SUCCEED; error: return FAIL; diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index 782b1c86a30..1ecd9511b2c 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -191,7 +191,7 @@ check_actual_selection_io_mode(hid_t dxpl, uint32_t sel_io_mode_expected) if (H5Pget_actual_selection_io_mode(dxpl, &actual_sel_io_mode) < 0) P_TEST_ERROR; - if(actual_sel_io_mode != sel_io_mode_expected) + if (actual_sel_io_mode != sel_io_mode_expected) P_TEST_ERROR; } @@ -436,7 +436,6 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Dwrite(did, H5T_STD_I32LE, mspace_id, fspace_id, dxpl, wbuf) < 0) P_TEST_ERROR; - /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, (size_t)(4 * DSET_SELECT_DIM)); @@ -3510,10 +3509,8 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) P_TEST_ERROR; - if (test_mode & TEST_DISABLE_BY_API || - test_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET || - ((test_mode & TEST_TCONV_BUF_TOO_SMALL) && - !(test_mode & TEST_IN_PLACE_TCONV))) + if (test_mode & TEST_DISABLE_BY_API || test_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET || + ((test_mode & TEST_TCONV_BUF_TOO_SMALL) && !(test_mode & TEST_IN_PLACE_TCONV))) check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO); else check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); From 98bcb50cf1f3fd0e5a59062bd47d648912c509e2 Mon Sep 17 00:00:00 2001 From: "vchoi-hdfgroup.org" Date: Tue, 2 May 2023 12:32:44 -0500 Subject: [PATCH 03/37] Revert back to the original. --- src/H5Pdxpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 545b333308f..333f5c569b3 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -2771,7 +2771,7 @@ H5Pget_modify_write_buf(hid_t plist_id, hbool_t *modify_write_buf /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, modify_write_buf); + H5TRACE2("e", "i*b", plist_id, modify_write_buf); /* Check arguments */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) From d1ae8930ee73ac5f16117dcbba4d112405f9b15a Mon Sep 17 00:00:00 2001 From: "vchoi-hdfgroup.org" Date: Sun, 14 May 2023 17:11:19 -0500 Subject: [PATCH 04/37] Changes made based on PR review comments. --- src/H5CX.c | 40 +++++++++++++++- src/H5CXprivate.h | 1 + src/H5FDint.c | 75 ++++++++++++++++++++++++++---- src/H5Pdxpl.c | 2 +- test/select_io_dset.c | 94 +++++++++++++++++++++++++++++--------- testpar/t_select_io_dset.c | 6 +-- 6 files changed, 180 insertions(+), 38 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index ff8b1d574dd..1243cdf30b8 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -307,7 +307,8 @@ typedef struct H5CX_t { uint32_t actual_selection_io_mode; /* Actual selection I/O mode used (H5D_ACTUAL_SELECTION_IO_MODE_NAME) */ - hbool_t actual_selection_io_mode_set; /* Whether actual selection I/O mode is set */ + hbool_t actual_selection_io_mode_set; /* Whether actual selection I/O mode is set */ + hbool_t actual_selection_io_mode_valid; /* Whether actual selection I/O mode is valid */ /* Cached LCPL properties */ H5T_cset_t encoding; /* Link name character encoding */ @@ -2668,6 +2669,43 @@ H5CX_get_no_selection_io_cause(uint32_t *no_selection_io_cause) FUNC_LEAVE_NOAPI(ret_value) } /* end H5CX_get_no_selection_io_cause() */ +/*------------------------------------------------------------------------- + * Function: H5CX_get_no_selection_io_cause + * + * Purpose: Retrieves the cause for not performing selection I/O + * for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Vailin Choi + * April 15, 2023 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_actual_selection_io_mode(uint32_t *actual_selection_io_mode) +{ + H5CX_node_t **head = NULL; /* Pointer to head of API context list */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(actual_selection_io_mode); + head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + H5CX_RETRIEVE_PROP_VALID_SET(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, + actual_selection_io_mode) + + /* Get the value */ + *actual_selection_io_mode = (*head)->ctx.actual_selection_io_mode; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_actual_selection_io_mode() */ + /*------------------------------------------------------------------------- * Function: H5CX_get_modify_write_buf * diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h index 665363457fb..885d6a6d7a9 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -117,6 +117,7 @@ H5_DLL herr_t H5CX_get_vlen_alloc_info(H5T_vlen_alloc_info_t *vl_alloc_info); H5_DLL herr_t H5CX_get_dt_conv_cb(H5T_conv_cb_t *cb_struct); H5_DLL herr_t H5CX_get_selection_io_mode(H5D_selection_io_mode_t *selection_io_mode); H5_DLL herr_t H5CX_get_no_selection_io_cause(uint32_t *no_selection_io_cause); +H5_DLL herr_t H5CX_get_actual_selection_io_mode(uint32_t *actual_selection_io_mode); H5_DLL herr_t H5CX_get_modify_write_buf(hbool_t *modify_write_buf); /* "Getter" routines for LCPL properties cached in API context */ diff --git a/src/H5FDint.c b/src/H5FDint.c index eaaa5987dc3..bc23ba2f5d6 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -457,13 +457,16 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs /* if the underlying VFD supports vector read, make the call */ if (file->cls->read_vector) { + uint32_t actual_selection_io_mode; if ((file->cls->read_vector)(file, dxpl_id, count, types, addrs, sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read vector request failed") - /* Set actual selection I/O */ - H5CX_set_actual_selection_io_mode(H5D_VECTOR_IO); + /* Set actual selection I/O mode */ + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_VECTOR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } else { @@ -473,6 +476,7 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs extend_sizes = FALSE; extend_types = FALSE; uint32_t no_selection_io_cause; + uint32_t actual_selection_io_mode; for (i = 0; i < count; i++) { @@ -514,6 +518,11 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs H5CX_get_no_selection_io_cause(&no_selection_io_cause); no_selection_io_cause |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; H5CX_set_no_selection_io_cause(no_selection_io_cause); + + /* Set actual selection I/O mode */ + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SCALAR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } done: @@ -668,12 +677,16 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr /* if the underlying VFD supports vector write, make the call */ if (file->cls->write_vector) { + uint32_t actual_selection_io_mode; + if ((file->cls->write_vector)(file, dxpl_id, count, types, addrs, sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write vector request failed") /* Set actual selection I/O */ - H5CX_set_actual_selection_io_mode(H5D_VECTOR_IO); + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_VECTOR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } else { /* otherwise, implement the vector write as a sequence of regular @@ -682,6 +695,7 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr extend_sizes = FALSE; extend_types = FALSE; uint32_t no_selection_io_cause; + uint32_t actual_selection_io_mode; for (i = 0; i < count; i++) { @@ -723,6 +737,11 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr H5CX_get_no_selection_io_cause(&no_selection_io_cause); no_selection_io_cause |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; H5CX_set_no_selection_io_cause(no_selection_io_cause); + + /* Set actual selection I/O */ + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SCALAR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } done: @@ -1004,21 +1023,31 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin /* Issue vector read call if appropriate */ if (use_vector) { + uint32_t actual_selection_io_mode; + H5_CHECK_OVERFLOW(vec_arr_nused, size_t, uint32_t) if ((file->cls->read_vector)(file, dxpl_id, (uint32_t)vec_arr_nused, types, addrs, sizes, vec_bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read vector request failed") /* Set actual selection I/O */ - H5CX_set_actual_selection_io_mode(H5D_VECTOR_IO); + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_VECTOR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } else { uint32_t no_selection_io_cause; + uint32_t actual_selection_io_mode; /* Add H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB to no selection I/O cause */ H5CX_get_no_selection_io_cause(&no_selection_io_cause); no_selection_io_cause |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; H5CX_set_no_selection_io_cause(no_selection_io_cause); + + /* Set actual selection I/O */ + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SCALAR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } done: @@ -1174,6 +1203,8 @@ 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) { + uint32_t actual_selection_io_mode; + /* Allocate array of space IDs if necessary, otherwise use local * buffers */ if (count > sizeof(mem_space_ids_local) / sizeof(mem_space_ids_local[0])) { @@ -1201,7 +1232,9 @@ H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_s HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read selection request failed") /* Set actual selection I/O */ - H5CX_set_actual_selection_io_mode(H5D_SELECTION_IO); + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SELECTION_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } else /* Otherwise, implement the selection read as a sequence of regular @@ -1341,12 +1374,16 @@ H5FD_read_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_ /* if the underlying VFD supports selection read, make the call */ if (file->cls->read_selection) { + uint32_t actual_selection_io_mode; + if ((file->cls->read_selection)(file, type, dxpl_id, count, mem_space_ids, file_space_ids, offsets, element_sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read selection request failed") /* Set actual selection I/O */ - H5CX_set_actual_selection_io_mode(H5D_SELECTION_IO); + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SELECTION_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } else { /* Otherwise, implement the selection read as a sequence of regular @@ -1660,21 +1697,31 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui /* Issue vector write call if appropriate */ if (use_vector) { + uint32_t actual_selection_io_mode; + H5_CHECK_OVERFLOW(vec_arr_nused, size_t, uint32_t) if ((file->cls->write_vector)(file, dxpl_id, (uint32_t)vec_arr_nused, types, addrs, sizes, vec_bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write vector request failed") /* Set actual selection I/O */ - H5CX_set_actual_selection_io_mode(H5D_VECTOR_IO); + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_VECTOR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } else { uint32_t no_selection_io_cause; + uint32_t actual_selection_io_mode; /* Add H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB to no selection I/O cause */ H5CX_get_no_selection_io_cause(&no_selection_io_cause); no_selection_io_cause |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; H5CX_set_no_selection_io_cause(no_selection_io_cause); + + /* Set actual selection I/O */ + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SCALAR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } done: @@ -1822,6 +1869,8 @@ 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) { + uint32_t actual_selection_io_mode; + /* Allocate array of space IDs if necessary, otherwise use local * buffers */ if (count > sizeof(mem_space_ids_local) / sizeof(mem_space_ids_local[0])) { @@ -1849,7 +1898,9 @@ H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_ HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write selection request failed") /* Set actual selection I/O */ - H5CX_set_actual_selection_io_mode(H5D_SELECTION_IO); + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SELECTION_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } else /* Otherwise, implement the selection write as a sequence of regular @@ -1980,12 +2031,16 @@ H5FD_write_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem /* if the underlying VFD supports selection write, make the call */ if (file->cls->write_selection) { + uint32_t actual_selection_io_mode; + if ((file->cls->write_selection)(file, type, dxpl_id, count, mem_space_ids, file_space_ids, offsets, element_sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write selection request failed") - /* Set actual selection I/O */ - H5CX_set_actual_selection_io_mode(H5D_SELECTION_IO); + /* Set actual selection I/O mode */ + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SELECTION_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } else { /* Otherwise, implement the selection write as a sequence of regular diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 333f5c569b3..b0e7eb79a1f 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -178,7 +178,7 @@ #define H5D_XFER_NO_SELECTION_IO_CAUSE_DEF 0 /* Definitions for actual selection I/O mode property */ #define H5D_XFER_ACTUAL_SELECTION_IO_MODE_SIZE sizeof(uint32_t) -#define H5D_XFER_ACTUAL_SELECTION_IO_MODE_DEF H5D_SCALAR_IO +#define H5D_XFER_ACTUAL_SELECTION_IO_MODE_DEF 0 /* Definitions for modify write buffer property */ #define H5D_XFER_MODIFY_WRITE_BUF_SIZE sizeof(hbool_t) #define H5D_XFER_MODIFY_WRITE_BUF_DEF FALSE diff --git a/test/select_io_dset.c b/test/select_io_dset.c index bdaafdf3a7e..a6501ef6f5b 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -143,6 +143,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) int rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; const char *expr = "2*x"; + uint32_t no_selection_io_cause = 0; /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; @@ -199,8 +200,12 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; + if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) + FAIL_STACK_ERROR; + + if (!no_selection_io_cause) + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; /* Restore wbuf from backup if the library modified it */ if (mwbuf) @@ -210,8 +215,13 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) FAIL_STACK_ERROR; - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; + no_selection_io_cause = 0; + if (H5Pget_no_selection_io_cause(ntrans_dxpl, &no_selection_io_cause) < 0) + FAIL_STACK_ERROR; + + if (!no_selection_io_cause) + if (check_actual_selection_io_mode(ntrans_dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; /* Verify data or transformed data read */ for (i = 0; i < DSET_SELECT_DIM; i++) @@ -288,6 +298,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) char *wbuf_bak = NULL; char *rbuf = NULL; char dset_name[DSET_NAME_LEN]; + uint32_t no_selection_io_cause = 0; if ((wbuf = (char *)HDmalloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) FAIL_STACK_ERROR; @@ -345,8 +356,12 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Dwrite(did, H5T_STD_I32LE, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; + if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) + FAIL_STACK_ERROR; + + if (!no_selection_io_cause) + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; /* Restore wbuf from backup if the library modified it */ if (mwbuf) @@ -356,8 +371,13 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Dread(did, H5T_STD_I32LE, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0) FAIL_STACK_ERROR; - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; + no_selection_io_cause = 0; + if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) + FAIL_STACK_ERROR; + + if (!no_selection_io_cause) + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; /* Verify data read little endian */ for (i = 0; i < DSET_SELECT_DIM; i++) @@ -445,6 +465,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign long long rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; const char *expr = "5 * (10 - x)"; + uint32_t no_selection_io_cause = 0; /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; @@ -501,8 +522,12 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign if (H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; + if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) + FAIL_STACK_ERROR; + + if (!no_selection_io_cause) + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; /* Restore wbuf from backup if the library modified it */ if (mwbuf) @@ -512,8 +537,13 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign if (H5Dread(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) FAIL_STACK_ERROR; - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; + no_selection_io_cause = 0; + if (H5Pget_no_selection_io_cause(ntrans_dxpl, &no_selection_io_cause) < 0) + FAIL_STACK_ERROR; + + if (!no_selection_io_cause) + if (check_actual_selection_io_mode(ntrans_dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; /* Verify data or transformed data read */ for (i = 0; i < DSET_SELECT_DIM; i++) @@ -593,6 +623,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig short rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; const char *expr = "2 * (10 + x)"; + uint32_t no_selection_io_cause = 0; /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; @@ -650,8 +681,12 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig if (H5Dwrite(did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; + if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) + FAIL_STACK_ERROR; + + if (!no_selection_io_cause) + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; /* Restore wbuf from backup if the library modified it */ if (mwbuf) @@ -661,8 +696,13 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig if (H5Dread(did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) FAIL_STACK_ERROR; - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; + no_selection_io_cause = 0; + if (H5Pget_no_selection_io_cause(ntrans_dxpl, &no_selection_io_cause) < 0) + FAIL_STACK_ERROR; + + if (!no_selection_io_cause) + if (check_actual_selection_io_mode(ntrans_dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; /* Verify data or transformed data read */ for (i = 0; i < DSET_SELECT_DIM; i++) @@ -1099,6 +1139,7 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m const void *wbufs[MULTI_NUM_DSETS]; void *rbufs[MULTI_NUM_DSETS]; const char *expr = "2*x"; + uint32_t no_selection_io_cause; ndsets = MAX(MULTI_MIN_DSETS, MULTI_NUM_DSETS); @@ -1210,6 +1251,13 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m if (mwbuf) HDmemcpy(total_wbuf, total_wbuf_bak, ndsets * DSET_SELECT_DIM * sizeof(int)); + if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) + FAIL_STACK_ERROR; + + if (!no_selection_io_cause) + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Read data from the dataset (if dtrans, without data transform set in dxpl) */ if (H5Dread_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, ntrans_dxpl, rbufs) < 0) TEST_ERROR; @@ -1230,6 +1278,14 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m if (H5Dread_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, dxpl, rbufs) < 0) TEST_ERROR; + no_selection_io_cause = 0; + if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) + FAIL_STACK_ERROR; + + if (!no_selection_io_cause) + if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Verify */ for (i = 0; i < (int)ndsets; i++) for (j = 0; j < DSET_SELECT_DIM; j++) @@ -3037,9 +3093,6 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ FAIL_STACK_ERROR; } - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; - if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause_write) < 0) TEST_ERROR; @@ -3058,9 +3111,6 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ if (H5Dread(did, tid, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0) FAIL_STACK_ERROR; - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; - /* Verify causes of no selection I/O for write is as expected */ if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause_read) < 0) TEST_ERROR; diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index 1ecd9511b2c..6abb171d57e 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -3509,10 +3509,8 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) P_TEST_ERROR; - if (test_mode & TEST_DISABLE_BY_API || test_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET || - ((test_mode & TEST_TCONV_BUF_TOO_SMALL) && !(test_mode & TEST_IN_PLACE_TCONV))) - check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO); - else + if (!(test_mode & TEST_DISABLE_BY_API || test_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET || + ((test_mode & TEST_TCONV_BUF_TOO_SMALL) && !(test_mode & TEST_IN_PLACE_TCONV)))) check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause_write) < 0) From bf232676023bc0872a713bd2330b8b65bc63e729 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 14 May 2023 22:14:08 +0000 Subject: [PATCH 05/37] Committing clang-format changes --- test/select_io_dset.c | 32 ++++++++++++++++---------------- testpar/t_select_io_dset.c | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/test/select_io_dset.c b/test/select_io_dset.c index a6501ef6f5b..6e826ee2461 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -142,8 +142,8 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) int trans_wbuf[DSET_SELECT_DIM]; int rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; - const char *expr = "2*x"; - uint32_t no_selection_io_cause = 0; + const char *expr = "2*x"; + uint32_t no_selection_io_cause = 0; /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; @@ -287,17 +287,17 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) static herr_t test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) { - int i; - hid_t did = H5I_INVALID_HID; - hid_t sid = H5I_INVALID_HID; - hid_t dcpl = H5I_INVALID_HID; - hid_t dxpl = H5I_INVALID_HID; - hsize_t dims[1]; - hsize_t cdims[1]; - char *wbuf = NULL; - char *wbuf_bak = NULL; - char *rbuf = NULL; - char dset_name[DSET_NAME_LEN]; + int i; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t dxpl = H5I_INVALID_HID; + hsize_t dims[1]; + hsize_t cdims[1]; + char *wbuf = NULL; + char *wbuf_bak = NULL; + char *rbuf = NULL; + char dset_name[DSET_NAME_LEN]; uint32_t no_selection_io_cause = 0; if ((wbuf = (char *)HDmalloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) @@ -374,7 +374,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) no_selection_io_cause = 0; if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) FAIL_STACK_ERROR; - + if (!no_selection_io_cause) if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) TEST_ERROR; @@ -464,7 +464,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign long trans_wbuf[DSET_SELECT_DIM]; long long rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; - const char *expr = "5 * (10 - x)"; + const char *expr = "5 * (10 - x)"; uint32_t no_selection_io_cause = 0; /* Create 1d data space */ @@ -622,7 +622,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig short trans_wbuf[DSET_SELECT_DIM]; short rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; - const char *expr = "2 * (10 + x)"; + const char *expr = "2 * (10 + x)"; uint32_t no_selection_io_cause = 0; /* Create 1d data space */ diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index 6abb171d57e..cda56206247 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -3510,7 +3510,7 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ P_TEST_ERROR; if (!(test_mode & TEST_DISABLE_BY_API || test_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET || - ((test_mode & TEST_TCONV_BUF_TOO_SMALL) && !(test_mode & TEST_IN_PLACE_TCONV)))) + ((test_mode & TEST_TCONV_BUF_TOO_SMALL) && !(test_mode & TEST_IN_PLACE_TCONV)))) check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause_write) < 0) From 0f32c8cce7e8be1b3981d72e84ba7aeb4b773701 Mon Sep 17 00:00:00 2001 From: "vchoi-hdfgroup.org" Date: Tue, 16 May 2023 12:25:57 -0500 Subject: [PATCH 06/37] Changes made based on review comments. --- src/H5Pdxpl.c | 2 +- src/H5Ppublic.h | 9 +++--- test/select_io_dset.c | 75 ------------------------------------------- 3 files changed, 5 insertions(+), 81 deletions(-) diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index b0e7eb79a1f..fd63a66034a 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -478,7 +478,7 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the actual selection I/O mode property */ - /* (Note: this property should not have an encode/decode callback -QAK) */ + /* (Note: this property should not have an encode/decode callback) */ if (H5P__register_real(pclass, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, H5D_XFER_ACTUAL_SELECTION_IO_MODE_SIZE, &H5D_def_actual_selection_io_mode_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 356f85bdf12..d3087be4a27 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -8402,12 +8402,12 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio /** * \ingroup DXPL * - * \brief Retrieves the type of I/O that HDF5 actually performed on + * \brief Retrieves the type(s) of I/O that HDF5 actually performed on * last I/O call (not necessarily the type requested) * * \dxpl_id{plist_id} * \param[out] actual_selection_io_mode A bitwise set value indicating the - * type of I/O performed + * type(s) of I/O performed * \return \herr_t * * \par Motivation: @@ -8417,11 +8417,10 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * I/O. However, there are conditions that can cause HDF5 to forgo * selection or vector I/O and perform legacy (scalar) I/O instead. * - * \details H5Pget_actual_selection_io_mode() retrieves the type of I/O - * that was actually performed. + * \details H5Pget_actual_selection_io_mode() allows the user to determine which + * type or types of I/O were actually performed. * This property is set after all I/O is completed; * if I/O fails, it will not be set. - * after the actual I/O takes place. * * Valid values returned in \p actual_selection_io_mode are listed * as follows. diff --git a/test/select_io_dset.c b/test/select_io_dset.c index 6e826ee2461..a680d32675c 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -200,13 +200,6 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; - if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) - FAIL_STACK_ERROR; - - if (!no_selection_io_cause) - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; - /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, sizeof(wbuf)); @@ -215,14 +208,6 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) FAIL_STACK_ERROR; - no_selection_io_cause = 0; - if (H5Pget_no_selection_io_cause(ntrans_dxpl, &no_selection_io_cause) < 0) - FAIL_STACK_ERROR; - - if (!no_selection_io_cause) - if (check_actual_selection_io_mode(ntrans_dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; - /* Verify data or transformed data read */ for (i = 0; i < DSET_SELECT_DIM; i++) if (rbuf[i] != (dtrans ? trans_wbuf[i] : wbuf[i])) { @@ -356,13 +341,6 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Dwrite(did, H5T_STD_I32LE, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; - if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) - FAIL_STACK_ERROR; - - if (!no_selection_io_cause) - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; - /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, (size_t)(4 * DSET_SELECT_DIM)); @@ -371,14 +349,6 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Dread(did, H5T_STD_I32LE, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0) FAIL_STACK_ERROR; - no_selection_io_cause = 0; - if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) - FAIL_STACK_ERROR; - - if (!no_selection_io_cause) - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; - /* Verify data read little endian */ for (i = 0; i < DSET_SELECT_DIM; i++) if (rbuf[4 * i + 0] != wbuf[4 * i + 0] || rbuf[4 * i + 1] != wbuf[4 * i + 1] || @@ -522,13 +492,6 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign if (H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; - if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) - FAIL_STACK_ERROR; - - if (!no_selection_io_cause) - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; - /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, sizeof(wbuf)); @@ -537,14 +500,6 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign if (H5Dread(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) FAIL_STACK_ERROR; - no_selection_io_cause = 0; - if (H5Pget_no_selection_io_cause(ntrans_dxpl, &no_selection_io_cause) < 0) - FAIL_STACK_ERROR; - - if (!no_selection_io_cause) - if (check_actual_selection_io_mode(ntrans_dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; - /* Verify data or transformed data read */ for (i = 0; i < DSET_SELECT_DIM; i++) if (rbuf[i] != (long long)(dtrans ? trans_wbuf[i] : wbuf[i])) { @@ -681,13 +636,6 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig if (H5Dwrite(did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; - if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) - FAIL_STACK_ERROR; - - if (!no_selection_io_cause) - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; - /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, sizeof(wbuf)); @@ -696,14 +644,6 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig if (H5Dread(did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) FAIL_STACK_ERROR; - no_selection_io_cause = 0; - if (H5Pget_no_selection_io_cause(ntrans_dxpl, &no_selection_io_cause) < 0) - FAIL_STACK_ERROR; - - if (!no_selection_io_cause) - if (check_actual_selection_io_mode(ntrans_dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; - /* Verify data or transformed data read */ for (i = 0; i < DSET_SELECT_DIM; i++) if (rbuf[i] != (dtrans ? trans_wbuf[i] : wbuf[i])) { @@ -1251,13 +1191,6 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m if (mwbuf) HDmemcpy(total_wbuf, total_wbuf_bak, ndsets * DSET_SELECT_DIM * sizeof(int)); - if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) - FAIL_STACK_ERROR; - - if (!no_selection_io_cause) - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; - /* Read data from the dataset (if dtrans, without data transform set in dxpl) */ if (H5Dread_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, ntrans_dxpl, rbufs) < 0) TEST_ERROR; @@ -1278,14 +1211,6 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m if (H5Dread_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, dxpl, rbufs) < 0) TEST_ERROR; - no_selection_io_cause = 0; - if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause) < 0) - FAIL_STACK_ERROR; - - if (!no_selection_io_cause) - if (check_actual_selection_io_mode(dxpl, H5D_SCALAR_IO) < 0) - TEST_ERROR; - /* Verify */ for (i = 0; i < (int)ndsets; i++) for (j = 0; j < DSET_SELECT_DIM; j++) From 4dd09014ba0ec1b7d94170690888b01354da5d23 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 17:31:11 +0000 Subject: [PATCH 07/37] Committing clang-format changes --- src/H5Ppublic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index d3087be4a27..44c2a57106d 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -8417,7 +8417,7 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * I/O. However, there are conditions that can cause HDF5 to forgo * selection or vector I/O and perform legacy (scalar) I/O instead. * - * \details H5Pget_actual_selection_io_mode() allows the user to determine which + * \details H5Pget_actual_selection_io_mode() allows the user to determine which * type or types of I/O were actually performed. * This property is set after all I/O is completed; * if I/O fails, it will not be set. From 2f352f41f7f16174b0e6645e287f1191f4716e7d Mon Sep 17 00:00:00 2001 From: "vchoi-hdfgroup.org" Date: Wed, 17 May 2023 11:32:24 -0500 Subject: [PATCH 08/37] Changes to doxygen for H5Pget_actual_selection_io(). --- src/H5Ppublic.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 44c2a57106d..85578dddd44 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -8416,11 +8416,16 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * type conversion, or with custom VFDs that support vector or selection * I/O. However, there are conditions that can cause HDF5 to forgo * selection or vector I/O and perform legacy (scalar) I/O instead. + * This function allows the user to determine which type or types of + * I/O were actually performed. * - * \details H5Pget_actual_selection_io_mode() allows the user to determine which - * type or types of I/O were actually performed. - * This property is set after all I/O is completed; - * if I/O fails, it will not be set. + * \details H5Pget_actual_selection_io_mode() allows the user to determine which + * type(s) of I/O were actually performed during the last I/O operation + * which used \p plist_id. This property is set after all I/O is + * completed; if I/O fails, it will not be set. + * + * H5Pget_no_selection_io_cause() can be used to determine the reason + * why selection or vector I/O was not performed. * * Valid values returned in \p actual_selection_io_mode are listed * as follows. @@ -8432,6 +8437,13 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * - #H5D_SELECTION_IO * Selection I/O was performed * + * Be aware that this function will include the types of all I/O that + * were performed during this operation, including any metadata + * operations that may be incidental to the requested I/O. To make sure + * this function is only capturing raw data I/O, one can temporarily + * disable metadata cache evictions by calling H5Fset_mdc_config() with + * evictions_enabled set to false. + * * \since 1.14.2 * */ From e18e1c360ee5693af55a44c35f5d6e5a5ea03cae Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 17 May 2023 16:41:01 +0000 Subject: [PATCH 09/37] Committing clang-format changes --- src/H5Ppublic.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 85578dddd44..d281070e199 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -8416,12 +8416,12 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * type conversion, or with custom VFDs that support vector or selection * I/O. However, there are conditions that can cause HDF5 to forgo * selection or vector I/O and perform legacy (scalar) I/O instead. - * This function allows the user to determine which type or types of + * This function allows the user to determine which type or types of * I/O were actually performed. * - * \details H5Pget_actual_selection_io_mode() allows the user to determine which + * \details H5Pget_actual_selection_io_mode() allows the user to determine which * type(s) of I/O were actually performed during the last I/O operation - * which used \p plist_id. This property is set after all I/O is + * which used \p plist_id. This property is set after all I/O is * completed; if I/O fails, it will not be set. * * H5Pget_no_selection_io_cause() can be used to determine the reason From cea5cf1b795ca14d05f895c841ebd51d2e19ce89 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Fri, 9 Jun 2023 15:17:17 -0500 Subject: [PATCH 10/37] Modify H5Pget_actual_selection_io_mode to only count raw data --- src/H5FDint.c | 154 +++++++++++++++++++++++++++++------------- src/H5Pdxpl.c | 2 +- src/H5Ppublic.h | 22 +++--- test/select_io_dset.c | 49 ++++++++++++-- 4 files changed, 162 insertions(+), 65 deletions(-) diff --git a/src/H5FDint.c b/src/H5FDint.c index bc23ba2f5d6..a40be49e88d 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -210,6 +210,7 @@ herr_t H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, void *buf /*out*/) { hid_t dxpl_id = H5I_INVALID_HID; /* DXPL for operation */ + uint32_t actual_selection_io_mode; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -254,6 +255,13 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, void *buf /* if ((file->cls->read)(file, type, dxpl_id, addr + file->base_addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed") + /* Set actual selection I/O, if this is a raw data operation */ + if (type == H5FD_MEM_DRAW) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SCALAR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_read() */ @@ -272,6 +280,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, const void { hid_t dxpl_id; /* DXPL for operation */ haddr_t eoa = HADDR_UNDEF; /* EOA for file */ + uint32_t actual_selection_io_mode; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -305,6 +314,13 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, const void if ((file->cls->write)(file, type, dxpl_id, addr + file->base_addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed") + /* Set actual selection I/O, if this is a raw data operation */ + if (type == H5FD_MEM_DRAW) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SCALAR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_write() */ @@ -359,6 +375,7 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs size_t size; H5FD_mem_t type; hid_t dxpl_id = H5I_INVALID_HID; /* DXPL for operation */ + hbool_t is_raw = FALSE; /* Does this include raw data */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -440,6 +457,10 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs else { type = types[i]; + + /* Check for raw data operation */ + if (type == H5FD_MEM_DRAW) + is_raw = TRUE; } } @@ -454,6 +475,13 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs (unsigned long long)eoa) } } + else + /* We must still check if this is a raw data read */ + for (i = 0; i < count && types[i] != H5FD_MEM_NOLIST; i++) + if (types[i] == H5FD_MEM_DRAW) { + is_raw = TRUE; + break; + } /* if the underlying VFD supports vector read, make the call */ if (file->cls->read_vector) { @@ -463,10 +491,12 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read vector request failed") - /* Set actual selection I/O mode */ - H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); - actual_selection_io_mode |= H5D_VECTOR_IO; - H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + /* Set actual selection I/O mode, if this is a raw data operation */ + if (is_raw) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_VECTOR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } } else { @@ -519,10 +549,12 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs no_selection_io_cause |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; H5CX_set_no_selection_io_cause(no_selection_io_cause); - /* Set actual selection I/O mode */ - H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); - actual_selection_io_mode |= H5D_SCALAR_IO; - H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + /* Set actual selection I/O mode, if this is a raw data operation */ + if (is_raw) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SCALAR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } } done: @@ -588,6 +620,7 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr H5FD_mem_t type; hid_t dxpl_id; /* DXPL for operation */ haddr_t eoa = HADDR_UNDEF; /* EOA for file */ + hbool_t is_raw = FALSE; /* Does this include raw data */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -659,7 +692,12 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr else { type = types[i]; + + /* Check for raw data operation */ + if (type == H5FD_MEM_DRAW) + is_raw = TRUE; } + } if (HADDR_UNDEF == (eoa = (file->cls->get_eoa)(file, type))) @@ -683,10 +721,12 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write vector request failed") - /* Set actual selection I/O */ - H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); - actual_selection_io_mode |= H5D_VECTOR_IO; - H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + /* Set actual selection I/O mode, if this is a raw data operation */ + if (is_raw) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_VECTOR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } } else { /* otherwise, implement the vector write as a sequence of regular @@ -738,10 +778,12 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr no_selection_io_cause |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; H5CX_set_no_selection_io_cause(no_selection_io_cause); - /* Set actual selection I/O */ - H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); - actual_selection_io_mode |= H5D_SCALAR_IO; - H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + /* Set actual selection I/O mode, if this is a raw data operation */ + if (is_raw) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SCALAR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } } done: @@ -1030,10 +1072,12 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read vector request failed") - /* Set actual selection I/O */ - H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); - actual_selection_io_mode |= H5D_VECTOR_IO; - H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + /* Set actual selection I/O, if this is a raw data operation */ + if (type == H5FD_MEM_DRAW) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_VECTOR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } } else { uint32_t no_selection_io_cause; @@ -1044,10 +1088,12 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin no_selection_io_cause |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; H5CX_set_no_selection_io_cause(no_selection_io_cause); - /* Set actual selection I/O */ - H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); - actual_selection_io_mode |= H5D_SCALAR_IO; - H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + /* Set actual selection I/O, if this is a raw data operation */ + if (type == H5FD_MEM_DRAW) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SCALAR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } } done: @@ -1231,10 +1277,12 @@ H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_s element_sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read selection request failed") - /* Set actual selection I/O */ - H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); - actual_selection_io_mode |= H5D_SELECTION_IO; - H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + /* Set actual selection I/O, if this is a raw data operation */ + if (type == H5FD_MEM_DRAW) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SELECTION_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } } else /* Otherwise, implement the selection read as a sequence of regular @@ -1380,10 +1428,12 @@ H5FD_read_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_ element_sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read selection request failed") - /* Set actual selection I/O */ - H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); - actual_selection_io_mode |= H5D_SELECTION_IO; - H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + /* Set actual selection I/O, if this is a raw data operation */ + if (type == H5FD_MEM_DRAW) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SELECTION_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } } else { /* Otherwise, implement the selection read as a sequence of regular @@ -1704,10 +1754,12 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write vector request failed") - /* Set actual selection I/O */ - H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); - actual_selection_io_mode |= H5D_VECTOR_IO; - H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + /* Set actual selection I/O, if this is a raw data operation */ + if (type == H5FD_MEM_DRAW) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_VECTOR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } } else { uint32_t no_selection_io_cause; @@ -1718,10 +1770,12 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui no_selection_io_cause |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; H5CX_set_no_selection_io_cause(no_selection_io_cause); - /* Set actual selection I/O */ - H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); - actual_selection_io_mode |= H5D_SCALAR_IO; - H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + /* Set actual selection I/O, if this is a raw data operation */ + if (type == H5FD_MEM_DRAW) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SCALAR_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } } done: @@ -1897,10 +1951,12 @@ H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_ element_sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write selection request failed") - /* Set actual selection I/O */ - H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); - actual_selection_io_mode |= H5D_SELECTION_IO; - H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + /* Set actual selection I/O, if this is a raw data operation */ + if (type == H5FD_MEM_DRAW) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SELECTION_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } } else /* Otherwise, implement the selection write as a sequence of regular @@ -2037,10 +2093,12 @@ H5FD_write_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem element_sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write selection request failed") - /* Set actual selection I/O mode */ - H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); - actual_selection_io_mode |= H5D_SELECTION_IO; - H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + /* Set actual selection I/O, if this is a raw data operation */ + if (type == H5FD_MEM_DRAW) { + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); + actual_selection_io_mode |= H5D_SELECTION_IO; + H5CX_set_actual_selection_io_mode(actual_selection_io_mode); + } } else { /* Otherwise, implement the selection write as a sequence of regular diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index fd63a66034a..43c86158b53 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -2771,7 +2771,7 @@ H5Pget_modify_write_buf(hid_t plist_id, hbool_t *modify_write_buf /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", plist_id, modify_write_buf); + H5TRACE2("e", "ix", plist_id, modify_write_buf); /* Check arguments */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index d281070e199..2e003211c82 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -8402,8 +8402,8 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio /** * \ingroup DXPL * - * \brief Retrieves the type(s) of I/O that HDF5 actually performed on - * last I/O call (not necessarily the type requested) + * \brief Retrieves the type(s) of I/O that HDF5 actually performed on raw data + * during the last I/O call * * \dxpl_id{plist_id} * \param[out] actual_selection_io_mode A bitwise set value indicating the @@ -8420,9 +8420,9 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * I/O were actually performed. * * \details H5Pget_actual_selection_io_mode() allows the user to determine which - * type(s) of I/O were actually performed during the last I/O operation - * which used \p plist_id. This property is set after all I/O is - * completed; if I/O fails, it will not be set. + * type(s) of I/O were actually performed on raw data during the last + * I/O operation which used \p plist_id. This property is set after + * all I/O is completed; if I/O fails, it will not be set. * * H5Pget_no_selection_io_cause() can be used to determine the reason * why selection or vector I/O was not performed. @@ -8437,12 +8437,12 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * - #H5D_SELECTION_IO * Selection I/O was performed * - * Be aware that this function will include the types of all I/O that - * were performed during this operation, including any metadata - * operations that may be incidental to the requested I/O. To make sure - * this function is only capturing raw data I/O, one can temporarily - * disable metadata cache evictions by calling H5Fset_mdc_config() with - * evictions_enabled set to false. + * Be aware that this function will only include raw data I/O performed + * as part of the last I/O operation. Any metadata flushes, including + * attribute and compact dataset I/O, is disregarded. It is also + * possible that data was cached in the dataset chunk cache or sieve + * buffer, which may prevent I/O from hitting the disk, and thereby + * prevent it from being counted by this functon. * * \since 1.14.2 * diff --git a/test/select_io_dset.c b/test/select_io_dset.c index a680d32675c..a548027a522 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -143,7 +143,6 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) int rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; const char *expr = "2*x"; - uint32_t no_selection_io_cause = 0; /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; @@ -200,6 +199,10 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; + /* Verify selection I/O mode */ + if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, sizeof(wbuf)); @@ -208,6 +211,10 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) FAIL_STACK_ERROR; + /* Verify selection I/O mode */ + if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Verify data or transformed data read */ for (i = 0; i < DSET_SELECT_DIM; i++) if (rbuf[i] != (dtrans ? trans_wbuf[i] : wbuf[i])) { @@ -283,7 +290,6 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) char *wbuf_bak = NULL; char *rbuf = NULL; char dset_name[DSET_NAME_LEN]; - uint32_t no_selection_io_cause = 0; if ((wbuf = (char *)HDmalloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) FAIL_STACK_ERROR; @@ -341,6 +347,10 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Dwrite(did, H5T_STD_I32LE, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; + /* Verify selection I/O mode */ + if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, (size_t)(4 * DSET_SELECT_DIM)); @@ -349,6 +359,10 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Dread(did, H5T_STD_I32LE, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0) FAIL_STACK_ERROR; + /* Verify selection I/O mode */ + if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Verify data read little endian */ for (i = 0; i < DSET_SELECT_DIM; i++) if (rbuf[4 * i + 0] != wbuf[4 * i + 0] || rbuf[4 * i + 1] != wbuf[4 * i + 1] || @@ -435,7 +449,6 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign long long rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; const char *expr = "5 * (10 - x)"; - uint32_t no_selection_io_cause = 0; /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; @@ -492,6 +505,10 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign if (H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; + /* Verify selection I/O mode */ + if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, sizeof(wbuf)); @@ -500,6 +517,10 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign if (H5Dread(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) FAIL_STACK_ERROR; + /* Verify selection I/O mode */ + if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Verify data or transformed data read */ for (i = 0; i < DSET_SELECT_DIM; i++) if (rbuf[i] != (long long)(dtrans ? trans_wbuf[i] : wbuf[i])) { @@ -578,7 +599,6 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig short rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; const char *expr = "2 * (10 + x)"; - uint32_t no_selection_io_cause = 0; /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; @@ -636,6 +656,10 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig if (H5Dwrite(did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) FAIL_STACK_ERROR; + /* Verify selection I/O mode */ + if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(wbuf, wbuf_bak, sizeof(wbuf)); @@ -644,6 +668,10 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig if (H5Dread(did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) FAIL_STACK_ERROR; + /* Verify selection I/O mode */ + if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Verify data or transformed data read */ for (i = 0; i < DSET_SELECT_DIM; i++) if (rbuf[i] != (dtrans ? trans_wbuf[i] : wbuf[i])) { @@ -1079,7 +1107,6 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m const void *wbufs[MULTI_NUM_DSETS]; void *rbufs[MULTI_NUM_DSETS]; const char *expr = "2*x"; - uint32_t no_selection_io_cause; ndsets = MAX(MULTI_MIN_DSETS, MULTI_NUM_DSETS); @@ -1187,6 +1214,10 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m if (H5Dwrite_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, dxpl, wbufs) < 0) TEST_ERROR; + /* Verify selection I/O mode */ + if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Restore wbuf from backup if the library modified it */ if (mwbuf) HDmemcpy(total_wbuf, total_wbuf_bak, ndsets * DSET_SELECT_DIM * sizeof(int)); @@ -1195,6 +1226,10 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m if (H5Dread_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, ntrans_dxpl, rbufs) < 0) TEST_ERROR; + /* Verify selection I/O mode */ + if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Verify */ for (i = 0; i < (int)ndsets; i++) for (j = 0; j < DSET_SELECT_DIM; j++) @@ -1211,6 +1246,10 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m if (H5Dread_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, dxpl, rbufs) < 0) TEST_ERROR; + /* Verify selection I/O mode */ + if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + TEST_ERROR; + /* Verify */ for (i = 0; i < (int)ndsets; i++) for (j = 0; j < DSET_SELECT_DIM; j++) From a99afc06734aeddc581746368375cca109e566bb Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 20:20:15 +0000 Subject: [PATCH 11/37] Committing clang-format changes --- src/H5FDint.c | 15 +++++++-------- test/select_io_dset.c | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/H5FDint.c b/src/H5FDint.c index a40be49e88d..678740f3e19 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -209,9 +209,9 @@ H5FD_locate_signature(H5FD_t *file, haddr_t *sig_addr) herr_t H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, void *buf /*out*/) { - hid_t dxpl_id = H5I_INVALID_HID; /* DXPL for operation */ + hid_t dxpl_id = H5I_INVALID_HID; /* DXPL for operation */ uint32_t actual_selection_io_mode; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -278,10 +278,10 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, void *buf /* herr_t H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf) { - hid_t dxpl_id; /* DXPL for operation */ - haddr_t eoa = HADDR_UNDEF; /* EOA for file */ + hid_t dxpl_id; /* DXPL for operation */ + haddr_t eoa = HADDR_UNDEF; /* EOA for file */ uint32_t actual_selection_io_mode; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -375,7 +375,7 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs size_t size; H5FD_mem_t type; hid_t dxpl_id = H5I_INVALID_HID; /* DXPL for operation */ - hbool_t is_raw = FALSE; /* Does this include raw data */ + hbool_t is_raw = FALSE; /* Does this include raw data */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -620,7 +620,7 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr H5FD_mem_t type; hid_t dxpl_id; /* DXPL for operation */ haddr_t eoa = HADDR_UNDEF; /* EOA for file */ - hbool_t is_raw = FALSE; /* Does this include raw data */ + hbool_t is_raw = FALSE; /* Does this include raw data */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -697,7 +697,6 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr if (type == H5FD_MEM_DRAW) is_raw = TRUE; } - } if (HADDR_UNDEF == (eoa = (file->cls->get_eoa)(file, type))) diff --git a/test/select_io_dset.c b/test/select_io_dset.c index a548027a522..192e24ea736 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -142,7 +142,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) int trans_wbuf[DSET_SELECT_DIM]; int rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; - const char *expr = "2*x"; + const char *expr = "2*x"; /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; @@ -279,17 +279,17 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) static herr_t test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) { - int i; - hid_t did = H5I_INVALID_HID; - hid_t sid = H5I_INVALID_HID; - hid_t dcpl = H5I_INVALID_HID; - hid_t dxpl = H5I_INVALID_HID; - hsize_t dims[1]; - hsize_t cdims[1]; - char *wbuf = NULL; - char *wbuf_bak = NULL; - char *rbuf = NULL; - char dset_name[DSET_NAME_LEN]; + int i; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t dxpl = H5I_INVALID_HID; + hsize_t dims[1]; + hsize_t cdims[1]; + char *wbuf = NULL; + char *wbuf_bak = NULL; + char *rbuf = NULL; + char dset_name[DSET_NAME_LEN]; if ((wbuf = (char *)HDmalloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) FAIL_STACK_ERROR; @@ -448,7 +448,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign long trans_wbuf[DSET_SELECT_DIM]; long long rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; - const char *expr = "5 * (10 - x)"; + const char *expr = "5 * (10 - x)"; /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; @@ -598,7 +598,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig short trans_wbuf[DSET_SELECT_DIM]; short rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; - const char *expr = "2 * (10 + x)"; + const char *expr = "2 * (10 + x)"; /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; From fc0fe26b57c2a893ede436e067228e69ff8d5ade Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Fri, 9 Jun 2023 15:22:17 -0500 Subject: [PATCH 12/37] Fix spelling --- src/H5Ppublic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 2e003211c82..082fc4455e0 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -8442,7 +8442,7 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * attribute and compact dataset I/O, is disregarded. It is also * possible that data was cached in the dataset chunk cache or sieve * buffer, which may prevent I/O from hitting the disk, and thereby - * prevent it from being counted by this functon. + * prevent it from being counted by this function. * * \since 1.14.2 * From fc83b1e3c105b82af63cdb444302d3af3780e072 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 19:37:56 +0000 Subject: [PATCH 13/37] Committing clang-format changes --- src/H5Pdxpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 374d0b50586..64208ea0d0f 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -299,7 +299,7 @@ static const H5S_t *H5D_def_dset_io_sel_g = static const H5D_selection_io_mode_t H5D_def_selection_io_mode_g = H5D_XFER_SELECTION_IO_MODE_DEF; static const uint32_t H5D_def_no_selection_io_cause_g = H5D_XFER_NO_SELECTION_IO_CAUSE_DEF; static const uint32_t H5D_def_actual_selection_io_mode_g = H5D_XFER_ACTUAL_SELECTION_IO_MODE_DEF; -static const bool H5D_def_modify_write_buf_g = H5D_XFER_MODIFY_WRITE_BUF_DEF; +static const bool H5D_def_modify_write_buf_g = H5D_XFER_MODIFY_WRITE_BUF_DEF; /*------------------------------------------------------------------------- * Function: H5P__dxfr_reg_prop From 648991edd5424181fbad9aa807e3463e83b2b165 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Tue, 12 Sep 2023 14:50:17 -0500 Subject: [PATCH 14/37] Fix compile failures from latest merge --- src/H5CX.c | 12 ++++++------ src/H5FDint.c | 4 ++-- src/H5Pdxpl.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index d290f381fc1..ae0cd252d0a 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -588,7 +588,7 @@ H5CX_init(void) /* Get the actual selection I/O mode */ if (H5P_get(dx_plist, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, &H5CX_def_dxpl_cache.actual_selection_io_mode) < 0) - HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve actual selection I/O mode") + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve actual selection I/O mode"); /* Get the modify write buffer property */ if (H5P_get(dx_plist, H5D_XFER_MODIFY_WRITE_BUF_NAME, &H5CX_def_dxpl_cache.modify_write_buf) < 0) @@ -2543,10 +2543,10 @@ H5CX_get_actual_selection_io_mode(uint32_t *actual_selection_io_mode) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(actual_selection_io_mode); + assert(actual_selection_io_mode); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID_SET(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, actual_selection_io_mode) @@ -3540,8 +3540,8 @@ H5CX_set_actual_selection_io_mode(uint32_t actual_selection_io_mode) /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert((*head)->ctx.dxpl_id != H5P_DEFAULT); + assert(head && *head); + assert((*head)->ctx.dxpl_id != H5P_DEFAULT); /* If we're using the default DXPL, don't modify it */ if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT) { diff --git a/src/H5FDint.c b/src/H5FDint.c index 85002c1a54c..8f4d5ff5df9 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -1062,7 +1062,7 @@ H5FD__read_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_t if (use_vector) { uint32_t actual_selection_io_mode; - H5_CHECK_OVERFLOW(vec_arr_nused, size_t, uint32_t) + H5_CHECK_OVERFLOW(vec_arr_nused, size_t, uint32_t); if ((file->cls->read_vector)(file, dxpl_id, (uint32_t)vec_arr_nused, types, addrs, sizes, vec_bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read vector request failed"); @@ -1754,7 +1754,7 @@ H5FD__write_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_ if (use_vector) { uint32_t actual_selection_io_mode; - H5_CHECK_OVERFLOW(vec_arr_nused, size_t, uint32_t) + H5_CHECK_OVERFLOW(vec_arr_nused, size_t, uint32_t); if ((file->cls->write_vector)(file, dxpl_id, (uint32_t)vec_arr_nused, types, addrs, sizes, vec_bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write vector request failed"); diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 374d0b50586..54294b267d4 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -479,7 +479,7 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) if (H5P__register_real(pclass, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, H5D_XFER_ACTUAL_SELECTION_IO_MODE_SIZE, &H5D_def_actual_selection_io_mode_g, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class"); /* Register the modify write buffer property */ if (H5P__register_real(pclass, H5D_XFER_MODIFY_WRITE_BUF_NAME, H5D_XFER_MODIFY_WRITE_BUF_SIZE, @@ -2489,12 +2489,12 @@ H5Pget_actual_selection_io_mode(hid_t plist_id, uint32_t *actual_selection_io_mo /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID") + HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID"); /* Return values */ if (actual_selection_io_mode) if (H5P_get(plist, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, actual_selection_io_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get actual_selection_io_mode value") + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get actual_selection_io_mode value"); done: FUNC_LEAVE_API(ret_value) From e0af25df101e61a435ee632c0a274e2ec1965a3d Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Tue, 12 Sep 2023 15:01:57 -0500 Subject: [PATCH 15/37] Address minor review comments. --- src/H5CX.c | 10 +- test/select_io_dset.c | 500 +++++++++++++++++++++--------------------- 2 files changed, 252 insertions(+), 258 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index ae0cd252d0a..b2b51bcf457 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -2522,16 +2522,13 @@ H5CX_get_no_selection_io_cause(uint32_t *no_selection_io_cause) } /* end H5CX_get_no_selection_io_cause() */ /*------------------------------------------------------------------------- - * Function: H5CX_get_no_selection_io_cause + * Function: H5CX_get_actual_selection_io_mode * * Purpose: Retrieves the cause for not performing selection I/O * for the current API call context. * * Return: Non-negative on success / Negative on failure * - * Programmer: Vailin Choi - * April 15, 2023 - * *------------------------------------------------------------------------- */ herr_t @@ -3526,9 +3523,6 @@ H5CX_set_no_selection_io_cause(uint32_t no_selection_io_cause) * * Return: * - * Programmer: Vailin Choi - * April 15, 2023 - * *------------------------------------------------------------------------- */ void @@ -3548,7 +3542,7 @@ H5CX_set_actual_selection_io_mode(uint32_t actual_selection_io_mode) /* Cache the value for later, marking it to set in DXPL when context popped */ (*head)->ctx.actual_selection_io_mode = actual_selection_io_mode; (*head)->ctx.actual_selection_io_mode_set = TRUE; - } /* end if */ + } FUNC_LEAVE_NOAPI_VOID } /* end H5CX_set_actual_selection_io_mode() */ diff --git a/test/select_io_dset.c b/test/select_io_dset.c index 9d2ca07e26e..23c3f5ff9ca 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -110,7 +110,7 @@ check_actual_selection_io_mode(hid_t dxpl, uint32_t sel_io_mode_expected) uint32_t actual_sel_io_mode; if (H5Pget_actual_selection_io_mode(dxpl, &actual_sel_io_mode) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (actual_sel_io_mode != sel_io_mode_expected) TEST_ERROR; @@ -145,14 +145,14 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; if ((sid = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (chunked) { cdims[0] = DSET_SELECT_CHUNK_DIM; if (H5Pset_chunk(dcpl, 1, cdims) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } /* Generate dataset name */ @@ -161,7 +161,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) /* Create dataset */ if ((did = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Initialize data */ for (i = 0; i < DSET_SELECT_DIM; i++) { @@ -171,23 +171,23 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) /* Create dataset transfer property list */ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set modify write buffer if requested */ if (mwbuf) if (H5Pset_modify_write_buf(dxpl, true) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set data transform */ if (dtrans) if (H5Pset_data_transform(dxpl, expr) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Copy wbuf if the library will be modifying it */ if (mwbuf) @@ -195,7 +195,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) /* Write data to the dataset with/without data transform */ if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify selection I/O mode */ if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) @@ -207,7 +207,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) /* Read data from the dataset without data transform set in dxpl */ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify selection I/O mode */ if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) @@ -226,7 +226,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) /* Read the data from the dataset with data transform set in dxpl */ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify data read is transformed a second time */ for (i = 0; i < DSET_SELECT_DIM; i++) @@ -239,15 +239,15 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) } if (H5Sclose(sid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Dclose(did) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dcpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(ntrans_dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; PASSED(); @@ -290,35 +290,35 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) char dset_name[DSET_NAME_LEN]; if ((wbuf = (char *)malloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) - FAIL_STACK_ERROR; + TEST_ERROR; if (mwbuf && (wbuf_bak = (char *)malloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) - FAIL_STACK_ERROR; + TEST_ERROR; if ((rbuf = (char *)malloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) - FAIL_STACK_ERROR; + TEST_ERROR; /* Create dataset transfer property list */ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set modify write buffer if requested */ if (mwbuf) if (H5Pset_modify_write_buf(dxpl, true) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; if ((sid = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (chunked) { cdims[0] = DSET_SELECT_CHUNK_DIM; if (H5Pset_chunk(dcpl, 1, cdims) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } /* Generate dataset name */ @@ -327,7 +327,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Create 1d dataset */ if ((did = H5Dcreate2(fid, dset_name, H5T_STD_I32BE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Initialize data */ for (i = 0; i < DSET_SELECT_DIM; i++) { @@ -343,7 +343,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Write the data to the dataset with little endian */ if (H5Dwrite(did, H5T_STD_I32LE, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify selection I/O mode */ if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) @@ -355,7 +355,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Read the data from the dataset with little endian */ if (H5Dread(did, H5T_STD_I32LE, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify selection I/O mode */ if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) @@ -373,7 +373,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Read the data from the dataset with big endian */ if (H5Dread(did, H5T_STD_I32BE, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify data read in big endian */ for (i = 0; i < DSET_SELECT_DIM; i++) @@ -386,13 +386,13 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) } if (H5Sclose(sid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Dclose(did) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dcpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; free(wbuf); free(wbuf_bak); @@ -451,14 +451,14 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; if ((sid = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (chunked) { cdims[0] = DSET_SELECT_CHUNK_DIM; if (H5Pset_chunk(dcpl, 1, cdims) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } /* Generate dataset name */ @@ -467,7 +467,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign /* Create dataset */ if ((did = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Initialize data */ for (i = 0; i < DSET_SELECT_DIM; i++) { @@ -477,23 +477,23 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign /* Create dataset transfer property list */ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set modify write buffer if requested */ if (mwbuf) if (H5Pset_modify_write_buf(dxpl, true) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set data transform */ if (dtrans) if (H5Pset_data_transform(dxpl, expr) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Copy wbuf if the library will be modifying it */ if (mwbuf) @@ -501,7 +501,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign /* Write data to the dataset with/without data transform set in dxpl */ if (H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify selection I/O mode */ if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) @@ -513,7 +513,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign /* Read the data from the dataset without data transform in dxpl */ if (H5Dread(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify selection I/O mode */ if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) @@ -532,7 +532,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign /* Read data from the dataset with data transform set in dxpl */ if (H5Dread(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify data read is transformed a second time */ for (i = 0; i < DSET_SELECT_DIM; i++) @@ -545,15 +545,15 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign } if (H5Sclose(sid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Dclose(did) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dcpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(ntrans_dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; PASSED(); @@ -601,14 +601,14 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; if ((sid = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (chunked) { cdims[0] = DSET_SELECT_CHUNK_DIM; if (H5Pset_chunk(dcpl, 1, cdims) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } /* Generate dataset name */ @@ -617,7 +617,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig /* Create 1d chunked dataset with/without data transform */ if ((did = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Initialize data */ for (i = 0; i < DSET_SELECT_DIM; i++) { @@ -627,23 +627,23 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig /* Create dataset transfer property list */ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set modify write buffer if requested */ if (mwbuf) if (H5Pset_modify_write_buf(dxpl, true) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set data transform */ if (dtrans) { if (H5Pset_data_transform(dxpl, expr) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } /* Copy wbuf if the library will be modifying it */ @@ -652,7 +652,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig /* Write data to the dataset with/without data transform in dxpl */ if (H5Dwrite(did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify selection I/O mode */ if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) @@ -664,7 +664,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig /* Read data from the dataset without data transform in dxpl */ if (H5Dread(did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, ntrans_dxpl, rbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify selection I/O mode */ if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) @@ -683,7 +683,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig /* Read data from the dataset with data transform set in dxpl */ if (H5Dread(did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify data read is transformed a second time */ for (i = 0; i < DSET_SELECT_DIM; i++) @@ -696,15 +696,15 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig } if (H5Sclose(sid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Dclose(did) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dcpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(ntrans_dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; PASSED(); @@ -771,51 +771,51 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Create dataset transfer property list */ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set modify write buffer if requested */ if (mwbuf) if (H5Pset_modify_write_buf(dxpl, true) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Allocate buffers for datasets */ if (NULL == (s1_wbuf = (s1_t *)malloc(sizeof(s1_t) * DSET_SELECT_DIM))) - FAIL_STACK_ERROR; + TEST_ERROR; if (mwbuf && NULL == (s1_wbuf_bak = (s1_t *)malloc(sizeof(s1_t) * DSET_SELECT_DIM))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (s1_rbuf = (s1_t *)malloc(sizeof(s1_t) * DSET_SELECT_DIM))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (s2_wbuf = (s2_t *)malloc(sizeof(s2_t) * DSET_SELECT_DIM))) - FAIL_STACK_ERROR; + TEST_ERROR; if (mwbuf && NULL == (s2_wbuf_bak = (s2_t *)malloc(sizeof(s2_t) * DSET_SELECT_DIM))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (s2_rbuf = (s2_t *)malloc(sizeof(s2_t) * DSET_SELECT_DIM))) - FAIL_STACK_ERROR; + TEST_ERROR; /* Create the memory data type */ if ((s1_tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tinsert(s1_tid, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0 || H5Tinsert(s1_tid, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0 || H5Tinsert(s1_tid, "c", HOFFSET(s1_t, c), H5T_NATIVE_INT) < 0 || H5Tinsert(s1_tid, "d", HOFFSET(s1_t, d), H5T_NATIVE_INT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; if ((sid = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (chunked) { cdims[0] = DSET_SELECT_CHUNK_DIM; if (H5Pset_chunk(dcpl, 1, cdims) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } /* Case 5(a) */ @@ -826,7 +826,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Create 1d dataset */ if ((did = H5Dcreate2(fid, dset_name, s1_tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Initialize data */ for (i = 0; i < DSET_SELECT_DIM; i++) { @@ -842,7 +842,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Write all the data to the dataset */ if (H5Dwrite(did, s1_tid, H5S_ALL, H5S_ALL, dxpl, s1_wbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Restore wbuf from backup if the library modified it */ if (mwbuf) @@ -850,7 +850,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Read all the data from the dataset */ if (H5Dread(did, s1_tid, H5S_ALL, H5S_ALL, dxpl, s1_rbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify data read */ for (i = 0; i < DSET_SELECT_DIM; i++) { @@ -875,12 +875,12 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Create a compound type same size as s1_t */ if ((ss_ac_tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* but contains only subset members of s1_t */ if (H5Tinsert(ss_ac_tid, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0 || H5Tinsert(ss_ac_tid, "c", HOFFSET(s1_t, c), H5T_NATIVE_INT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Copy wbuf if the library will be modifying it */ if (mwbuf) @@ -888,7 +888,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Write s1_wbuf to the dataset with only subset members in ss_tid */ if (H5Dwrite(did, ss_ac_tid, H5S_ALL, H5S_ALL, dxpl, s1_wbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Restore wbuf from backup if the library modified it */ if (mwbuf) @@ -896,7 +896,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Read the whole compound back */ if (H5Dread(did, ss_ac_tid, H5S_ALL, H5S_ALL, dxpl, s1_rbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify the compound fields have the correct (old or new) values */ for (i = 0; i < DSET_SELECT_DIM; i++) { @@ -921,16 +921,16 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Create a compound type same size as s1_t */ if ((ss_bc_tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* but contains only subset members of s1_t */ if (H5Tinsert(ss_bc_tid, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0 || H5Tinsert(ss_bc_tid, "c", HOFFSET(s1_t, c), H5T_NATIVE_INT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Read the dataset: will read only what is set in */ if (H5Dread(did, ss_bc_tid, H5S_ALL, H5S_ALL, dxpl, s1_rbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify data read */ for (i = 0; i < DSET_SELECT_DIM; i++) { @@ -952,13 +952,13 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) * --1 smaller mem type */ if ((s2_tid = H5Tcreate(H5T_COMPOUND, sizeof(s2_t))) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tinsert(s2_tid, "a", HOFFSET(s2_t, a), H5T_NATIVE_INT) < 0 || H5Tinsert(s2_tid, "b", HOFFSET(s2_t, b), H5T_NATIVE_LONG) < 0 || H5Tinsert(s2_tid, "c", HOFFSET(s2_t, c), H5T_NATIVE_INT) < 0 || H5Tinsert(s2_tid, "d", HOFFSET(s2_t, d), H5T_NATIVE_SHORT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Update s2_wbuf with unique values */ for (i = 0; i < DSET_SELECT_DIM; i++) { @@ -973,7 +973,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) memcpy(s2_wbuf_bak, s2_wbuf, sizeof(s2_t) * DSET_SELECT_DIM); if (H5Dwrite(did, s2_tid, H5S_ALL, H5S_ALL, dxpl, s2_wbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Restore wbuf from backup if the library modified it */ if (mwbuf) @@ -996,21 +996,21 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) } if (H5Sclose(sid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tclose(s1_tid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tclose(s2_tid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tclose(ss_ac_tid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tclose(ss_bc_tid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Dclose(did) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dcpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Release buffers */ free(s1_wbuf); @@ -1111,41 +1111,41 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m dims[0] = DSET_SELECT_DIM; if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (chunked) { cdims[0] = DSET_SELECT_CHUNK_DIM; if (H5Pset_chunk(dcpl, 1, cdims) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } /* Create dataset transfer property list */ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set modify write buffer if requested */ if (mwbuf) if (H5Pset_modify_write_buf(dxpl, true) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set data transform */ if (dtrans) if (H5Pset_data_transform(dxpl, expr) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set up file space ids, mem space ids, and dataset ids */ for (i = 0; i < (int)ndsets; i++) { if ((file_sids[i] = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((mem_sids[i] = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Generate dataset name */ HDsnprintf(dset_names[i], sizeof(dset_names[i]), "multi_dset%d_%s_%s_%s", i, @@ -1155,31 +1155,31 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], ((HDrandom() % 2) ? H5T_NATIVE_LONG : H5T_NATIVE_INT), file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } buf_size = ndsets * DSET_SELECT_DIM * sizeof(int); /* Allocate buffers for all datasets */ if (NULL == (total_wbuf = (int *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (mwbuf && NULL == (total_wbuf_bak = (int *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (total_trans_wbuf = (int *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (total_rbuf = (int *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(long); if (NULL == (total_lwbuf = (long *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (mwbuf && NULL == (total_lwbuf_bak = (long *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (total_trans_lwbuf = (long *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (total_lrbuf = (long *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; /* Initialize buffer indices */ for (i = 0; i < (int)ndsets; i++) { @@ -1309,19 +1309,19 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m } if (H5Pclose(dcpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(ntrans_dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; for (i = 0; i < (int)ndsets; i++) { if (H5Sclose(file_sids[i]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Sclose(mem_sids[i]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Dclose(dset_dids[i]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } free(total_wbuf); @@ -1453,41 +1453,41 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Create dataset transfer property list */ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set modify write buffer if requested */ if (mwbuf) if (H5Pset_modify_write_buf(dxpl, true) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; dims[0] = DSET_SELECT_DIM; if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (chunked) { cdims[0] = DSET_SELECT_CHUNK_DIM; if (H5Pset_chunk(dcpl, 1, cdims) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } /* Create the memory data type */ if ((s1_tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tinsert(s1_tid, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0 || H5Tinsert(s1_tid, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0 || H5Tinsert(s1_tid, "c", HOFFSET(s1_t, c), H5T_NATIVE_INT) < 0 || H5Tinsert(s1_tid, "d", HOFFSET(s1_t, d), H5T_NATIVE_INT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; for (i = 0; i < (int)ndsets; i++) { if ((file_sids[i] = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((mem_sids[i] = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Generate dataset name */ HDsnprintf(dset_names[i], sizeof(dset_names[i]), "multi_cmpd_dset%d_%s_%s", i, @@ -1496,7 +1496,7 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Create ith dataset */ if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], s1_tid, file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } buf_size = ndsets * DSET_SELECT_DIM * sizeof(s1_t); @@ -1579,12 +1579,12 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Create a compound type same size as s1_t */ if ((ss_ac_tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* but contains only subset members of s1_t */ if (H5Tinsert(ss_ac_tid, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0 || H5Tinsert(ss_ac_tid, "c", HOFFSET(s1_t, c), H5T_NATIVE_INT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Untouched memory and file spaces for other datasets */ for (i = 0; i < (int)ndsets; i++) { @@ -1652,18 +1652,18 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Create a compound type same size as s1_t */ if ((ss_bc_tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* but contains only subset members of s1_t */ if (H5Tinsert(ss_bc_tid, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0 || H5Tinsert(ss_bc_tid, "c", HOFFSET(s1_t, c), H5T_NATIVE_INT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Reset memory and file space for dataset */ if (H5Sselect_all(mem_sids[mm]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Sselect_all(file_sids[mm]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Untouched memory and file space for other datasets */ for (i = 0; i < (int)ndsets; i++) { @@ -1726,13 +1726,13 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) * --1 smaller mem type */ if ((s2_tid = H5Tcreate(H5T_COMPOUND, sizeof(s2_t))) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tinsert(s2_tid, "a", HOFFSET(s2_t, a), H5T_NATIVE_INT) < 0 || H5Tinsert(s2_tid, "b", HOFFSET(s2_t, b), H5T_NATIVE_LONG) < 0 || H5Tinsert(s2_tid, "c", HOFFSET(s2_t, c), H5T_NATIVE_INT) < 0 || H5Tinsert(s2_tid, "d", HOFFSET(s2_t, d), H5T_NATIVE_SHORT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; for (i = 0; i < (int)ndsets; i++) { s2_wbufi[i] = s2_total_wbuf + (i * DSET_SELECT_DIM); @@ -1784,17 +1784,17 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) } if (H5Pclose(dcpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; for (i = 0; i < (int)ndsets; i++) { if (H5Sclose(file_sids[i]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Sclose(mem_sids[i]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Dclose(dset_dids[i]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } free(total_wbuf); @@ -1894,34 +1894,34 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Create dataset transfer property list */ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set modify write buffer if requested */ if (mwbuf) if (H5Pset_modify_write_buf(dxpl, true) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; dims[0] = DSET_SELECT_DIM; if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (chunked) { cdims[0] = DSET_SELECT_CHUNK_DIM; if (H5Pset_chunk(dcpl, 1, cdims) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } /* Set up file space ids, mem space ids, and dataset ids */ for (i = 0; i < (int)ndsets; i++) { if ((file_sids[i] = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((mem_sids[i] = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Generate dataset name */ HDsnprintf(dset_names[i], sizeof(dset_names[i]), "multi_size_dset%d_%s_%s", i, @@ -1930,7 +1930,7 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Create ith dataset */ if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], H5T_STD_I32BE, file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } /* Case a */ @@ -1940,11 +1940,11 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Allocate buffers for all datasets */ if (NULL == (total_wbuf = (uint8_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (total_wbuf_bak = (uint8_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (total_rbuf = (uint8_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; /* Initialize buffer indices */ for (i = 0; i < (int)ndsets; i++) { @@ -2007,11 +2007,11 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Allocate buffers for all datasets */ if (NULL == (total_lwbuf = (uint8_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (total_lwbuf_bak = (uint8_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (total_lrbuf = (uint8_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; /* Initialize buffer indices */ for (i = 0; i < (int)ndsets; i++) { @@ -2082,11 +2082,11 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Allocate buffers for all datasets */ if (NULL == (total_swbuf = (uint8_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (total_swbuf_bak = (uint8_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (total_srbuf = (uint8_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; /* Initialize buffer indices */ for (i = 0; i < (int)ndsets; i++) { @@ -2137,17 +2137,17 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) } if (H5Pclose(dcpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; for (i = 0; i < (int)ndsets; i++) { if (H5Sclose(file_sids[i]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Sclose(mem_sids[i]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Dclose(dset_dids[i]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } free(total_wbuf); @@ -2327,66 +2327,66 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) /* Create dataset transfer property list */ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Enable selection I/O */ if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set modify write buffer if requested */ if (mwbuf) if (H5Pset_modify_write_buf(dxpl, true) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Set dataset layout: contiguous or chunked */ dims[0] = DSET_SELECT_DIM; if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (chunked) { cdims[0] = DSET_SELECT_CHUNK_DIM; if (H5Pset_chunk(dcpl, 1, cdims) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } /* Create compound data type: s1_t */ if ((s1_tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tinsert(s1_tid, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0 || H5Tinsert(s1_tid, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0 || H5Tinsert(s1_tid, "c", HOFFSET(s1_t, c), H5T_NATIVE_INT) < 0 || H5Tinsert(s1_tid, "d", HOFFSET(s1_t, d), H5T_NATIVE_INT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Create compound data type: s3_t */ if ((s3_tid = H5Tcreate(H5T_COMPOUND, sizeof(s3_t))) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tinsert(s3_tid, "a", HOFFSET(s3_t, a), H5T_NATIVE_INT) < 0 || H5Tinsert(s3_tid, "b", HOFFSET(s3_t, b), H5T_NATIVE_INT) < 0 || H5Tinsert(s3_tid, "c", HOFFSET(s3_t, c), H5T_NATIVE_INT) < 0 || H5Tinsert(s3_tid, "d", HOFFSET(s3_t, d), H5T_NATIVE_INT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Create compound data type: s4_t */ if ((s4_tid = H5Tcreate(H5T_COMPOUND, sizeof(s4_t))) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tinsert(s4_tid, "b", HOFFSET(s4_t, b), H5T_NATIVE_UINT) < 0 || H5Tinsert(s4_tid, "d", HOFFSET(s4_t, d), H5T_NATIVE_UINT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Create dataset for i ndsets */ for (i = 0; i < (int)ndsets; i++) { /* File space ids */ if ((file_sids[i] = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Memory space ids */ if ((mem_sids[i] = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; mm = HDrandom() % (int)ndsets; if (mm == 0) { @@ -2395,7 +2395,7 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) chunked ? "chunked" : "contig", mwbuf ? "mwbuf" : "nomwbuf"); if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], H5T_NATIVE_INT, file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } else if (mm == 1) { dset_types[i] = DSET_WITH_CONV_AND_NO_BKG; @@ -2403,7 +2403,7 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) chunked ? "chunked" : "contig", mwbuf ? "mwbuf" : "nomwbuf"); if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], H5T_NATIVE_LONG, file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } else { dset_types[i] = DSET_WITH_CONV_AND_BKG; @@ -2411,7 +2411,7 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) chunked ? "chunked" : "contig", mwbuf ? "mwbuf" : "nomwbuf"); if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], s1_tid, file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } } /* end for i ndsets */ @@ -2421,49 +2421,49 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) /* DSET_WITH_NO_CONV */ buf_size = ndsets * DSET_SELECT_DIM * sizeof(int); if (NULL == (total_wbuf1 = (int *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (mwbuf && NULL == (total_wbuf1_bak = (int *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (NULL == (total_rbuf1 = (int *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; /* DSET_WITH_CONV_AND_NO_BKG */ buf_size = ndsets * DSET_SELECT_DIM * sizeof(unsigned long); if (NULL == (ul_total_wbuf2 = (unsigned long *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (mwbuf && NULL == (ul_total_wbuf2_bak = (unsigned long *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(long); if (NULL == (l_total_rbuf2 = (long *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(long); if (NULL == (l_total_wbuf2 = (long *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (mwbuf && NULL == (l_total_wbuf2_bak = (long *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(short); if (NULL == (s_total_rbuf2 = (short *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; /* DSET_WITH_CONV_AND_BKG */ buf_size = ndsets * DSET_SELECT_DIM * sizeof(s1_t); if (NULL == (s1_total_wbuf3 = (s1_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (mwbuf && NULL == (s1_total_wbuf3_bak = (s1_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(s3_t); if (NULL == (s3_total_rbuf3 = (s3_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(s4_t); if (NULL == (s4_total_wbuf3 = (s4_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; if (mwbuf && NULL == (s4_total_wbuf3_bak = (s4_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(s1_t); if (NULL == (s1_total_rbuf3 = (s1_t *)malloc(buf_size))) - FAIL_STACK_ERROR; + TEST_ERROR; /* Test with s settings for ndsets */ for (s = SETTING_A; s <= SETTING_B; s++) { @@ -2671,26 +2671,26 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) /* Closing */ if (H5Pclose(dcpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tclose(s1_tid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tclose(s3_tid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Tclose(s4_tid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; for (i = 0; i < (int)ndsets; i++) { if (H5Sclose(file_sids[i]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Dclose(dset_dids[i]) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Don't delete the last set of datasets */ if ((n + 1) != niter) if (H5Ldelete(fid, dset_names[i], H5P_DEFAULT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } /* Freeing */ @@ -2833,16 +2833,16 @@ test_set_get_select_io_mode(hid_t fid) /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; if ((sid = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; cdims[0] = DSET_SELECT_CHUNK_DIM; if (H5Pset_chunk(dcpl, 1, cdims) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((did = H5Dcreate2(fid, "test_chk_dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Initialize data */ for (i = 0; i < DSET_SELECT_DIM; i++) @@ -2850,7 +2850,7 @@ test_set_get_select_io_mode(hid_t fid) /* May change the selection io actually performed */ if (H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pget_selection_io(dxpl, &selection_io_mode) < 0) TEST_ERROR; @@ -2860,13 +2860,13 @@ test_set_get_select_io_mode(hid_t fid) TEST_ERROR; if (H5Dclose(did) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dcpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Sclose(sid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; PASSED(); @@ -2924,30 +2924,30 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ } if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Enable page buffering to trigger H5D_PAGE_BUFFER */ if (test_mode & TEST_PAGE_BUFFER) { if (H5Pset_page_buffer_size(fapl, 4096, 0, 0) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 0, (hsize_t)1) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } else { /* Not page buffer test, reset to default */ if (H5Pset_page_buffer_size(fapl, 0, 0, 0) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, 0, (hsize_t)1) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (test_mode & TEST_CONTIGUOUS_SIEVE_BUFFER) { no_selection_io_cause_write_expected |= H5D_SEL_IO_CONTIGUOUS_SIEVE_BUFFER; @@ -2956,14 +2956,14 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ if (test_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET) { if (H5Pset_layout(dcpl, H5D_COMPACT) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; no_selection_io_cause_write_expected |= H5D_SEL_IO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; no_selection_io_cause_read_expected |= H5D_SEL_IO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; } if (test_mode == TEST_DATASET_FILTER) { if (H5Pset_deflate(dcpl, 9) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; is_chunked = true; no_selection_io_cause_write_expected |= H5D_SEL_IO_DATASET_FILTER; no_selection_io_cause_read_expected |= H5D_SEL_IO_DATASET_FILTER; @@ -2977,7 +2977,7 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ if (test_mode == TEST_DISABLE_BY_API) { if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_OFF) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; no_selection_io_cause_write_expected |= H5D_SEL_IO_DISABLE_BY_API; no_selection_io_cause_read_expected |= H5D_SEL_IO_DISABLE_BY_API; } @@ -2990,19 +2990,19 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ /* Datatype conversion */ if (test_mode & TEST_DATATYPE_CONVERSION) { if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; tid = H5T_NATIVE_UINT; /* If we're testing a too small tconv buffer, set the buffer to be too small */ if (test_mode & TEST_TCONV_BUF_TOO_SMALL) { if (H5Pset_buffer(dxpl, sizeof(int), NULL, NULL) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* If we're using in-place type conversion sel io will succeed and only switch to scalar at the * VFL */ if (test_mode & TEST_IN_PLACE_TCONV) { if (H5Pset_modify_write_buf(dxpl, true) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; no_selection_io_cause_write_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; } else @@ -3026,28 +3026,28 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ /* Create 1d data space */ dims[0] = DSET_SELECT_DIM; if ((sid = H5Screate_simple(1, dims, NULL)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (is_chunked) { cdims[0] = DSET_SELECT_CHUNK_DIM; if (H5Pset_chunk(dcpl, 1, cdims) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } if ((did = H5Dcreate2(fid, "no_selection_io_cause", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Initialize data */ for (i = 0; i < DSET_SELECT_DIM; i++) wbuf[i] = i; if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (test_mode & TEST_CONTIGUOUS_SIEVE_BUFFER) { if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, dxpl, wbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause_write) < 0) @@ -3062,11 +3062,11 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ test_mode & TEST_PAGE_BUFFER) { if (H5Dflush(did) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; } if (H5Dread(did, tid, H5S_ALL, H5S_ALL, dxpl, rbuf) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* Verify causes of no selection I/O for write is as expected */ if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause_read) < 0) @@ -3077,20 +3077,20 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ TEST_ERROR; if (H5Dclose(did) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Sclose(sid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dcpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Fclose(fid) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pclose(fcpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; return SUCCEED; @@ -3124,13 +3124,13 @@ test_get_no_selection_io_cause(const char *filename, hid_t fapl) TESTING("H5Pget_no_selection_io_cause()"); if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (H5Pget_selection_io(dxpl, &selection_io_mode) < 0) TEST_ERROR; if (H5Pclose(dxpl) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; /* The following tests are based on H5D_SELECTION_IO_MODE_DEFAULT as the default setting in the library; skip the tests if that is not true */ From 36e49e5f876b7cb668427a4217f4c8d77af98726 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Tue, 12 Sep 2023 15:12:02 -0500 Subject: [PATCH 16/37] Minor spelling/ scope changes --- src/H5CX.c | 4 ++-- src/H5FDint.c | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index b2b51bcf457..08ec98b428f 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -3484,7 +3484,7 @@ H5CX_test_set_mpio_coll_rank0_bcast(bool mpio_coll_rank0_bcast) #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5CX_set_no_selecction_io_cause + * Function: H5CX_set_no_selection_io_cause * * Purpose: Sets the reason for not performing selection I/O for * the current API call context. @@ -3516,7 +3516,7 @@ H5CX_set_no_selection_io_cause(uint32_t no_selection_io_cause) } /* end H5CX_set_no_selection_io_cause() */ /*------------------------------------------------------------------------- - * Function: H5CX_set_actual_selecction_io_mode + * Function: H5CX_set_actual_selection_io_mode * * Purpose: Sets the actual selection I/O mode for the current API * call context. diff --git a/src/H5FDint.c b/src/H5FDint.c index 8f4d5ff5df9..581c9dda2e5 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -486,13 +486,13 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs /* if the underlying VFD supports vector read, make the call */ if (file->cls->read_vector) { - uint32_t actual_selection_io_mode; - if ((file->cls->read_vector)(file, dxpl_id, count, types, addrs, sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read vector request failed"); /* Set actual selection I/O mode, if this is a raw data operation */ if (is_raw) { + uint32_t actual_selection_io_mode; + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_VECTOR_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); @@ -711,14 +711,13 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr /* if the underlying VFD supports vector write, make the call */ if (file->cls->write_vector) { - - uint32_t actual_selection_io_mode; - if ((file->cls->write_vector)(file, dxpl_id, count, types, addrs, sizes, bufs) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write vector request failed"); /* Set actual selection I/O mode, if this is a raw data operation */ if (is_raw) { + uint32_t actual_selection_io_mode; + H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_VECTOR_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); From 2ec2d482747a9f93d8876e822c9955f39b258704 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Tue, 12 Sep 2023 16:17:40 -0500 Subject: [PATCH 17/37] Improve documentation for H5Pget_actual_selection_io_mode() and remove inappropriate calls to H5CX_set_dxpl() from H5M.c. --- src/H5M.c | 21 --------------------- src/H5Ppublic.h | 17 +++++++++++------ 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/src/H5M.c b/src/H5M.c index e2fd2025a9b..f59e02fa3ee 100644 --- a/src/H5M.c +++ b/src/H5M.c @@ -893,9 +893,6 @@ H5Mget_count(hid_t map_id, hsize_t *count /*out*/, hid_t dxpl_id) else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); - /* Set DXPL for operation */ - H5CX_set_dxpl(dxpl_id); - /* Set up VOL callback arguments */ map_args.get.get_type = H5VL_MAP_GET_COUNT; map_args.get.args.get_count.count = 0; @@ -952,9 +949,6 @@ H5M__put_api_common(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); - /* Set DXPL for operation */ - H5CX_set_dxpl(dxpl_id); - /* Set up VOL callback arguments */ map_args.put.key_mem_type_id = key_mem_type_id; map_args.put.key = key; @@ -1087,9 +1081,6 @@ H5M__get_api_common(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); - /* Set DXPL for operation */ - H5CX_set_dxpl(dxpl_id); - /* Set up VOL callback arguments */ map_args.get_val.key_mem_type_id = key_mem_type_id; map_args.get_val.key = key; @@ -1225,9 +1216,6 @@ H5Mexists(hid_t map_id, hid_t key_mem_type_id, const void *key, hbool_t *exists, else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); - /* Set DXPL for operation */ - H5CX_set_dxpl(dxpl_id); - /* Set up VOL callback arguments */ map_args.exists.key_mem_type_id = key_mem_type_id; map_args.exists.key = key; @@ -1305,9 +1293,6 @@ H5Miterate(hid_t map_id, hsize_t *idx, hid_t key_mem_type_id, H5M_iterate_t op, else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); - /* Set DXPL for operation */ - H5CX_set_dxpl(dxpl_id); - /* Set up VOL callback arguments */ map_args.specific.specific_type = H5VL_MAP_ITER; map_args.specific.args.iterate.loc_params.type = H5VL_OBJECT_BY_SELF; @@ -1394,9 +1379,6 @@ H5Miterate_by_name(hid_t loc_id, const char *map_name, hsize_t *idx, hid_t key_m else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); - /* Set DXPL for operation */ - H5CX_set_dxpl(dxpl_id); - /* Set up VOL callback arguments */ map_args.specific.specific_type = H5VL_MAP_ITER; map_args.specific.args.iterate.loc_params.type = H5VL_OBJECT_BY_NAME; @@ -1462,9 +1444,6 @@ H5Mdelete(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t dxpl_id) else if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms"); - /* Set DXPL for operation */ - H5CX_set_dxpl(dxpl_id); - /* Set up VOL callback arguments */ map_args.specific.specific_type = H5VL_MAP_DELETE; map_args.specific.args.del.loc_params.type = H5VL_OBJECT_BY_SELF; diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 7e43f1b35c9..6d2617c5d57 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -8332,7 +8332,7 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * H5Pget_no_selection_io_cause() can be used to determine the reason * why selection or vector I/O was not performed. * - * Valid values returned in \p actual_selection_io_mode are listed + * Valid bitflags returned in \p actual_selection_io_mode are listed * as follows. * * - #H5D_SCALAR_IO @@ -8342,12 +8342,17 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * - #H5D_SELECTION_IO * Selection I/O was performed * + * 0 or more of these can be present in \p actual_selection_io_mode in + * a bitwise fashion, since a single operation can trigger multiple + * instances of I/O, possibly with different types. A value of \p 0 + * indicates no raw data I/O was performed during the operation. + * * Be aware that this function will only include raw data I/O performed - * as part of the last I/O operation. Any metadata flushes, including - * attribute and compact dataset I/O, is disregarded. It is also - * possible that data was cached in the dataset chunk cache or sieve - * buffer, which may prevent I/O from hitting the disk, and thereby - * prevent it from being counted by this function. + * to/from disk as part of the last I/O operation. Any metadata + * I/O, including attribute and compact dataset I/O, is disregarded. + * It is also possible that data was cached in the dataset chunk cache + * or sieve buffer, which may prevent I/O from hitting the disk, and + * thereby prevent it from being counted by this function. * * \since 1.14.2 * From 45f53d45b75ec965fb8c529c06477eb66d3909f2 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Wed, 13 Sep 2023 15:17:17 -0500 Subject: [PATCH 18/37] Add doxygen table entry for H5Pget_actual_selection_io_mode and doxygenify the macro defintions for the modes --- doxygen/examples/tables/propertyLists.dox | 4 ++++ src/H5Ppublic.h | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/doxygen/examples/tables/propertyLists.dox b/doxygen/examples/tables/propertyLists.dox index 2f74c03770f..ed4ff41484d 100644 --- a/doxygen/examples/tables/propertyLists.dox +++ b/doxygen/examples/tables/propertyLists.dox @@ -711,6 +711,10 @@ of the library for reading or writing the actual data. Gets the cause for not performing selection or vector I/O on the last parallel I/O call. +#H5Pget_actual_selection_io_mode +Gets the type(s) (scalar, vector, selection) of raw data I/O performed I/O on the last I/O call. + + #H5Pset_modify_write_buf/#H5Pget_modify_write_buf Sets/gets a flag allowing the library to modify the contents of the write buffer. diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 6d2617c5d57..4ffa16f692a 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -420,10 +420,15 @@ typedef enum H5D_selection_io_mode_t { } H5D_selection_io_mode_t; //! -/* Actual selection I/O modes for H5Pget_actual_selection_io_mode() property */ -#define H5D_SCALAR_IO 0x1 /* Scalar (or legacy MPIO) I/O was performed */ -#define H5D_VECTOR_IO 0x2 /* Vector I/O was performed */ -#define H5D_SELECTION_IO 0x4 /* Selection I/O was performed */ +/** + * Causes for H5Pget_actual_selection_io_mode() property + */ +#define H5D_SCALAR_IO \ + (0x0001u) /**< Scalar (or legacy MPIO) I/O was performed */ +#define H5D_VECTOR_IO \ + (0x0002u) /**< Vector I/O was performed */ +#define H5D_SELECTION_IO \ + (0x0004u) /**< Selection I/O was performed */ /********************/ /* Public Variables */ From 0ccd1f48dd50ce7e241ac2164dcb7064322aa946 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 20:20:22 +0000 Subject: [PATCH 19/37] Committing clang-format changes --- src/H5Ppublic.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 4ffa16f692a..7cb2eaffe4b 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -423,12 +423,9 @@ typedef enum H5D_selection_io_mode_t { /** * Causes for H5Pget_actual_selection_io_mode() property */ -#define H5D_SCALAR_IO \ - (0x0001u) /**< Scalar (or legacy MPIO) I/O was performed */ -#define H5D_VECTOR_IO \ - (0x0002u) /**< Vector I/O was performed */ -#define H5D_SELECTION_IO \ - (0x0004u) /**< Selection I/O was performed */ +#define H5D_SCALAR_IO (0x0001u) /**< Scalar (or legacy MPIO) I/O was performed */ +#define H5D_VECTOR_IO (0x0002u) /**< Vector I/O was performed */ +#define H5D_SELECTION_IO (0x0004u) /**< Selection I/O was performed */ /********************/ /* Public Variables */ From af6245262a0184a625da6089f810b0a856f83df6 Mon Sep 17 00:00:00 2001 From: "vchoi-hdfgroup.org" Date: Thu, 21 Sep 2023 12:33:07 -0500 Subject: [PATCH 20/37] Add a line --- test/select_io_dset.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/select_io_dset.c b/test/select_io_dset.c index 23c3f5ff9ca..545638e7efc 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -3334,6 +3334,7 @@ main(void) printf("All selection I/O dataset tests passed.\n"); printf("===================================\n"); +printf("Adding one line\n"); h5_cleanup(FILENAME, fapl); exit(EXIT_SUCCESS); From cf0d2aec14aa2d4d21663a6d9512aaac3c7b2960 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 17:35:47 +0000 Subject: [PATCH 21/37] Committing clang-format changes --- test/select_io_dset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/select_io_dset.c b/test/select_io_dset.c index 545638e7efc..dadff4e3f98 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -3334,7 +3334,7 @@ main(void) printf("All selection I/O dataset tests passed.\n"); printf("===================================\n"); -printf("Adding one line\n"); + printf("Adding one line\n"); h5_cleanup(FILENAME, fapl); exit(EXIT_SUCCESS); From 8092b0f075893c1f1f9a401758d94a1ed193ea12 Mon Sep 17 00:00:00 2001 From: "vchoi-hdfgroup.org" Date: Thu, 21 Sep 2023 13:46:41 -0500 Subject: [PATCH 22/37] Remove the line added earlier that shouldn't be there. --- test/select_io_dset.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/select_io_dset.c b/test/select_io_dset.c index dadff4e3f98..23c3f5ff9ca 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -3334,7 +3334,6 @@ main(void) printf("All selection I/O dataset tests passed.\n"); printf("===================================\n"); - printf("Adding one line\n"); h5_cleanup(FILENAME, fapl); exit(EXIT_SUCCESS); From 78f1a62520baab1ddb4dbd1b2f70132cb0909e67 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Fri, 6 Oct 2023 15:39:42 -0500 Subject: [PATCH 23/37] Modify H5CX code to always write the actual selection I/O mode to the DXPL if it isn't the default DXPL --- src/H5CX.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/H5CX.c b/src/H5CX.c index 08ec98b428f..59d98d80d69 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -2545,6 +2545,11 @@ H5CX_get_actual_selection_io_mode(uint32_t *actual_selection_io_mode) assert(head && *head); assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + /* This property is a special case - we want to wipe out any previous setting. Copy the default setting if */ + if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT && !(*head)->ctx.actual_selection_io_mode_set && !(*head)->ctx.actual_selection_io_mode_valid) { + (*head)->ctx.actual_selection_io_mode = H5CX_def_dxpl_cache.actual_selection_io_mode; + (*head)->ctx.actual_selection_io_mode_set = true; + } H5CX_RETRIEVE_PROP_VALID_SET(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, actual_selection_io_mode) @@ -3602,6 +3607,12 @@ H5CX__pop_common(bool update_dxpl_props) /* Check for cached DXPL properties to return to application */ if (update_dxpl_props) { + /* actual_selection_io_mode is a special case - we always want to set it in the property list even if it was never set by the library, in that case it indicates no I/O was performed and we don't want to leave the (possibly incorrect) old value in the property list, so set from the default property list */ + if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT && !(*head)->ctx.actual_selection_io_mode_set) { + (*head)->ctx.actual_selection_io_mode = H5CX_def_dxpl_cache.actual_selection_io_mode; + (*head)->ctx.actual_selection_io_mode_set = true; + } + H5CX_SET_PROP(H5D_XFER_NO_SELECTION_IO_CAUSE_NAME, no_selection_io_cause) H5CX_SET_PROP(H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, actual_selection_io_mode) #ifdef H5_HAVE_PARALLEL From a5091075881e39fcc5c38325aa43c2124ab16f12 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 20:43:25 +0000 Subject: [PATCH 24/37] Committing clang-format changes --- src/H5CX.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index 59d98d80d69..6ed492c6db1 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -2545,9 +2545,11 @@ H5CX_get_actual_selection_io_mode(uint32_t *actual_selection_io_mode) assert(head && *head); assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); - /* This property is a special case - we want to wipe out any previous setting. Copy the default setting if */ - if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT && !(*head)->ctx.actual_selection_io_mode_set && !(*head)->ctx.actual_selection_io_mode_valid) { - (*head)->ctx.actual_selection_io_mode = H5CX_def_dxpl_cache.actual_selection_io_mode; + /* This property is a special case - we want to wipe out any previous setting. Copy the default setting + * if */ + if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT && !(*head)->ctx.actual_selection_io_mode_set && + !(*head)->ctx.actual_selection_io_mode_valid) { + (*head)->ctx.actual_selection_io_mode = H5CX_def_dxpl_cache.actual_selection_io_mode; (*head)->ctx.actual_selection_io_mode_set = true; } H5CX_RETRIEVE_PROP_VALID_SET(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME, @@ -3607,9 +3609,12 @@ H5CX__pop_common(bool update_dxpl_props) /* Check for cached DXPL properties to return to application */ if (update_dxpl_props) { - /* actual_selection_io_mode is a special case - we always want to set it in the property list even if it was never set by the library, in that case it indicates no I/O was performed and we don't want to leave the (possibly incorrect) old value in the property list, so set from the default property list */ + /* actual_selection_io_mode is a special case - we always want to set it in the property list even if + * it was never set by the library, in that case it indicates no I/O was performed and we don't want + * to leave the (possibly incorrect) old value in the property list, so set from the default property + * list */ if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT && !(*head)->ctx.actual_selection_io_mode_set) { - (*head)->ctx.actual_selection_io_mode = H5CX_def_dxpl_cache.actual_selection_io_mode; + (*head)->ctx.actual_selection_io_mode = H5CX_def_dxpl_cache.actual_selection_io_mode; (*head)->ctx.actual_selection_io_mode_set = true; } From 1e7588ff2e36bc614c8e648b8ec96fe55561bb03 Mon Sep 17 00:00:00 2001 From: "vchoi-hdfgroup.org" Date: Wed, 11 Oct 2023 12:33:36 -0500 Subject: [PATCH 25/37] Work-in-progress for tests on H5Pget_actual_selection_io_mode(). --- testpar/t_select_io_dset.c | 158 ++++++++++++++++++++++++++----------- 1 file changed, 112 insertions(+), 46 deletions(-) diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index 8bdf8ed2f49..d826862d779 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -59,11 +59,13 @@ typedef enum { TEST_SMALLER_MEM_NO_BKG, /* smaller memory type, no bkg buffer */ TEST_CMPD_WITH_BKG, /* compound types with bkg buffer */ TEST_TYPE_CONV_SEL_EMPTY, /* some processes have null/empty selections and with type conversion */ +#ifdef OUT TEST_MULTI_CONV_NO_BKG, /* multi dataset test 1 */ TEST_MULTI_CONV_BKG, /* multi dataset test 2 */ TEST_MULTI_CONV_SIZE_CHANGE, /* multi dataset test 3 */ TEST_MULTI_CONV_SEL_EMPTY, /* multi dataset test 4 */ TEST_MULTI_ALL, /* multi dataset test 5 */ +#endif TEST_SELECT_NTESTS } test_select_config_t; @@ -186,6 +188,23 @@ check_io_mode(hid_t dxpl, unsigned chunked) } /* check_io_mode() */ +static void +testing_check_io_mode(hid_t dxpl, H5D_mpio_actual_io_mode_t exp_io_mode) +{ + H5D_mpio_actual_io_mode_t actual_io_mode; + + if (H5Pget_mpio_actual_io_mode(dxpl, &actual_io_mode) < 0) + P_TEST_ERROR; + + if (actual_io_mode != exp_io_mode) { + nerrors++; + if (MAINPROCESS) + printf("\n Failed: Incorrect I/O mode (expected/actual) %u:%u", + (unsigned)exp_io_mode, (unsigned)actual_io_mode); + } + +} /* testing_check_io_mode() */ + /* * Helper routine to check actual selection I/O mode on a dxpl */ @@ -196,15 +215,19 @@ check_actual_selection_io_mode(hid_t dxpl, uint32_t sel_io_mode_expected) if (H5Pget_actual_selection_io_mode(dxpl, &actual_sel_io_mode) < 0) P_TEST_ERROR; - if (actual_sel_io_mode != sel_io_mode_expected) + if (actual_sel_io_mode != sel_io_mode_expected) { + if (MAINPROCESS) + printf("\n Failed: Incorrect selection I/O mode (expected/actual) %u:%u", + (unsigned)sel_io_mode_expected, (unsigned)actual_sel_io_mode); P_TEST_ERROR; + } } /* * Case 1: single dataset read/write, no type conversion (null case) */ static void -test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) +test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned select, unsigned mwbuf) { int i; hid_t did = H5I_INVALID_HID; @@ -223,6 +246,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) int rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; const char *expr = "2*x"; + H5D_mpio_actual_io_mode_t exp_io_mode = H5D_MPIO_NO_COLLECTIVE; curr_nerrors = nerrors; @@ -238,11 +262,13 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) cdims[0] = DSET_SELECT_CHUNK_DIM; if (H5Pset_chunk(dcpl, 1, cdims) < 0) P_TEST_ERROR; + if (!dtrans && H5Pset_deflate(dcpl, 2) < 0) + P_TEST_ERROR; } /* Generate dataset name */ - snprintf(dset_name, sizeof(dset_name), "no_tconv_%s_%s_%s", chunked ? "chunked" : "contig", - dtrans ? "xform" : "noxform", mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_name, sizeof(dset_name), "no_tconv_%s_%s_%s_%s", chunked ? "chunked" : "contig", + dtrans ? "xform" : "noxform", select ? "sel" : "nosel", mwbuf ? "mwbuf" : "nomwbuf"); /* Create dataset */ if ((did = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -276,7 +302,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, H5D_SELECTION_IO_MODE_ON, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) P_TEST_ERROR; @@ -298,8 +324,14 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) if (mwbuf) memcpy(wbuf, wbuf_bak, sizeof(wbuf)); - check_io_mode(dxpl, chunked); - check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + if (!dtrans || select) + exp_io_mode = chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE; + testing_check_io_mode(dxpl, exp_io_mode); + + if(chunked && !dtrans) + check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + else + check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); /* Read data from the dataset (if dtrans, without data transform set in dxpl) */ if (H5Dread(did, H5T_NATIVE_INT, mspace_id, fspace_id, ntrans_dxpl, rbuf) < 0) @@ -342,6 +374,8 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) P_TEST_ERROR; if (H5Pclose(dxpl) < 0) P_TEST_ERROR; + if (H5Pclose(dcpl) < 0) + P_TEST_ERROR; if (H5Pclose(ntrans_dxpl) < 0) P_TEST_ERROR; @@ -354,7 +388,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) * Case 2: single dataset read/write, no size change, no background buffer */ static void -test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) +test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned select, unsigned mwbuf) { int i; hid_t did = H5I_INVALID_HID; @@ -371,6 +405,8 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) char *rbuf = NULL; char dset_name[DSET_NAME_LEN]; + H5D_mpio_actual_io_mode_t exp_io_mode = H5D_MPIO_NO_COLLECTIVE; + curr_nerrors = nerrors; if ((wbuf = (char *)malloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) @@ -394,8 +430,8 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) } /* Generate dataset name */ - snprintf(dset_name, sizeof(dset_name), "no_size_change_%s_%s", chunked ? "chunked" : "contig", - mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_name, sizeof(dset_name), "no_size_change_%s_%s_%s", chunked ? "chunked" : "contig", + select ? "sel" : "nosel", mwbuf ? "mwbuf" : "nomwbuf"); /* Create 1d dataset */ if ((did = H5Dcreate2(fid, dset_name, H5T_STD_I32BE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -431,7 +467,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, H5D_SELECTION_IO_MODE_ON, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); /* Copy wbuf if the library will be modifying it */ if (mwbuf) @@ -445,8 +481,11 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (mwbuf) memcpy(wbuf, wbuf_bak, (size_t)(4 * DSET_SELECT_DIM)); - check_io_mode(dxpl, chunked); - check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + if (select) + exp_io_mode = chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE; + + testing_check_io_mode(dxpl, exp_io_mode); + check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); /* Read the data from the dataset with little endian */ if (H5Dread(did, H5T_STD_I32LE, mspace_id, fspace_id, dxpl, rbuf) < 0) @@ -505,7 +544,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) * Case 3: single dataset read/write, larger mem type, no background buffer */ static void -test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) +test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned select, unsigned mwbuf) { int i; hid_t did = H5I_INVALID_HID; @@ -524,6 +563,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign long long rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; const char *expr = "100 - x"; + H5D_mpio_actual_io_mode_t exp_io_mode = H5D_MPIO_NO_COLLECTIVE; curr_nerrors = nerrors; @@ -541,8 +581,8 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign } /* Generate dataset name */ - snprintf(dset_name, sizeof(dset_name), "larger_no_bkg_%s_%s_%s", chunked ? "chunked" : "contig", - dtrans ? "xform" : "noxform", mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_name, sizeof(dset_name), "larger_no_bkg_%s_%s_%s_%s", chunked ? "chunked" : "contig", + dtrans ? "xform" : "noxform", select ? "sel" : "nosel", mwbuf ? "mwbuf" : "nomwbuf"); /* Create 1d chunked dataset with/without data transform */ if ((did = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -576,7 +616,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, H5D_SELECTION_IO_MODE_ON, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) P_TEST_ERROR; @@ -598,8 +638,11 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign if (mwbuf) memcpy(wbuf, wbuf_bak, sizeof(wbuf)); - check_io_mode(dxpl, chunked); - check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + if (select) + exp_io_mode = chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE; + + testing_check_io_mode(dxpl, exp_io_mode); + check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); /* Read data from the dataset (if dtrans, without data transform set in dxpl) */ if (H5Dread(did, H5T_NATIVE_LLONG, mspace_id, fspace_id, ntrans_dxpl, rbuf) < 0) @@ -654,7 +697,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign * Case 4: single dataset reader/write, smaller mem type, no background buffer */ static void -test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) +test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned select, unsigned mwbuf) { int i; hid_t did = H5I_INVALID_HID; @@ -673,6 +716,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig short rbuf[DSET_SELECT_DIM]; char dset_name[DSET_NAME_LEN]; const char *expr = "2 * (10 + x)"; + H5D_mpio_actual_io_mode_t exp_io_mode = H5D_MPIO_NO_COLLECTIVE; curr_nerrors = nerrors; @@ -690,8 +734,8 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig } /* Generate dataset name */ - snprintf(dset_name, sizeof(dset_name), "smaller_no_bkg_%s_%s_%s", chunked ? "chunked" : "contig", - dtrans ? "xform" : "noxform", mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_name, sizeof(dset_name), "smaller_no_bkg_%s_%s_%s_%s", chunked ? "chunked" : "contig", + dtrans ? "xform" : "noxform", select ? "sel" : "nosel", mwbuf ? "mwbuf" : "nomwbuf"); /* Create 1d chunked dataset with/without data transform */ if ((did = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -725,7 +769,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, H5D_SELECTION_IO_MODE_ON, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) P_TEST_ERROR; @@ -748,8 +792,11 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig if (mwbuf) memcpy(wbuf, wbuf_bak, sizeof(wbuf)); - check_io_mode(dxpl, chunked); - check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + if (select) + exp_io_mode = chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE; + + testing_check_io_mode(dxpl, exp_io_mode); + check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); /* Read data from the dataset (if dtrans, without data transform set in dxpl) */ if (H5Dread(did, H5T_NATIVE_SHORT, mspace_id, fspace_id, ntrans_dxpl, rbuf) < 0) @@ -822,7 +869,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig * Verify the values read */ static void -test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) +test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned select, unsigned mwbuf) { int i; hid_t did = H5I_INVALID_HID; @@ -888,8 +935,8 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) /* Case 5(a) */ /* Generate dataset name */ - snprintf(dset_name, sizeof(dset_name), "cmpd_with_bkg_%s_%s", chunked ? "chunked" : "contig", - mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_name, sizeof(dset_name), "cmpd_with_bkg_%s_%s_%s", chunked ? "chunked" : "contig", + select ? "sel" : "nosel", mwbuf ? "mwbuf" : "nomwbuf"); /* Create 1d dataset */ if ((did = H5Dcreate2(fid, dset_name, s1_tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -925,7 +972,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, H5D_SELECTION_IO_MODE_ON, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON:H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); /* Copy wbuf if the library will be modifying it */ if (mwbuf) @@ -935,13 +982,12 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Dwrite(did, s1_tid, mspace_id, fspace_id, dxpl, s1_wbuf) < 0) P_TEST_ERROR; + check_io_mode(dxpl, chunked); + /* Restore wbuf from backup if the library modified it */ if (mwbuf) memcpy(s1_wbuf, s1_wbuf_bak, sizeof(s1_t) * DSET_SELECT_DIM); - check_io_mode(dxpl, chunked); - check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); - /* Read all the data from the dataset */ memset(s1_rbuf, 0, sizeof(s1_t) * DSET_SELECT_DIM); if (H5Dread(did, s1_tid, mspace_id, fspace_id, dxpl, s1_rbuf) < 0) @@ -1113,6 +1159,10 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; if (H5Tclose(ss_bc_tid) < 0) P_TEST_ERROR; + if (H5Pclose(dxpl) < 0) + P_TEST_ERROR; + if (H5Pclose(dcpl) < 0) + P_TEST_ERROR; if (H5Dclose(did) < 0) P_TEST_ERROR; @@ -1134,7 +1184,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) * Case 6: Type conversions + some processes have null/empty selections in datasets */ static void -test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) +test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned select, unsigned mwbuf) { int i; hid_t did = H5I_INVALID_HID; @@ -1177,8 +1227,8 @@ test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned } /* Generate dataset name */ - snprintf(dset_name, sizeof(dset_name), "tconv_sel_empty_%s_%s_%s", chunked ? "chunked" : "contig", - dtrans ? "xform" : "noxform", mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_name, sizeof(dset_name), "tconv_sel_empty_%s_%s_%s_%s", chunked ? "chunked" : "contig", + dtrans ? "xform" : "noxform", select ? "sel" : "nosel", mwbuf ? "mwbuf" : "nomwbuf"); /* Create dataset */ if ((did = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -1189,7 +1239,7 @@ test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, H5D_SELECTION_IO_MODE_ON, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) P_TEST_ERROR; @@ -1246,8 +1296,10 @@ test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned if (mwbuf) memcpy(lwbuf, lwbuf_bak, sizeof(lwbuf)); +#ifdef OUT check_io_mode(dxpl, chunked); - check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); +#endif /* Read the data from the dataset: type conversion int-->long */ /* If dtrans, without data transform set in dxpl */ @@ -1402,6 +1454,8 @@ test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned } /* test_type_conv_sel_empty() */ +#ifdef OUT + /* * Test 1 for multi-dataset: * --Datasets with/without type conversion+smaller/larger mem type+no background buffer @@ -3414,6 +3468,7 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) return; } /* test_multi_dsets_all() */ +#endif /* * Test with various test_mode that no selection I/O is performed @@ -3473,13 +3528,13 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ * As the xfer mode is H5FD_MPIO_INDEPENDENT, this will call * H5FD__read/write_from_selection() triggering H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB. */ - no_selection_io_cause_read_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; + // no_selection_io_cause_read_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; /* Exception case: This will turn off selection I/O landing at H5FD__mpio_write() */ if ((test_mode & TEST_TCONV_BUF_TOO_SMALL) && !(test_mode & TEST_IN_PLACE_TCONV)) no_selection_io_cause_write_expected |= H5D_SEL_IO_TCONV_BUF_TOO_SMALL; else - no_selection_io_cause_write_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; + // no_selection_io_cause_write_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) P_TEST_ERROR; @@ -3522,7 +3577,7 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ if (!(test_mode & TEST_DISABLE_BY_API || test_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET || ((test_mode & TEST_TCONV_BUF_TOO_SMALL) && !(test_mode & TEST_IN_PLACE_TCONV)))) - check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + check_actual_selection_io_mode(dxpl, H5D_SELECTION_IO); if (H5Pget_no_selection_io_cause(dxpl, &no_selection_io_cause_write) < 0) P_TEST_ERROR; @@ -3593,6 +3648,7 @@ test_get_no_selection_io_cause(const char *filename, hid_t fapl) test_no_selection_io_cause_mode(filename, fapl, TEST_DISABLE_BY_API); test_no_selection_io_cause_mode(filename, fapl, TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET); +/* CHECK: the following tests: modified to have 0 expected ... things changed */ test_no_selection_io_cause_mode(filename, fapl, TEST_DATATYPE_CONVERSION); test_no_selection_io_cause_mode(filename, fapl, TEST_DATATYPE_CONVERSION | TEST_TCONV_BUF_TOO_SMALL); test_no_selection_io_cause_mode( @@ -3983,6 +4039,7 @@ main(int argc, char *argv[]) int test_select_config; unsigned chunked; unsigned dtrans; + unsigned select; unsigned mwbuf; h5_reset(); @@ -4009,6 +4066,8 @@ main(int argc, char *argv[]) /* therefore, not all tests are run with data transform */ for (dtrans = false; dtrans <= true; dtrans++) { + for (select = false; select <= true; select++) { + /* Test with and without modify_write_buf turned on */ for (mwbuf = false; mwbuf <= true; mwbuf++) { @@ -4023,6 +4082,10 @@ main(int argc, char *argv[]) printf("data transform, "); else printf("without data transform, "); + if (select) + printf("selection I/O ON, "); + else + printf("selection I/O OFF, "); if (mwbuf) printf("and with modifying write buffers\n"); else @@ -4038,7 +4101,7 @@ main(int argc, char *argv[]) if (MAINPROCESS) TESTING_2("No type conversion (null case)"); - test_no_type_conv(fid, chunked, dtrans, mwbuf); + test_no_type_conv(fid, chunked, dtrans, select, mwbuf); break; @@ -4053,7 +4116,7 @@ main(int argc, char *argv[]) continue; } - test_no_size_change_no_bkg(fid, chunked, mwbuf); + test_no_size_change_no_bkg(fid, chunked, select, mwbuf); break; @@ -4061,7 +4124,7 @@ main(int argc, char *argv[]) if (MAINPROCESS) TESTING_2("Larger memory type, no background buffer"); - test_larger_mem_type_no_bkg(fid, chunked, dtrans, mwbuf); + test_larger_mem_type_no_bkg(fid, chunked, dtrans, select, mwbuf); break; @@ -4069,7 +4132,7 @@ main(int argc, char *argv[]) if (MAINPROCESS) TESTING_2("Smaller memory type, no background buffer"); - test_smaller_mem_type_no_bkg(fid, chunked, dtrans, mwbuf); + test_smaller_mem_type_no_bkg(fid, chunked, dtrans, select, mwbuf); break; @@ -4083,7 +4146,7 @@ main(int argc, char *argv[]) continue; } - test_cmpd_with_bkg(fid, chunked, mwbuf); + test_cmpd_with_bkg(fid, chunked, select, mwbuf); break; @@ -4091,9 +4154,10 @@ main(int argc, char *argv[]) if (MAINPROCESS) TESTING_2("Empty selections + Type conversion"); - test_type_conv_sel_empty(fid, chunked, dtrans, mwbuf); + test_type_conv_sel_empty(fid, chunked, dtrans, select, mwbuf); break; +#ifdef OUT case TEST_MULTI_CONV_NO_BKG: /* case 7 */ if (MAINPROCESS) @@ -4152,6 +4216,7 @@ main(int argc, char *argv[]) test_multi_dsets_all(2, fid, chunked, mwbuf); break; +#endif case TEST_SELECT_NTESTS: default: @@ -4164,6 +4229,7 @@ main(int argc, char *argv[]) } /* end mwbuf */ + } /* end select */ } /* end dtrans */ } /* end chunked */ From 09aa92dfa65efafded79a87865cccb4a7a525615 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Thu, 12 Oct 2023 16:02:43 -0500 Subject: [PATCH 26/37] Fix test failures, fix function description --- src/H5CX.c | 3 +-- test/select_io_dset.c | 48 +++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index 6ed492c6db1..2329a392dae 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -2524,8 +2524,7 @@ H5CX_get_no_selection_io_cause(uint32_t *no_selection_io_cause) /*------------------------------------------------------------------------- * Function: H5CX_get_actual_selection_io_mode * - * Purpose: Retrieves the cause for not performing selection I/O - * for the current API call context. + * Purpose: Retrieves the actual I/O mode (scalar, vector, and/or selection) for the current API call context. * * Return: Non-negative on success / Negative on failure * diff --git a/test/select_io_dset.c b/test/select_io_dset.c index ddba7c4ed6a..ec048944586 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -125,7 +125,7 @@ check_actual_selection_io_mode(hid_t dxpl, uint32_t sel_io_mode_expected) * --write/read dataset with H5T_NATIVE_INT */ static herr_t -test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) +test_no_type_conv(hid_t fid, unsigned set_cache, unsigned chunked, unsigned dtrans, unsigned mwbuf) { int i; hid_t did = H5I_INVALID_HID; @@ -198,7 +198,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Restore wbuf from backup if the library modified it */ @@ -210,7 +210,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Verify data or transformed data read */ @@ -275,7 +275,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) * --read again with H5T_STD_I32BE */ static herr_t -test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) +test_no_size_change_no_bkg(hid_t fid, unsigned set_cache, unsigned chunked, unsigned mwbuf) { int i; hid_t did = H5I_INVALID_HID; @@ -351,7 +351,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Restore wbuf from backup if the library modified it */ @@ -363,7 +363,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Verify data read little endian */ @@ -436,7 +436,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) * */ static herr_t -test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) +test_larger_mem_type_no_bkg(hid_t fid, unsigned set_cache, unsigned chunked, unsigned dtrans, unsigned mwbuf) { int i; hid_t did = H5I_INVALID_HID; @@ -509,7 +509,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Restore wbuf from backup if the library modified it */ @@ -521,7 +521,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Verify data or transformed data read */ @@ -586,7 +586,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign * --read dataset with H5T_NATIVE_SHORT */ static herr_t -test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) +test_smaller_mem_type_no_bkg(hid_t fid, unsigned set_cache, unsigned chunked, unsigned dtrans, unsigned mwbuf) { int i; hid_t did = H5I_INVALID_HID; @@ -660,7 +660,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Restore wbuf from backup if the library modified it */ @@ -672,7 +672,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Verify data or transformed data read */ @@ -820,7 +820,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) TEST_ERROR; if (H5Pset_fill_value(dcpl, s1_tid, &fillvalue) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if (chunked) { cdims[0] = DSET_SELECT_CHUNK_DIM; @@ -1077,7 +1077,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) * Datatype for all datasets: H5T_NATIVE_LONG */ static herr_t -test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) +test_multi_dsets_no_bkg(hid_t fid, unsigned set_cache, unsigned chunked, unsigned dtrans, unsigned mwbuf) { size_t ndsets; int i, j; @@ -1223,7 +1223,7 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Restore wbuf from backup if the library modified it */ @@ -1235,7 +1235,7 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Verify */ @@ -1255,7 +1255,7 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Verify */ @@ -1374,7 +1374,7 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m if (total_lrbuf) free(total_lrbuf); if (total_trans_lwbuf) - free(total_lrbuf); + free(total_trans_lwbuf); return FAIL; @@ -2815,7 +2815,7 @@ test_set_get_select_io_mode(const char *filename, hid_t fapl) TESTING("H5Pget/set_selection_io_mode()"); if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - FAIL_STACK_ERROR; + TEST_ERROR; if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; @@ -3264,7 +3264,7 @@ main(void) case TEST_NO_TYPE_CONV: /* case 1 */ TESTING_2("No type conversion (null case)"); - nerrors += (test_no_type_conv(fid, chunked, dtrans, mwbuf) < 0 ? 1 : 0); + nerrors += (test_no_type_conv(fid, set_cache, chunked, dtrans, mwbuf) < 0 ? 1 : 0); break; @@ -3275,7 +3275,7 @@ main(void) if (dtrans) SKIPPED(); else - nerrors += (test_no_size_change_no_bkg(fid, chunked, mwbuf) < 0 ? 1 : 0); + nerrors += (test_no_size_change_no_bkg(fid, set_cache, chunked, mwbuf) < 0 ? 1 : 0); break; @@ -3283,7 +3283,7 @@ main(void) TESTING_2("Larger memory type, no background buffer"); nerrors += - (test_larger_mem_type_no_bkg(fid, chunked, dtrans, mwbuf) < 0 ? 1 : 0); + (test_larger_mem_type_no_bkg(fid, set_cache, chunked, dtrans, mwbuf) < 0 ? 1 : 0); break; @@ -3291,7 +3291,7 @@ main(void) TESTING_2("Smaller memory type, no background buffer"); nerrors += - (test_smaller_mem_type_no_bkg(fid, chunked, dtrans, mwbuf) < 0 ? 1 : 0); + (test_smaller_mem_type_no_bkg(fid, set_cache, chunked, dtrans, mwbuf) < 0 ? 1 : 0); break; @@ -3309,7 +3309,7 @@ main(void) case TEST_MULTI_CONV_NO_BKG: /* case 6 */ TESTING_2("multi-datasets: type conv + no bkg buffer"); - nerrors += test_multi_dsets_no_bkg(fid, chunked, dtrans, mwbuf); + nerrors += test_multi_dsets_no_bkg(fid, set_cache, chunked, dtrans, mwbuf); break; From 45187118ec5e42934279244a0c634a14fafbfe76 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Oct 2023 02:40:59 +0000 Subject: [PATCH 27/37] Committing clang-format changes --- src/H5CX.c | 3 +- test/select_io_dset.c | 23 ++- testpar/t_select_io_dset.c | 400 +++++++++++++++++++------------------ 3 files changed, 220 insertions(+), 206 deletions(-) diff --git a/src/H5CX.c b/src/H5CX.c index 2329a392dae..d6b8e5c06ca 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -2524,7 +2524,8 @@ H5CX_get_no_selection_io_cause(uint32_t *no_selection_io_cause) /*------------------------------------------------------------------------- * Function: H5CX_get_actual_selection_io_mode * - * Purpose: Retrieves the actual I/O mode (scalar, vector, and/or selection) for the current API call context. + * Purpose: Retrieves the actual I/O mode (scalar, vector, and/or selection) for the current API call + *context. * * Return: Non-negative on success / Negative on failure * diff --git a/test/select_io_dset.c b/test/select_io_dset.c index ec048944586..33b1c843d09 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -210,7 +210,7 @@ test_no_type_conv(hid_t fid, unsigned set_cache, unsigned chunked, unsigned dtra TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Verify data or transformed data read */ @@ -363,7 +363,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned set_cache, unsigned chunked, unsi TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Verify data read little endian */ @@ -521,7 +521,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned set_cache, unsigned chunked, uns TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Verify data or transformed data read */ @@ -660,7 +660,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned set_cache, unsigned chunked, un TEST_ERROR; /* Verify selection I/O mode */ - if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) + if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0) TEST_ERROR; /* Restore wbuf from backup if the library modified it */ @@ -3264,7 +3264,8 @@ main(void) case TEST_NO_TYPE_CONV: /* case 1 */ TESTING_2("No type conversion (null case)"); - nerrors += (test_no_type_conv(fid, set_cache, chunked, dtrans, mwbuf) < 0 ? 1 : 0); + nerrors += + (test_no_type_conv(fid, set_cache, chunked, dtrans, mwbuf) < 0 ? 1 : 0); break; @@ -3275,7 +3276,9 @@ main(void) if (dtrans) SKIPPED(); else - nerrors += (test_no_size_change_no_bkg(fid, set_cache, chunked, mwbuf) < 0 ? 1 : 0); + nerrors += + (test_no_size_change_no_bkg(fid, set_cache, chunked, mwbuf) < 0 ? 1 + : 0); break; @@ -3283,7 +3286,9 @@ main(void) TESTING_2("Larger memory type, no background buffer"); nerrors += - (test_larger_mem_type_no_bkg(fid, set_cache, chunked, dtrans, mwbuf) < 0 ? 1 : 0); + (test_larger_mem_type_no_bkg(fid, set_cache, chunked, dtrans, mwbuf) < 0 + ? 1 + : 0); break; @@ -3291,7 +3296,9 @@ main(void) TESTING_2("Smaller memory type, no background buffer"); nerrors += - (test_smaller_mem_type_no_bkg(fid, set_cache, chunked, dtrans, mwbuf) < 0 ? 1 : 0); + (test_smaller_mem_type_no_bkg(fid, set_cache, chunked, dtrans, mwbuf) < 0 + ? 1 + : 0); break; diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index d826862d779..60ff6863687 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -53,12 +53,12 @@ int curr_nerrors = 0; * Test configurations */ typedef enum { - TEST_NO_TYPE_CONV, /* no type conversion (null case) */ - TEST_NO_SIZE_CHANGE_NO_BKG, /* no size change, no bkg buffer */ - TEST_LARGER_MEM_NO_BKG, /* larger memory type, no bkg buffer */ - TEST_SMALLER_MEM_NO_BKG, /* smaller memory type, no bkg buffer */ - TEST_CMPD_WITH_BKG, /* compound types with bkg buffer */ - TEST_TYPE_CONV_SEL_EMPTY, /* some processes have null/empty selections and with type conversion */ + TEST_NO_TYPE_CONV, /* no type conversion (null case) */ + TEST_NO_SIZE_CHANGE_NO_BKG, /* no size change, no bkg buffer */ + TEST_LARGER_MEM_NO_BKG, /* larger memory type, no bkg buffer */ + TEST_SMALLER_MEM_NO_BKG, /* smaller memory type, no bkg buffer */ + TEST_CMPD_WITH_BKG, /* compound types with bkg buffer */ + TEST_TYPE_CONV_SEL_EMPTY, /* some processes have null/empty selections and with type conversion */ #ifdef OUT TEST_MULTI_CONV_NO_BKG, /* multi dataset test 1 */ TEST_MULTI_CONV_BKG, /* multi dataset test 2 */ @@ -199,8 +199,8 @@ testing_check_io_mode(hid_t dxpl, H5D_mpio_actual_io_mode_t exp_io_mode) if (actual_io_mode != exp_io_mode) { nerrors++; if (MAINPROCESS) - printf("\n Failed: Incorrect I/O mode (expected/actual) %u:%u", - (unsigned)exp_io_mode, (unsigned)actual_io_mode); + printf("\n Failed: Incorrect I/O mode (expected/actual) %u:%u", (unsigned)exp_io_mode, + (unsigned)actual_io_mode); } } /* testing_check_io_mode() */ @@ -218,7 +218,7 @@ check_actual_selection_io_mode(hid_t dxpl, uint32_t sel_io_mode_expected) if (actual_sel_io_mode != sel_io_mode_expected) { if (MAINPROCESS) printf("\n Failed: Incorrect selection I/O mode (expected/actual) %u:%u", - (unsigned)sel_io_mode_expected, (unsigned)actual_sel_io_mode); + (unsigned)sel_io_mode_expected, (unsigned)actual_sel_io_mode); P_TEST_ERROR; } } @@ -229,23 +229,23 @@ check_actual_selection_io_mode(hid_t dxpl, uint32_t sel_io_mode_expected) static void test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned select, unsigned mwbuf) { - int i; - hid_t did = H5I_INVALID_HID; - hid_t sid = H5I_INVALID_HID; - hid_t dcpl = H5I_INVALID_HID; - hid_t dxpl = H5I_INVALID_HID; - hid_t ntrans_dxpl = H5I_INVALID_HID; - hid_t fspace_id = H5I_INVALID_HID; - hid_t mspace_id = H5I_INVALID_HID; - hsize_t dims[1]; - hsize_t cdims[1]; - hsize_t start[1], stride[1], count[1], block[1]; - int wbuf[DSET_SELECT_DIM]; - int wbuf_bak[DSET_SELECT_DIM]; - int trans_wbuf[DSET_SELECT_DIM]; - int rbuf[DSET_SELECT_DIM]; - char dset_name[DSET_NAME_LEN]; - const char *expr = "2*x"; + int i; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t dxpl = H5I_INVALID_HID; + hid_t ntrans_dxpl = H5I_INVALID_HID; + hid_t fspace_id = H5I_INVALID_HID; + hid_t mspace_id = H5I_INVALID_HID; + hsize_t dims[1]; + hsize_t cdims[1]; + hsize_t start[1], stride[1], count[1], block[1]; + int wbuf[DSET_SELECT_DIM]; + int wbuf_bak[DSET_SELECT_DIM]; + int trans_wbuf[DSET_SELECT_DIM]; + int rbuf[DSET_SELECT_DIM]; + char dset_name[DSET_NAME_LEN]; + const char *expr = "2*x"; H5D_mpio_actual_io_mode_t exp_io_mode = H5D_MPIO_NO_COLLECTIVE; curr_nerrors = nerrors; @@ -302,7 +302,8 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned select, P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, + H5FD_MPIO_COLLECTIVE_IO, mwbuf); if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) P_TEST_ERROR; @@ -324,11 +325,11 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned select, if (mwbuf) memcpy(wbuf, wbuf_bak, sizeof(wbuf)); - if (!dtrans || select) + if (!dtrans || select) exp_io_mode = chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE; testing_check_io_mode(dxpl, exp_io_mode); - if(chunked && !dtrans) + if (chunked && !dtrans) check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); else check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); @@ -467,7 +468,8 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned select, unsigne P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, + H5FD_MPIO_COLLECTIVE_IO, mwbuf); /* Copy wbuf if the library will be modifying it */ if (mwbuf) @@ -481,7 +483,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned select, unsigne if (mwbuf) memcpy(wbuf, wbuf_bak, (size_t)(4 * DSET_SELECT_DIM)); - if (select) + if (select) exp_io_mode = chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE; testing_check_io_mode(dxpl, exp_io_mode); @@ -546,23 +548,23 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned select, unsigne static void test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned select, unsigned mwbuf) { - int i; - hid_t did = H5I_INVALID_HID; - hid_t sid = H5I_INVALID_HID; - hid_t dcpl = H5I_INVALID_HID; - hid_t dxpl = H5I_INVALID_HID; - hid_t ntrans_dxpl = H5I_INVALID_HID; - hid_t fspace_id = H5I_INVALID_HID; - hid_t mspace_id = H5I_INVALID_HID; - hsize_t dims[1]; - hsize_t cdims[1]; - hsize_t start[1], stride[1], count[1], block[1]; - long wbuf[DSET_SELECT_DIM]; - long wbuf_bak[DSET_SELECT_DIM]; - long trans_wbuf[DSET_SELECT_DIM]; - long long rbuf[DSET_SELECT_DIM]; - char dset_name[DSET_NAME_LEN]; - const char *expr = "100 - x"; + int i; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t dxpl = H5I_INVALID_HID; + hid_t ntrans_dxpl = H5I_INVALID_HID; + hid_t fspace_id = H5I_INVALID_HID; + hid_t mspace_id = H5I_INVALID_HID; + hsize_t dims[1]; + hsize_t cdims[1]; + hsize_t start[1], stride[1], count[1], block[1]; + long wbuf[DSET_SELECT_DIM]; + long wbuf_bak[DSET_SELECT_DIM]; + long trans_wbuf[DSET_SELECT_DIM]; + long long rbuf[DSET_SELECT_DIM]; + char dset_name[DSET_NAME_LEN]; + const char *expr = "100 - x"; H5D_mpio_actual_io_mode_t exp_io_mode = H5D_MPIO_NO_COLLECTIVE; curr_nerrors = nerrors; @@ -616,7 +618,8 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, + H5FD_MPIO_COLLECTIVE_IO, mwbuf); if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) P_TEST_ERROR; @@ -638,7 +641,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign if (mwbuf) memcpy(wbuf, wbuf_bak, sizeof(wbuf)); - if (select) + if (select) exp_io_mode = chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE; testing_check_io_mode(dxpl, exp_io_mode); @@ -699,23 +702,23 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign static void test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned select, unsigned mwbuf) { - int i; - hid_t did = H5I_INVALID_HID; - hid_t sid = H5I_INVALID_HID; - hid_t dcpl = H5I_INVALID_HID; - hid_t dxpl = H5I_INVALID_HID; - hid_t ntrans_dxpl = H5I_INVALID_HID; - hid_t fspace_id = H5I_INVALID_HID; - hid_t mspace_id = H5I_INVALID_HID; - hsize_t dims[1]; - hsize_t cdims[1]; - hsize_t start[1], stride[1], count[1], block[1]; - short wbuf[DSET_SELECT_DIM]; - int wbuf_bak[DSET_SELECT_DIM]; - short trans_wbuf[DSET_SELECT_DIM]; - short rbuf[DSET_SELECT_DIM]; - char dset_name[DSET_NAME_LEN]; - const char *expr = "2 * (10 + x)"; + int i; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t dcpl = H5I_INVALID_HID; + hid_t dxpl = H5I_INVALID_HID; + hid_t ntrans_dxpl = H5I_INVALID_HID; + hid_t fspace_id = H5I_INVALID_HID; + hid_t mspace_id = H5I_INVALID_HID; + hsize_t dims[1]; + hsize_t cdims[1]; + hsize_t start[1], stride[1], count[1], block[1]; + short wbuf[DSET_SELECT_DIM]; + int wbuf_bak[DSET_SELECT_DIM]; + short trans_wbuf[DSET_SELECT_DIM]; + short rbuf[DSET_SELECT_DIM]; + char dset_name[DSET_NAME_LEN]; + const char *expr = "2 * (10 + x)"; H5D_mpio_actual_io_mode_t exp_io_mode = H5D_MPIO_NO_COLLECTIVE; curr_nerrors = nerrors; @@ -769,7 +772,8 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, + H5FD_MPIO_COLLECTIVE_IO, mwbuf); if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) P_TEST_ERROR; @@ -972,7 +976,8 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned select, unsigned mwbuf) P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON:H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, + H5FD_MPIO_COLLECTIVE_IO, mwbuf); /* Copy wbuf if the library will be modifying it */ if (mwbuf) @@ -1239,7 +1244,8 @@ test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, + H5FD_MPIO_COLLECTIVE_IO, mwbuf); if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) P_TEST_ERROR; @@ -3528,16 +3534,16 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ * As the xfer mode is H5FD_MPIO_INDEPENDENT, this will call * H5FD__read/write_from_selection() triggering H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB. */ - // no_selection_io_cause_read_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; + // no_selection_io_cause_read_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; /* Exception case: This will turn off selection I/O landing at H5FD__mpio_write() */ if ((test_mode & TEST_TCONV_BUF_TOO_SMALL) && !(test_mode & TEST_IN_PLACE_TCONV)) no_selection_io_cause_write_expected |= H5D_SEL_IO_TCONV_BUF_TOO_SMALL; else - // no_selection_io_cause_write_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; + // no_selection_io_cause_write_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; - if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) - P_TEST_ERROR; + if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) + P_TEST_ERROR; tid = H5T_NATIVE_UINT; /* If we're testing a too small tconv buffer, set the buffer to be too small */ @@ -3648,7 +3654,7 @@ test_get_no_selection_io_cause(const char *filename, hid_t fapl) test_no_selection_io_cause_mode(filename, fapl, TEST_DISABLE_BY_API); test_no_selection_io_cause_mode(filename, fapl, TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET); -/* CHECK: the following tests: modified to have 0 expected ... things changed */ + /* CHECK: the following tests: modified to have 0 expected ... things changed */ test_no_selection_io_cause_mode(filename, fapl, TEST_DATATYPE_CONVERSION); test_no_selection_io_cause_mode(filename, fapl, TEST_DATATYPE_CONVERSION | TEST_TCONV_BUF_TOO_SMALL); test_no_selection_io_cause_mode( @@ -4066,172 +4072,172 @@ main(int argc, char *argv[]) /* therefore, not all tests are run with data transform */ for (dtrans = false; dtrans <= true; dtrans++) { - for (select = false; select <= true; select++) { - - /* Test with and without modify_write_buf turned on */ - for (mwbuf = false; mwbuf <= true; mwbuf++) { - - if (MAINPROCESS) { - /* Print configuration message */ - printf("Testing for selection I/O "); - if (chunked) - printf("with chunked dataset, "); - else - printf("with contiguous dataset, "); - if (dtrans) - printf("data transform, "); - else - printf("without data transform, "); - if (select) - printf("selection I/O ON, "); - else - printf("selection I/O OFF, "); - if (mwbuf) - printf("and with modifying write buffers\n"); - else - printf("and without modifying write buffers\n"); - } + for (select = false; select <= true; select++) { + + /* Test with and without modify_write_buf turned on */ + for (mwbuf = false; mwbuf <= true; mwbuf++) { + + if (MAINPROCESS) { + /* Print configuration message */ + printf("Testing for selection I/O "); + if (chunked) + printf("with chunked dataset, "); + else + printf("with contiguous dataset, "); + if (dtrans) + printf("data transform, "); + else + printf("without data transform, "); + if (select) + printf("selection I/O ON, "); + else + printf("selection I/O OFF, "); + if (mwbuf) + printf("and with modifying write buffers\n"); + else + printf("and without modifying write buffers\n"); + } + + for (test_select_config = (int)TEST_NO_TYPE_CONV; + test_select_config < (int)TEST_SELECT_NTESTS; test_select_config++) { + + switch (test_select_config) { + + case TEST_NO_TYPE_CONV: /* case 1 */ + if (MAINPROCESS) + TESTING_2("No type conversion (null case)"); - for (test_select_config = (int)TEST_NO_TYPE_CONV; - test_select_config < (int)TEST_SELECT_NTESTS; test_select_config++) { + test_no_type_conv(fid, chunked, dtrans, select, mwbuf); - switch (test_select_config) { + break; - case TEST_NO_TYPE_CONV: /* case 1 */ - if (MAINPROCESS) - TESTING_2("No type conversion (null case)"); + case TEST_NO_SIZE_CHANGE_NO_BKG: /* case 2 */ + if (MAINPROCESS) + TESTING_2("No size change, no background buffer"); - test_no_type_conv(fid, chunked, dtrans, select, mwbuf); + /* Data transforms does not apply to the dataset datatype for this test */ + if (dtrans) { + if (MAINPROCESS) + SKIPPED(); + continue; + } - break; + test_no_size_change_no_bkg(fid, chunked, select, mwbuf); - case TEST_NO_SIZE_CHANGE_NO_BKG: /* case 2 */ - if (MAINPROCESS) - TESTING_2("No size change, no background buffer"); + break; - /* Data transforms does not apply to the dataset datatype for this test */ - if (dtrans) { + case TEST_LARGER_MEM_NO_BKG: /* case 3 */ if (MAINPROCESS) - SKIPPED(); - continue; - } - - test_no_size_change_no_bkg(fid, chunked, select, mwbuf); - - break; + TESTING_2("Larger memory type, no background buffer"); - case TEST_LARGER_MEM_NO_BKG: /* case 3 */ - if (MAINPROCESS) - TESTING_2("Larger memory type, no background buffer"); + test_larger_mem_type_no_bkg(fid, chunked, dtrans, select, mwbuf); - test_larger_mem_type_no_bkg(fid, chunked, dtrans, select, mwbuf); - - break; + break; - case TEST_SMALLER_MEM_NO_BKG: /* case 4 */ - if (MAINPROCESS) - TESTING_2("Smaller memory type, no background buffer"); + case TEST_SMALLER_MEM_NO_BKG: /* case 4 */ + if (MAINPROCESS) + TESTING_2("Smaller memory type, no background buffer"); - test_smaller_mem_type_no_bkg(fid, chunked, dtrans, select, mwbuf); + test_smaller_mem_type_no_bkg(fid, chunked, dtrans, select, mwbuf); - break; + break; - case TEST_CMPD_WITH_BKG: /* case 5 */ - if (MAINPROCESS) - TESTING_2("Compound types with background buffer"); - /* Data transforms does not apply to the dataset datatype for this test */ - if (dtrans) { + case TEST_CMPD_WITH_BKG: /* case 5 */ if (MAINPROCESS) - SKIPPED(); - continue; - } + TESTING_2("Compound types with background buffer"); + /* Data transforms does not apply to the dataset datatype for this test */ + if (dtrans) { + if (MAINPROCESS) + SKIPPED(); + continue; + } - test_cmpd_with_bkg(fid, chunked, select, mwbuf); + test_cmpd_with_bkg(fid, chunked, select, mwbuf); - break; + break; - case TEST_TYPE_CONV_SEL_EMPTY: /* case 6 */ - if (MAINPROCESS) - TESTING_2("Empty selections + Type conversion"); + case TEST_TYPE_CONV_SEL_EMPTY: /* case 6 */ + if (MAINPROCESS) + TESTING_2("Empty selections + Type conversion"); - test_type_conv_sel_empty(fid, chunked, dtrans, select, mwbuf); + test_type_conv_sel_empty(fid, chunked, dtrans, select, mwbuf); - break; + break; #ifdef OUT - case TEST_MULTI_CONV_NO_BKG: /* case 7 */ - if (MAINPROCESS) - TESTING_2("multi-datasets: type conv + no bkg buffer"); - - test_multi_dsets_no_bkg(fid, chunked, dtrans, mwbuf); + case TEST_MULTI_CONV_NO_BKG: /* case 7 */ + if (MAINPROCESS) + TESTING_2("multi-datasets: type conv + no bkg buffer"); - break; + test_multi_dsets_no_bkg(fid, chunked, dtrans, mwbuf); - case TEST_MULTI_CONV_BKG: /* case 8 */ - if (MAINPROCESS) - TESTING_2("multi-datasets: type conv + bkg buffer"); + break; - /* Data transforms does not apply to the dataset datatype for this test */ - if (dtrans) { + case TEST_MULTI_CONV_BKG: /* case 8 */ if (MAINPROCESS) - SKIPPED(); - } - else - test_multi_dsets_cmpd_with_bkg(fid, chunked, mwbuf); + TESTING_2("multi-datasets: type conv + bkg buffer"); - break; + /* Data transforms does not apply to the dataset datatype for this test */ + if (dtrans) { + if (MAINPROCESS) + SKIPPED(); + } + else + test_multi_dsets_cmpd_with_bkg(fid, chunked, mwbuf); - case TEST_MULTI_CONV_SIZE_CHANGE: /* case 9 */ - if (MAINPROCESS) - TESTING_2("multi-datasets: type conv + size change + no bkg buffer"); + break; - /* Data transforms does not apply to the dataset datatype for this test */ - if (dtrans) { + case TEST_MULTI_CONV_SIZE_CHANGE: /* case 9 */ if (MAINPROCESS) - SKIPPED(); - } - else - test_multi_dsets_size_change_no_bkg(fid, chunked, mwbuf); + TESTING_2("multi-datasets: type conv + size change + no bkg buffer"); - break; + /* Data transforms does not apply to the dataset datatype for this test */ + if (dtrans) { + if (MAINPROCESS) + SKIPPED(); + } + else + test_multi_dsets_size_change_no_bkg(fid, chunked, mwbuf); - case TEST_MULTI_CONV_SEL_EMPTY: /* case 10 */ - if (MAINPROCESS) - TESTING_2("multi-datasets: type conv + empty selections"); + break; - test_multi_dsets_conv_sel_empty(fid, chunked, dtrans, mwbuf); + case TEST_MULTI_CONV_SEL_EMPTY: /* case 10 */ + if (MAINPROCESS) + TESTING_2("multi-datasets: type conv + empty selections"); - break; + test_multi_dsets_conv_sel_empty(fid, chunked, dtrans, mwbuf); - case TEST_MULTI_ALL: /* case 11 */ - if (MAINPROCESS) - TESTING_2("multi-datasets: no conv + conv without bkg + conv with bkg"); + break; - /* Data transforms does not apply to the dataset datatype for this test */ - if (dtrans) { + case TEST_MULTI_ALL: /* case 11 */ if (MAINPROCESS) - SKIPPED(); - } - else - test_multi_dsets_all(2, fid, chunked, mwbuf); + TESTING_2("multi-datasets: no conv + conv without bkg + conv with bkg"); + + /* Data transforms does not apply to the dataset datatype for this test */ + if (dtrans) { + if (MAINPROCESS) + SKIPPED(); + } + else + test_multi_dsets_all(2, fid, chunked, mwbuf); - break; + break; #endif - case TEST_SELECT_NTESTS: - default: - P_TEST_ERROR; - break; + case TEST_SELECT_NTESTS: + default: + P_TEST_ERROR; + break; - } /* end switch */ + } /* end switch */ - } /* end for test_select_config */ + } /* end for test_select_config */ - } /* end mwbuf */ + } /* end mwbuf */ - } /* end select */ - } /* end dtrans */ - } /* end chunked */ + } /* end select */ + } /* end dtrans */ + } /* end chunked */ if (H5Fclose(fid) < 0) P_TEST_ERROR; From 74aa0caba9cfc9dd14720f3f1441666483372f2c Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Thu, 19 Oct 2023 14:52:41 -0500 Subject: [PATCH 28/37] Add tests to t_select_io_dset and t_filters_parallel, only report I/O mode if at least one byte selected --- src/H5FDint.c | 4 +- testpar/t_filters_parallel.c | 447 +++++++++++++++++++++-------------- testpar/t_select_io_dset.c | 345 ++++++++++++++------------- 3 files changed, 448 insertions(+), 348 deletions(-) diff --git a/src/H5FDint.c b/src/H5FDint.c index f50ac9fe046..cd8006f2948 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -259,7 +259,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, void *buf /* HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW) { + if (type == H5FD_MEM_DRAW && size > 0) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_SCALAR_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); @@ -318,7 +318,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, const void HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW) { + if (type == H5FD_MEM_DRAW && size > 0) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_SCALAR_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 12156bbe669..8dfae04ab7d 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -70,7 +70,7 @@ typedef void (*test_func)(const char *parent_group, H5Z_filter_t filter_id, hid_ static herr_t set_dcpl_filter(hid_t dcpl_id, H5Z_filter_t filter_id, filter_options_t *filter_options); static void verify_space_alloc_status(size_t num_dsets, hid_t *dset_ids, hid_t dcpl_id, num_chunks_written_t chunks_written); -static void verify_chunk_opt_status(size_t num_dsets, hid_t dxpl_id); +static void verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bool any_filters, bool collective, bool unalloc_read, bool did_alloc, hid_t dxpl_id); static const char *test_mode_to_string(test_mode_t test_mode); static void create_datasets(hid_t parent_obj_id, const char *dset_name, hid_t type_id, hid_t filespace_id, @@ -78,9 +78,9 @@ static void create_datasets(hid_t parent_obj_id, const char *dset_name, hid_t ty static void open_datasets(hid_t parent_obj_id, const char *dset_name, size_t num_dsets, test_mode_t test_mode, hid_t *dset_ids); static void write_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id, - hid_t *fspace_ids, hid_t dxpl_id, const void **bufs, test_mode_t test_mode); + hid_t *fspace_ids, hid_t dcpl_id, hid_t dxpl_id, const void **bufs, test_mode_t test_mode, bool any_io, bool collective, bool overwrite); static void read_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id, hid_t fspace_id, - hid_t dxpl_id, void **bufs, test_mode_t test_mode); + hid_t dcpl_id, hid_t dxpl_id, void **bufs, test_mode_t test_mode, bool any_io, bool collective, bool all_uninit_read); static void select_hyperslab(size_t num_dsets, hid_t *dset_ids, hsize_t *start, hsize_t *stride, hsize_t *count, hsize_t *block, hid_t *fspace_ids); @@ -469,11 +469,14 @@ verify_space_alloc_status(size_t num_dsets, hid_t *dset_ids, hid_t dcpl_id, * I/O was performed. */ static void -verify_chunk_opt_status(size_t num_dsets, hid_t dxpl_id) +verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bool any_filters, bool collective, bool unalloc_read, bool did_alloc, hid_t dxpl_id) { H5D_mpio_actual_chunk_opt_mode_t chunk_opt_mode; H5D_selection_io_mode_t sel_io_mode; + uint32_t actual_sel_io_mode; + uint32_t actual_sel_io_mode_reduced; uint32_t no_sel_io_cause = 0; + int mpi_code; herr_t ret; if (H5P_DEFAULT != dxpl_id) { @@ -526,6 +529,62 @@ verify_chunk_opt_status(size_t num_dsets, hid_t dxpl_id) "verified I/O optimization was linked-chunk I/O"); } } + + /* Verify actual selection I/O mode */ + ret = H5Pget_actual_selection_io_mode(dxpl_id, &actual_sel_io_mode); + VRFY((ret >= 0), "H5Pget_actual_selection_io_mode succeeded"); + + /* Reduce results to process 0 (bitwise OR so we get all I/O types) */ + mpi_code = MPI_Reduce(&actual_sel_io_mode, &actual_sel_io_mode_reduced, 1, MPI_UINT32_T, MPI_BOR, 0, comm); + VRFY((MPI_SUCCESS == mpi_code), "MPI_Reduce succeeded"); + + /* Verify selection I/O mode on rank 0 */ + if (mpi_rank == 0) { + if (!any_io) { + if (did_alloc) + VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); + else + VRFY(0 == actual_sel_io_mode_reduced, "verified actual selection I/O mode was 0 (no I/O)"); + } + else if (!any_filters) { + assert(!unalloc_read && !did_alloc); + if (sel_io_mode == H5D_SELECTION_IO_MODE_DEFAULT || sel_io_mode == H5D_SELECTION_IO_MODE_ON) + VRFY(H5D_SELECTION_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was selection I/O"); + else + VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); + } + else if (!collective) { + if (unalloc_read) + VRFY(0 == actual_sel_io_mode_reduced, "verified actual selection I/O mode was 0 (no I/O)"); + else + VRFY(H5D_SCALAR_IO ==actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); + } + else + switch (test_mode) { + case USE_SINGLE_DATASET: + case USE_MULTIPLE_DATASETS: + if (did_alloc) + VRFY((H5D_SCALAR_IO | H5D_VECTOR_IO) == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar and vector I/O"); + else if (unalloc_read) + VRFY(0 == actual_sel_io_mode_reduced, "verified actual selection I/O mode was 0 (no I/O)"); + else + VRFY(H5D_VECTOR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was vector I/O"); + break; + + case USE_MULTIPLE_DATASETS_MIXED_FILTERED: + if (unalloc_read) + VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); + else + VRFY((H5D_SCALAR_IO | H5D_VECTOR_IO) == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar and vector I/O"); + break; + + case TEST_MODE_SENTINEL: + default: + printf("Invalid test mode\n"); + fflush(stdout); + MPI_Abort(MPI_COMM_WORLD, -1); + } + } } } @@ -691,10 +750,11 @@ open_datasets(hid_t parent_obj_id, const char *dset_name, size_t num_dsets, test */ static void write_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id, hid_t *fspace_ids, - hid_t dxpl_id, const void **bufs, test_mode_t test_mode) + hid_t dcpl_id, hid_t dxpl_id, const void **bufs, test_mode_t test_mode, bool any_io, bool collective, bool overwrite) { hid_t mem_type_ids[MAX_NUM_DSETS_MULTI]; hid_t mem_space_ids[MAX_NUM_DSETS_MULTI]; + H5D_alloc_time_t alloc_time = H5D_ALLOC_TIME_DEFAULT; for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { mem_type_ids[dset_idx] = type_id; @@ -722,7 +782,10 @@ write_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id MPI_Abort(MPI_COMM_WORLD, -1); } - verify_chunk_opt_status(num_dsets, dxpl_id); + if (!overwrite) + VRFY(H5Pget_alloc_time(dcpl_id, &alloc_time) >= 0, "H5Pget_alloc_time succeeded"); + + verify_chunk_opt_status(num_dsets, test_mode, any_io, true, collective, false, !overwrite && (alloc_time == H5D_ALLOC_TIME_LATE), dxpl_id); } /* @@ -731,11 +794,12 @@ write_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id */ static void read_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id, hid_t fspace_id, - hid_t dxpl_id, void **bufs, test_mode_t test_mode) + hid_t dcpl_id, hid_t dxpl_id, void **bufs, test_mode_t test_mode, bool any_io, bool collective, bool all_uninit_read) { hid_t mem_type_ids[MAX_NUM_DSETS_MULTI]; hid_t mem_space_ids[MAX_NUM_DSETS_MULTI]; hid_t file_space_ids[MAX_NUM_DSETS_MULTI]; + H5D_alloc_time_t alloc_time = H5D_ALLOC_TIME_DEFAULT; for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { mem_type_ids[dset_idx] = type_id; @@ -764,7 +828,10 @@ read_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id, MPI_Abort(MPI_COMM_WORLD, -1); } - verify_chunk_opt_status(num_dsets, dxpl_id); + if (all_uninit_read) + VRFY(H5Pget_alloc_time(dcpl_id, &alloc_time) >= 0, "H5Pget_alloc_time succeeded"); + + verify_chunk_opt_status(num_dsets, test_mode, any_io, true, collective, all_uninit_read && (alloc_time == H5D_ALLOC_TIME_INCR || alloc_time == H5D_ALLOC_TIME_LATE), false, dxpl_id); } static void @@ -938,8 +1005,8 @@ test_write_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t fil data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -971,7 +1038,7 @@ test_write_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t fil (C_DATATYPE)dset_idx; } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -1092,8 +1159,8 @@ test_write_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fi data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -1122,7 +1189,7 @@ test_write_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fi (j / (dataset_dims[0] / (hsize_t)mpi_size * dataset_dims[1])) + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -1243,8 +1310,8 @@ test_write_filtered_dataset_no_overlap_partial(const char *parent_group, H5Z_fil data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -1281,7 +1348,7 @@ test_write_filtered_dataset_no_overlap_partial(const char *parent_group, H5Z_fil } } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -1402,8 +1469,8 @@ test_write_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filte data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -1434,7 +1501,7 @@ test_write_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filte dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -1565,8 +1632,8 @@ test_write_filtered_dataset_single_unlim_dim_no_overlap(const char *parent_group select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, i > 0); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -1580,8 +1647,8 @@ test_write_filtered_dataset_single_unlim_dim_no_overlap(const char *parent_group for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(read_bufs[dset_idx], 255, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Verify the correct data was written */ for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) @@ -1725,8 +1792,8 @@ test_write_filtered_dataset_single_unlim_dim_overlap(const char *parent_group, H select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, i > 0); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -1740,8 +1807,8 @@ test_write_filtered_dataset_single_unlim_dim_overlap(const char *parent_group, H for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(read_bufs[dset_idx], 255, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Verify the correct data was written */ for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) @@ -1891,8 +1958,8 @@ test_write_filtered_dataset_multi_unlim_dim_no_overlap(const char *parent_group, select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, i > 0); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -1906,8 +1973,8 @@ test_write_filtered_dataset_multi_unlim_dim_no_overlap(const char *parent_group, for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(read_bufs[dset_idx], 255, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Verify the correct data was written */ for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) @@ -2060,8 +2127,8 @@ test_write_filtered_dataset_multi_unlim_dim_overlap(const char *parent_group, H5 select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, i > 0); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -2075,8 +2142,8 @@ test_write_filtered_dataset_multi_unlim_dim_overlap(const char *parent_group, H5 for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(read_bufs[dset_idx], 255, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Verify the correct data was written */ for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) @@ -2129,6 +2196,7 @@ test_write_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fi hid_t fapl_id, hid_t dcpl_id, hid_t dxpl_id, test_mode_t test_mode) { + H5D_alloc_time_t alloc_time; C_DATATYPE *correct_bufs[MAX_NUM_DSETS_MULTI] = {0}; const void *data_bufs[MAX_NUM_DSETS_MULTI] = {0}; void *data_bufs_nc[MAX_NUM_DSETS_MULTI] = {0}; /* non-const buffer pointers for freeing */ @@ -2151,6 +2219,8 @@ test_write_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fi if (MAINPROCESS) puts("Testing write to filtered chunks with a single process having no selection"); + VRFY((H5Pget_alloc_time(dcpl_id, &alloc_time) >= 0), "H5Pget_alloc_time succeeded"); + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, fapl_id); VRFY((file_id >= 0), "Test file open succeeded"); @@ -2224,8 +2294,8 @@ test_write_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fi } } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, mpi_size > 1, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -2265,7 +2335,7 @@ test_write_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fi } } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, mpi_size == 1 && alloc_time == H5D_ALLOC_TIME_INCR); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -2303,6 +2373,7 @@ static void test_write_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id, hid_t dcpl_id, hid_t dxpl_id, test_mode_t test_mode) { + H5D_alloc_time_t alloc_time; C_DATATYPE *correct_bufs[MAX_NUM_DSETS_MULTI] = {0}; const void *data_bufs[MAX_NUM_DSETS_MULTI] = {0}; void *data_bufs_nc[MAX_NUM_DSETS_MULTI] = {0}; /* non-const buffer pointers for freeing */ @@ -2320,6 +2391,8 @@ test_write_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filte if (MAINPROCESS) puts("Testing write to filtered chunks with all processes having no selection"); + VRFY((H5Pget_alloc_time(dcpl_id, &alloc_time) >= 0), "H5Pget_alloc_time succeeded"); + file_id = H5Fopen(filenames[0], H5F_ACC_RDWR, fapl_id); VRFY((file_id >= 0), "Test file open succeeded"); @@ -2370,8 +2443,8 @@ test_write_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filte data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, false, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -2395,7 +2468,7 @@ test_write_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filte VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, alloc_time == H5D_ALLOC_TIME_INCR); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -2512,8 +2585,8 @@ test_write_filtered_dataset_point_selection(const char *parent_group, H5Z_filter data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -2545,7 +2618,7 @@ test_write_filtered_dataset_point_selection(const char *parent_group, H5Z_filter dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -2671,8 +2744,8 @@ test_write_filtered_dataset_interleaved_write(const char *parent_group, H5Z_filt data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -2713,7 +2786,7 @@ test_write_filtered_dataset_interleaved_write(const char *parent_group, H5Z_filt + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -2850,8 +2923,8 @@ test_write_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z /* Set data transform expression */ VRFY((H5Pset_data_transform(plist_id, "x") >= 0), "Set data transform expression succeeded"); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, plist_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, plist_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -2885,7 +2958,7 @@ test_write_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z (j / (dataset_dims[0] / (hsize_t)mpi_size * dataset_dims[1])) + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -3014,8 +3087,8 @@ test_write_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_grou data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -3044,7 +3117,7 @@ test_write_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_grou (C_DATATYPE)((j % (hsize_t)mpi_size) + (j / (hsize_t)mpi_size) + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -3174,8 +3247,8 @@ test_write_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -3204,7 +3277,7 @@ test_write_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H (j / (dataset_dims[0] * dataset_dims[1])) + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -3331,8 +3404,8 @@ test_write_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fi data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -3378,7 +3451,7 @@ test_write_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fi + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -3522,7 +3595,7 @@ test_write_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, test_mode); + write_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -3555,7 +3628,7 @@ test_write_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group } } - read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -3700,7 +3773,7 @@ test_write_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, test_mode); + write_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -3736,7 +3809,7 @@ test_write_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, } } - read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -3795,6 +3868,7 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_gro hid_t group_id = H5I_INVALID_HID; hid_t filetype = H5I_INVALID_HID, memtype = H5I_INVALID_HID; hid_t filespace = H5I_INVALID_HID; + H5D_alloc_time_t alloc_time; if (MAINPROCESS) puts("Testing write to unshared filtered chunks in Compound Datatype dataset with Datatype " @@ -3829,6 +3903,9 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_gro dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); + /* Retrieve allocation time */ + VRFY((H5Pget_alloc_time(dcpl_id, &alloc_time) >= 0), "H5Pget_alloc_time succeeded"); + /* Create chunked dataset */ plist_id = H5Pcopy(dcpl_id); VRFY((plist_id >= 0), "DCPL copy succeeded"); @@ -3913,7 +3990,7 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_gro * of the H5Dwrite loop: */ /* write_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids, - dxpl_id, data_bufs, test_mode); */ + dcpl_id, dxpl_id, data_bufs, test_mode, true, true, false); */ for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { herr_t expected = FAIL; herr_t ret; @@ -3956,9 +4033,9 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_gro VRFY((ret == expected), "Dataset write"); if (expected == SUCCEED) - verify_chunk_opt_status(1, dxpl_id); + verify_chunk_opt_status(1, test_mode, true, false, true, false, false, dxpl_id); else - verify_chunk_opt_status(0, dxpl_id); + verify_chunk_opt_status(0, test_mode, false, true, true, false, alloc_time == H5D_ALLOC_TIME_LATE, dxpl_id); } for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) @@ -3984,7 +4061,8 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_gro VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + /* If some writes succeeded (due to mixed filtered mode) or if allocation time is late, then there is data on disk to be read */ + read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, false, !(test_mode == USE_MULTIPLE_DATASETS_MIXED_FILTERED || alloc_time == H5D_ALLOC_TIME_LATE)); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { hid_t dset_dcpl; @@ -4064,6 +4142,7 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group hid_t group_id = H5I_INVALID_HID; hid_t filetype = H5I_INVALID_HID, memtype = H5I_INVALID_HID; hid_t filespace = H5I_INVALID_HID; + H5D_alloc_time_t alloc_time; if (MAINPROCESS) puts("Testing write to shared filtered chunks in Compound Datatype dataset with Datatype conversion"); @@ -4097,6 +4176,9 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group dataset_dims, NULL); VRFY((filespace >= 0), "File dataspace creation succeeded"); + /* Retrieve allocation time */ + VRFY((H5Pget_alloc_time(dcpl_id, &alloc_time) >= 0), "H5Pget_alloc_time succeeded"); + /* Create chunked dataset */ plist_id = H5Pcopy(dcpl_id); VRFY((plist_id >= 0), "DCPL copy succeeded"); @@ -4181,7 +4263,7 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group * of the H5Dwrite loop: */ /* write_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids, - dxpl_id, data_bufs, test_mode); */ + dcpl_id, dxpl_id, data_bufs, test_mode, true, true, false); */ for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { herr_t expected = FAIL; herr_t ret; @@ -4224,9 +4306,9 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group VRFY((ret == expected), "Dataset write"); if (expected == SUCCEED) - verify_chunk_opt_status(1, dxpl_id); + verify_chunk_opt_status(1, test_mode, true, false, true, false, false, dxpl_id); else - verify_chunk_opt_status(0, dxpl_id); + verify_chunk_opt_status(0, test_mode, false, true, true, false, alloc_time == H5D_ALLOC_TIME_LATE, dxpl_id); } for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) @@ -4252,7 +4334,8 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + /* If some writes succeeded (due to mixed filtered mode) or if allocation time is late, then there is data on disk to be read */ + read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, false, !(test_mode == USE_MULTIPLE_DATASETS_MIXED_FILTERED || alloc_time == H5D_ALLOC_TIME_LATE)); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { hid_t dset_dcpl; @@ -4417,8 +4500,8 @@ test_read_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t filt select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -4473,8 +4556,8 @@ test_read_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t filt VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -4637,8 +4720,8 @@ test_read_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fil select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -4693,8 +4776,8 @@ test_read_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fil VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -4859,8 +4942,8 @@ test_read_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filter select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -4915,8 +4998,8 @@ test_read_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filter VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -5105,8 +5188,8 @@ test_read_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fil select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -5171,8 +5254,8 @@ test_read_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fil } } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, mpi_size > 1 ? true : false, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -5337,8 +5420,8 @@ test_read_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filter select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -5383,8 +5466,8 @@ test_read_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filter for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(data_bufs_nc[dset_idx], 0, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, false, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], data_bufs[dset_idx], data_size)), @@ -5527,8 +5610,8 @@ test_read_filtered_dataset_point_selection(const char *parent_group, H5Z_filter_ select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -5584,8 +5667,8 @@ test_read_filtered_dataset_point_selection(const char *parent_group, H5Z_filter_ VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -5782,8 +5865,8 @@ test_read_filtered_dataset_interleaved_read(const char *parent_group, H5Z_filter select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -5840,8 +5923,8 @@ test_read_filtered_dataset_interleaved_read(const char *parent_group, H5Z_filter VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -6023,8 +6106,8 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_group select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -6087,8 +6170,8 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_group VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -6280,8 +6363,8 @@ test_read_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z_ select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); @@ -6347,8 +6430,8 @@ test_read_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z_ VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -6516,8 +6599,8 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H5 select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -6579,8 +6662,8 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H5 VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -6763,8 +6846,8 @@ test_read_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fil select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -6824,8 +6907,8 @@ test_read_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fil VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -7033,7 +7116,7 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group, select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, test_mode); + write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -7089,7 +7172,7 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group, VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -7283,7 +7366,7 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, H select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, test_mode); + write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -7339,7 +7422,7 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, H VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -7536,7 +7619,7 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_grou select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, test_mode); + write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -7592,7 +7675,7 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_grou VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, test_mode, true, false, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -7795,7 +7878,7 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group, select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, test_mode); + write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -7851,7 +7934,7 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group, VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, test_mode, true, false, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -8004,8 +8087,8 @@ test_write_serial_read_parallel(const char *parent_group, H5Z_filter_t filter_id select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, H5P_DEFAULT, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -8049,7 +8132,7 @@ test_write_serial_read_parallel(const char *parent_group, H5Z_filter_t filter_id open_datasets(group_id, WRITE_SERIAL_READ_PARALLEL_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -8175,8 +8258,8 @@ test_write_parallel_read_serial(const char *parent_group, H5Z_filter_t filter_id data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -8226,8 +8309,8 @@ test_write_parallel_read_serial(const char *parent_group, H5Z_filter_t filter_id (j / (dataset_dims[0] * dataset_dims[1])) + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, H5P_DEFAULT, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -8364,8 +8447,8 @@ test_shrinking_growing_chunks(const char *parent_group, H5Z_filter_t filter_id, } } - write_datasets(num_dsets, dset_ids, H5T_NATIVE_DOUBLE, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, H5T_NATIVE_DOUBLE, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, i > 0); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -8379,8 +8462,8 @@ test_shrinking_growing_chunks(const char *parent_group, H5Z_filter_t filter_id, } } - read_datasets(num_dsets, dset_ids, H5T_NATIVE_DOUBLE, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, H5T_NATIVE_DOUBLE, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], data_bufs[dset_idx], data_size)), @@ -8509,8 +8592,8 @@ test_edge_chunks_no_overlap(const char *parent_group, H5Z_filter_t filter_id, hi read_bufs[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, @@ -8523,8 +8606,8 @@ test_edge_chunks_no_overlap(const char *parent_group, H5Z_filter_t filter_id, hi /* Verify the correct data was written */ open_datasets(group_id, WRITE_UNSHARED_FILTERED_EDGE_CHUNKS_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], data_bufs[dset_idx], data_size)), @@ -8568,8 +8651,8 @@ test_edge_chunks_no_overlap(const char *parent_group, H5Z_filter_t filter_id, hi select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, @@ -8585,8 +8668,8 @@ test_edge_chunks_no_overlap(const char *parent_group, H5Z_filter_t filter_id, hi for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(read_bufs[dset_idx], 255, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], data_bufs[dset_idx], data_size)), @@ -8715,8 +8798,8 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t read_bufs[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, SOME_CHUNKS_WRITTEN); @@ -8727,8 +8810,8 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t /* Verify the correct data was written */ open_datasets(group_id, WRITE_SHARED_FILTERED_EDGE_CHUNKS_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], data_bufs[dset_idx], data_size)), @@ -8773,8 +8856,8 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, SOME_CHUNKS_WRITTEN); @@ -8788,8 +8871,8 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(read_bufs[dset_idx], 255, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], data_bufs[dset_idx], data_size)), @@ -8897,7 +8980,7 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id } /* Read entire dataset and verify that the fill value is returned */ - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, true); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { for (size_t j = 0; j < read_buf_size / sizeof(C_DATATYPE); j++) @@ -8939,8 +9022,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, SOME_CHUNKS_WRITTEN); @@ -8951,7 +9034,7 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id /* Verify correct data was written */ open_datasets(group_id, FILL_VALUES_TEST_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); /* * Each MPI rank communicates their written piece of data @@ -8999,8 +9082,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, true); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -9011,7 +9094,7 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id /* Verify correct data was written */ open_datasets(group_id, FILL_VALUES_TEST_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { C_DATATYPE *tmp_buf = read_bufs[dset_idx]; @@ -9044,7 +9127,7 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Read entire dataset and verify that the fill value is returned */ - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, true); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { for (size_t j = 0; j < read_buf_size / sizeof(C_DATATYPE); j++) @@ -9079,8 +9162,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id tmp_buf[j] = (C_DATATYPE)(GEN_DATA(j) + dset_idx); } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, SOME_CHUNKS_WRITTEN); @@ -9091,7 +9174,7 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id /* Verify correct data was written */ open_datasets(group_id, FILL_VALUES_TEST_DATASET_NAME2, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t i = 0; i < (size_t)mpi_size; i++) { recvcounts[i] = (int)(count[1] * block[1]); @@ -9133,8 +9216,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, true); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -9145,7 +9228,7 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id /* Verify correct data was written */ open_datasets(group_id, FILL_VALUES_TEST_DATASET_NAME2, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { C_DATATYPE *tmp_buf = read_bufs[dset_idx]; @@ -9281,8 +9364,8 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ * allocation in parallel, so the read should succeed in that case. */ if (alloc_time == H5D_ALLOC_TIME_EARLY) { - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, - test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, true); } else { for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { @@ -9320,9 +9403,9 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ VRFY((ret == expected), "Dataset write"); if (expected == SUCCEED) - verify_chunk_opt_status(1, dxpl_id); + verify_chunk_opt_status(1, test_mode, true, false, true, false, false, dxpl_id); else - verify_chunk_opt_status(0, dxpl_id); + verify_chunk_opt_status(0, test_mode, false, true, true, alloc_time == H5D_ALLOC_TIME_INCR || alloc_time == H5D_ALLOC_TIME_LATE, false, dxpl_id); } } @@ -9356,8 +9439,8 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, SOME_CHUNKS_WRITTEN); @@ -9367,7 +9450,7 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ open_datasets(group_id, FILL_VALUE_UNDEFINED_TEST_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((H5Sclose(fspace_ids[dset_idx]) >= 0), "File dataspace close succeeded"); @@ -9391,8 +9474,8 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, true); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -9403,7 +9486,7 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ /* Verify correct data was written */ open_datasets(group_id, FILL_VALUE_UNDEFINED_TEST_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { free(data_bufs_nc[dset_idx]); @@ -9548,7 +9631,7 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap VRFY((NULL != fill_buf), "calloc succeeded"); /* Read entire dataset and verify that the fill value isn't returned */ - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, true); for (size_t i = 0; i < read_buf_size / sizeof(C_DATATYPE); i++) fill_buf[i] = FILL_TIME_NEVER_TEST_FILL_VAL; @@ -9593,8 +9676,8 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, SOME_CHUNKS_WRITTEN); @@ -9605,7 +9688,7 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap /* Verify correct data was written */ open_datasets(group_id, FILL_TIME_NEVER_TEST_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); /* * Each MPI rank communicates their written piece of data @@ -9657,8 +9740,8 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dxpl_id, data_bufs, - test_mode); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -9669,7 +9752,7 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap /* Verify correct data was written */ open_datasets(group_id, FILL_TIME_NEVER_TEST_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_bufs, test_mode); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { C_DATATYPE *tmp_buf = read_bufs[dset_idx]; diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index d826862d779..9ba61441a3d 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -59,13 +59,11 @@ typedef enum { TEST_SMALLER_MEM_NO_BKG, /* smaller memory type, no bkg buffer */ TEST_CMPD_WITH_BKG, /* compound types with bkg buffer */ TEST_TYPE_CONV_SEL_EMPTY, /* some processes have null/empty selections and with type conversion */ -#ifdef OUT TEST_MULTI_CONV_NO_BKG, /* multi dataset test 1 */ TEST_MULTI_CONV_BKG, /* multi dataset test 2 */ TEST_MULTI_CONV_SIZE_CHANGE, /* multi dataset test 3 */ TEST_MULTI_CONV_SEL_EMPTY, /* multi dataset test 4 */ TEST_MULTI_ALL, /* multi dataset test 5 */ -#endif TEST_SELECT_NTESTS } test_select_config_t; @@ -1279,7 +1277,7 @@ test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned /* Create a memory dataspace */ if ((mspace_id = H5Screate_simple(1, block, NULL)) < 0) P_TEST_ERROR; - if (mpi_rank) { + if (!MAINPROCESS) { if (H5Sselect_none(mspace_id) < 0) P_TEST_ERROR; } @@ -1296,10 +1294,11 @@ test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned if (mwbuf) memcpy(lwbuf, lwbuf_bak, sizeof(lwbuf)); -#ifdef OUT - check_io_mode(dxpl, chunked); - check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); -#endif + /* If not using selection I/O there will be no collective I/O, since type conversion is unsupported by legacy collective I/O */ + testing_check_io_mode(dxpl, select ? (chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE) : 0); + + /* If not using selection I/O then the main process will do scalar I/O and others will do none */ + check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : (MAINPROCESS ? H5D_SCALAR_IO : 0)); /* Read the data from the dataset: type conversion int-->long */ /* If dtrans, without data transform set in dxpl */ @@ -1454,7 +1453,6 @@ test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned } /* test_type_conv_sel_empty() */ -#ifdef OUT /* * Test 1 for multi-dataset: @@ -1469,7 +1467,7 @@ test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned * Datatype for all datasets: H5T_NATIVE_LONG */ static void -test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) +test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned select, unsigned mwbuf) { size_t ndsets; int i, j; @@ -1484,6 +1482,8 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m hid_t mem_sids[MULTI_NUM_DSETS]; hid_t mem_tids[MULTI_NUM_DSETS]; + bool any_tconv = false; + char dset_names[MULTI_NUM_DSETS][DSET_NAME_LEN]; hid_t dset_dids[MULTI_NUM_DSETS]; @@ -1531,7 +1531,7 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, H5D_SELECTION_IO_MODE_ON, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) P_TEST_ERROR; @@ -1543,16 +1543,23 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m /* Set up file space ids and dataset ids */ for (i = 0; i < (int)ndsets; i++) { + bool tconv; + if ((file_sids[i] = H5Screate_simple(1, dims, NULL)) < 0) P_TEST_ERROR; /* Generate dataset name */ - snprintf(dset_names[i], sizeof(dset_names[i]), "multi_dset%d_%s_%s_%s", i, - chunked ? "chunked" : "contig", dtrans ? "xform" : "noxform", mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_names[i], sizeof(dset_names[i]), "multi_dset%d_%s_%s_%s_%s", i, + chunked ? "chunked" : "contig", dtrans ? "xform" : "noxform", select ? "select" : "noselect", mwbuf ? "mwbuf" : "nomwbuf"); + + /* Flip a coin to see if we're doing type conversion */ + tconv = HDrandom() % 2; + if (tconv) + any_tconv = true; /* Create ith dataset */ if ((dset_dids[i] = - H5Dcreate2(fid, dset_names[i], ((HDrandom() % 2) ? H5T_NATIVE_LONG : H5T_NATIVE_INT), + H5Dcreate2(fid, dset_names[i], (tconv ? H5T_NATIVE_LONG : H5T_NATIVE_INT), file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) P_TEST_ERROR; } @@ -1629,8 +1636,9 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m if (mwbuf) memcpy(total_wbuf, total_wbuf_bak, ndsets * DSET_SELECT_DIM * sizeof(int)); - check_io_mode(dxpl, chunked); - check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + /* If doing type conversion or transform and not using selection I/O there will be no collective I/O, since type conversion is unsupported by legacy collective I/O */ + testing_check_io_mode(dxpl, ((any_tconv || dtrans) && !select) ? 0 : (chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE)); + check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); /* Read data from the dataset (if dtrans, without data transform set in dxpl) */ if (H5Dread_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, ntrans_dxpl, rbufs) < 0) @@ -1783,7 +1791,7 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m * --Verify values read */ static void -test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) +test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned select, unsigned mwbuf) { size_t ndsets; int i, j, mm; @@ -1844,7 +1852,7 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, H5D_SELECTION_IO_MODE_ON, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); /* Each process takes x number of elements */ block[0] = dims[0] / (hsize_t)mpi_size; @@ -1869,8 +1877,8 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; /* Generate dataset name */ - snprintf(dset_names[i], sizeof(dset_names[i]), "multi_cmpd_dset%d_%s_%s", i, - chunked ? "chunked" : "contig", mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_names[i], sizeof(dset_names[i]), "multi_cmpd_dset%d_%s_%s_%s", i, + chunked ? "chunked" : "contig", select ? "select" : "noselect", mwbuf ? "mwbuf" : "nomwbuf"); /* Create ith dataset */ if ((dset_dids[i] = @@ -1935,7 +1943,7 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) memcpy(total_wbuf, total_wbuf_bak, buf_size); check_io_mode(dxpl, chunked); - check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); if (H5Dread_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, dxpl, rbufs) < 0) P_TEST_ERROR; @@ -2240,7 +2248,7 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) * Datatype for all datasets: H5T_STD_I16BE */ static void -test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) +test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned select, unsigned mwbuf) { size_t ndsets; int i, j; @@ -2298,7 +2306,7 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, H5D_SELECTION_IO_MODE_ON, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); /* Set up file space ids, mem space ids, and dataset ids */ for (i = 0; i < (int)ndsets; i++) { @@ -2306,8 +2314,8 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; /* Generate dataset name */ - snprintf(dset_names[i], sizeof(dset_names[i]), "multi_size_dset%d_%s_%s", i, - chunked ? "chunked" : "contig", mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_names[i], sizeof(dset_names[i]), "multi_size_dset%d_%s_%s_%s", i, + chunked ? "chunked" : "contig", select ? "select" : "noselect", mwbuf ? "mwbuf" : "nomwbuf"); /* Create ith dataset */ if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], H5T_STD_I32BE, file_sids[i], H5P_DEFAULT, dcpl, @@ -2377,7 +2385,7 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) memcpy(total_wbuf, total_wbuf_bak, buf_size); check_io_mode(dxpl, chunked); - check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); /* Read data from the dataset */ if (H5Dread_multi(ndsets, dset_dids, mem_tids, mem_sids, file_sids, dxpl, rbufs) < 0) @@ -2587,7 +2595,7 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) * --this will trigger type conversion for (a), (b) & (c) */ static void -test_multi_dsets_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf) +test_multi_dsets_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned select, unsigned mwbuf) { size_t ndsets; int i, j; @@ -2645,7 +2653,7 @@ test_multi_dsets_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, un P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, H5D_SELECTION_IO_MODE_ON, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) P_TEST_ERROR; @@ -2661,8 +2669,8 @@ test_multi_dsets_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, un P_TEST_ERROR; /* Generate dataset name */ - snprintf(dset_names[i], sizeof(dset_names[i]), "multi_sel_dset%d_%s_%s_%s", i, - chunked ? "chunked" : "contig", dtrans ? "xform" : "noxform", mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_names[i], sizeof(dset_names[i]), "multi_sel_dset%d_%s_%s_%s_%s", i, + chunked ? "chunked" : "contig", dtrans ? "xform" : "noxform", select ? "select" : "noselect", mwbuf ? "mwbuf" : "nomwbuf"); if (i == 0) { if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], H5T_NATIVE_INT, file_sids[i], H5P_DEFAULT, @@ -2846,8 +2854,9 @@ test_multi_dsets_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, un if (mwbuf) memcpy(total_wbuf, total_wbuf_bak, buf_size); - check_io_mode(dxpl, chunked); - check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + /* If not using selection I/O there will be no collective I/O, since type conversion is unsupported by legacy collective I/O */ + testing_check_io_mode(dxpl, select ? (chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE) : 0); + check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); /* Initialize buffer indices */ for (i = 0; i < (int)ndsets; i++) { @@ -2981,7 +2990,7 @@ test_multi_dsets_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, un * --fields 'b' and 'd' are (DSET_SELECT_DIM + j + start[0]) */ static void -test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) +test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned select, unsigned mwbuf) { size_t ndsets; int i, j, mm; @@ -2998,6 +3007,8 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) hid_t mem_tids[MULTI_NUM_DSETS]; hid_t r_mem_tids[MULTI_NUM_DSETS]; + bool any_tconv; + multi_dset_type_t dset_types[MULTI_NUM_DSETS]; hid_t s1_tid = H5I_INVALID_HID; @@ -3056,7 +3067,7 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, H5D_SELECTION_IO_MODE_ON, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); /* Set dataset layout: contiguous or chunked */ dims[0] = DSET_SELECT_DIM; @@ -3117,24 +3128,24 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) mm = HDrandom() % (int)ndsets; if (mm == 0) { dset_types[i] = DSET_WITH_NO_CONV; - snprintf(dset_names[i], sizeof(dset_names[i]), "multi_all_nconv_dset%d_%s_%s", i, - chunked ? "chunked" : "contig", mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_names[i], sizeof(dset_names[i]), "multi_all_nconv_dset%d_%s_%s_%s", i, + chunked ? "chunked" : "contig", select ? "select" : "noselect", mwbuf ? "mwbuf" : "nomwbuf"); if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], H5T_NATIVE_INT, file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) P_TEST_ERROR; } else if (mm == 1) { dset_types[i] = DSET_WITH_CONV_AND_NO_BKG; - snprintf(dset_names[i], sizeof(dset_names[i]), "multi_all_conv_nbkg_dset%d_%s_%s", i, - chunked ? "chunked" : "contig", mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_names[i], sizeof(dset_names[i]), "multi_all_conv_nbkg_dset%d_%s_%s_%s", i, + chunked ? "chunked" : "contig", select ? "select" : "noselect", mwbuf ? "mwbuf" : "nomwbuf"); if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], H5T_NATIVE_LONG, file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) P_TEST_ERROR; } else { dset_types[i] = DSET_WITH_CONV_AND_BKG; - snprintf(dset_names[i], sizeof(dset_names[i]), "multi_all_conv_bkg_dset%d_%s_%s", i, - chunked ? "chunked" : "contig", mwbuf ? "mwbuf" : "nomwbuf"); + snprintf(dset_names[i], sizeof(dset_names[i]), "multi_all_conv_bkg_dset%d_%s_%s_%s", i, + chunked ? "chunked" : "contig", select ? "select" : "noselect", mwbuf ? "mwbuf" : "nomwbuf"); if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], s1_tid, file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) P_TEST_ERROR; @@ -3197,6 +3208,8 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) /* Test with s settings for ndsets */ for (s = SETTING_A; s <= SETTING_B; s++) { + any_tconv = false; + /* for i ndsets */ for (i = 0; i < (int)ndsets; i++) { @@ -3249,6 +3262,9 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) mem_tids[i] = H5T_NATIVE_LONG; r_mem_tids[i] = H5T_NATIVE_SHORT; + + /* There is type conversion in the read op */ + any_tconv = true; } break; @@ -3272,6 +3288,9 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) } mem_tids[i] = s1_tid; r_mem_tids[i] = s3_tid; + + /* There is type conversion in the read op */ + any_tconv = true; } else if (s == SETTING_B) { /* Initialize buffer indices */ @@ -3324,8 +3343,9 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Dread_multi(ndsets, dset_dids, r_mem_tids, mem_sids, file_sids, dxpl, rbufs) < 0) P_TEST_ERROR; - check_io_mode(dxpl, chunked); - check_actual_selection_io_mode(dxpl, H5D_VECTOR_IO); + /* If doing type conversion and not using selection I/O there will be no collective I/O, since type conversion is unsupported by legacy collective I/O */ + testing_check_io_mode(dxpl, (any_tconv && !select) ? 0 : (chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE)); + check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); /* Verify result read */ /* for i ndsets */ @@ -3468,7 +3488,6 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) return; } /* test_multi_dsets_all() */ -#endif /* * Test with various test_mode that no selection I/O is performed @@ -4066,170 +4085,168 @@ main(int argc, char *argv[]) /* therefore, not all tests are run with data transform */ for (dtrans = false; dtrans <= true; dtrans++) { - for (select = false; select <= true; select++) { - - /* Test with and without modify_write_buf turned on */ - for (mwbuf = false; mwbuf <= true; mwbuf++) { - - if (MAINPROCESS) { - /* Print configuration message */ - printf("Testing for selection I/O "); - if (chunked) - printf("with chunked dataset, "); - else - printf("with contiguous dataset, "); - if (dtrans) - printf("data transform, "); - else - printf("without data transform, "); - if (select) - printf("selection I/O ON, "); - else - printf("selection I/O OFF, "); - if (mwbuf) - printf("and with modifying write buffers\n"); - else - printf("and without modifying write buffers\n"); - } + for (select = false; select <= true; select++) { + + /* Test with and without modify_write_buf turned on */ + for (mwbuf = false; mwbuf <= true; mwbuf++) { + + if (MAINPROCESS) { + /* Print configuration message */ + printf("Testing for selection I/O "); + if (chunked) + printf("with chunked dataset, "); + else + printf("with contiguous dataset, "); + if (dtrans) + printf("data transform, "); + else + printf("without data transform, "); + if (select) + printf("selection I/O ON, "); + else + printf("selection I/O OFF, "); + if (mwbuf) + printf("and with modifying write buffers\n"); + else + printf("and without modifying write buffers\n"); + } + + for (test_select_config = (int)TEST_NO_TYPE_CONV; + test_select_config < (int)TEST_SELECT_NTESTS; test_select_config++) { + + switch (test_select_config) { + + case TEST_NO_TYPE_CONV: /* case 1 */ + if (MAINPROCESS) + TESTING_2("No type conversion (null case)"); - for (test_select_config = (int)TEST_NO_TYPE_CONV; - test_select_config < (int)TEST_SELECT_NTESTS; test_select_config++) { + test_no_type_conv(fid, chunked, dtrans, select, mwbuf); - switch (test_select_config) { + break; - case TEST_NO_TYPE_CONV: /* case 1 */ - if (MAINPROCESS) - TESTING_2("No type conversion (null case)"); + case TEST_NO_SIZE_CHANGE_NO_BKG: /* case 2 */ + if (MAINPROCESS) + TESTING_2("No size change, no background buffer"); - test_no_type_conv(fid, chunked, dtrans, select, mwbuf); + /* Data transforms does not apply to the dataset datatype for this test */ + if (dtrans) { + if (MAINPROCESS) + SKIPPED(); + continue; + } - break; + test_no_size_change_no_bkg(fid, chunked, select, mwbuf); - case TEST_NO_SIZE_CHANGE_NO_BKG: /* case 2 */ - if (MAINPROCESS) - TESTING_2("No size change, no background buffer"); + break; - /* Data transforms does not apply to the dataset datatype for this test */ - if (dtrans) { + case TEST_LARGER_MEM_NO_BKG: /* case 3 */ if (MAINPROCESS) - SKIPPED(); - continue; - } + TESTING_2("Larger memory type, no background buffer"); - test_no_size_change_no_bkg(fid, chunked, select, mwbuf); + test_larger_mem_type_no_bkg(fid, chunked, dtrans, select, mwbuf); - break; - - case TEST_LARGER_MEM_NO_BKG: /* case 3 */ - if (MAINPROCESS) - TESTING_2("Larger memory type, no background buffer"); - - test_larger_mem_type_no_bkg(fid, chunked, dtrans, select, mwbuf); - - break; + break; - case TEST_SMALLER_MEM_NO_BKG: /* case 4 */ - if (MAINPROCESS) - TESTING_2("Smaller memory type, no background buffer"); + case TEST_SMALLER_MEM_NO_BKG: /* case 4 */ + if (MAINPROCESS) + TESTING_2("Smaller memory type, no background buffer"); - test_smaller_mem_type_no_bkg(fid, chunked, dtrans, select, mwbuf); + test_smaller_mem_type_no_bkg(fid, chunked, dtrans, select, mwbuf); - break; + break; - case TEST_CMPD_WITH_BKG: /* case 5 */ - if (MAINPROCESS) - TESTING_2("Compound types with background buffer"); - /* Data transforms does not apply to the dataset datatype for this test */ - if (dtrans) { + case TEST_CMPD_WITH_BKG: /* case 5 */ if (MAINPROCESS) - SKIPPED(); - continue; - } - - test_cmpd_with_bkg(fid, chunked, select, mwbuf); + TESTING_2("Compound types with background buffer"); + /* Data transforms does not apply to the dataset datatype for this test */ + if (dtrans) { + if (MAINPROCESS) + SKIPPED(); + continue; + } - break; + test_cmpd_with_bkg(fid, chunked, select, mwbuf); - case TEST_TYPE_CONV_SEL_EMPTY: /* case 6 */ - if (MAINPROCESS) - TESTING_2("Empty selections + Type conversion"); + break; - test_type_conv_sel_empty(fid, chunked, dtrans, select, mwbuf); + case TEST_TYPE_CONV_SEL_EMPTY: /* case 6 */ + if (MAINPROCESS) + TESTING_2("Empty selections + Type conversion"); - break; -#ifdef OUT + test_type_conv_sel_empty(fid, chunked, dtrans, select, mwbuf); - case TEST_MULTI_CONV_NO_BKG: /* case 7 */ - if (MAINPROCESS) - TESTING_2("multi-datasets: type conv + no bkg buffer"); + break; - test_multi_dsets_no_bkg(fid, chunked, dtrans, mwbuf); + case TEST_MULTI_CONV_NO_BKG: /* case 7 */ + if (MAINPROCESS) + TESTING_2("multi-datasets: type conv + no bkg buffer"); - break; + test_multi_dsets_no_bkg(fid, chunked, dtrans, select, mwbuf); - case TEST_MULTI_CONV_BKG: /* case 8 */ - if (MAINPROCESS) - TESTING_2("multi-datasets: type conv + bkg buffer"); + break; - /* Data transforms does not apply to the dataset datatype for this test */ - if (dtrans) { + case TEST_MULTI_CONV_BKG: /* case 8 */ if (MAINPROCESS) - SKIPPED(); - } - else - test_multi_dsets_cmpd_with_bkg(fid, chunked, mwbuf); + TESTING_2("multi-datasets: type conv + bkg buffer"); - break; + /* Data transforms does not apply to the dataset datatype for this test */ + if (dtrans) { + if (MAINPROCESS) + SKIPPED(); + } + else + test_multi_dsets_cmpd_with_bkg(fid, chunked, select, mwbuf); - case TEST_MULTI_CONV_SIZE_CHANGE: /* case 9 */ - if (MAINPROCESS) - TESTING_2("multi-datasets: type conv + size change + no bkg buffer"); + break; - /* Data transforms does not apply to the dataset datatype for this test */ - if (dtrans) { + case TEST_MULTI_CONV_SIZE_CHANGE: /* case 9 */ if (MAINPROCESS) - SKIPPED(); - } - else - test_multi_dsets_size_change_no_bkg(fid, chunked, mwbuf); + TESTING_2("multi-datasets: type conv + size change + no bkg buffer"); - break; + /* Data transforms does not apply to the dataset datatype for this test */ + if (dtrans) { + if (MAINPROCESS) + SKIPPED(); + } + else + test_multi_dsets_size_change_no_bkg(fid, chunked, select, mwbuf); - case TEST_MULTI_CONV_SEL_EMPTY: /* case 10 */ - if (MAINPROCESS) - TESTING_2("multi-datasets: type conv + empty selections"); + break; - test_multi_dsets_conv_sel_empty(fid, chunked, dtrans, mwbuf); + case TEST_MULTI_CONV_SEL_EMPTY: /* case 10 */ + if (MAINPROCESS) + TESTING_2("multi-datasets: type conv + empty selections"); - break; + test_multi_dsets_conv_sel_empty(fid, chunked, dtrans, select, mwbuf); - case TEST_MULTI_ALL: /* case 11 */ - if (MAINPROCESS) - TESTING_2("multi-datasets: no conv + conv without bkg + conv with bkg"); + break; - /* Data transforms does not apply to the dataset datatype for this test */ - if (dtrans) { + case TEST_MULTI_ALL: /* case 11 */ if (MAINPROCESS) - SKIPPED(); - } - else - test_multi_dsets_all(2, fid, chunked, mwbuf); + TESTING_2("multi-datasets: no conv + conv without bkg + conv with bkg"); + + /* Data transforms does not apply to the dataset datatype for this test */ + if (dtrans) { + if (MAINPROCESS) + SKIPPED(); + } + else + test_multi_dsets_all(2, fid, chunked, select, mwbuf); - break; -#endif + break; - case TEST_SELECT_NTESTS: - default: - P_TEST_ERROR; - break; + case TEST_SELECT_NTESTS: + default: + P_TEST_ERROR; + break; - } /* end switch */ + } /* end switch */ - } /* end for test_select_config */ + } /* end for test_select_config */ - } /* end mwbuf */ + } /* end mwbuf */ - } /* end select */ + } /* end select */ } /* end dtrans */ } /* end chunked */ From 840acf5c86bf5d809b15c7fb2d3b738d506a66aa Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 19 Oct 2023 19:58:20 +0000 Subject: [PATCH 29/37] Committing clang-format changes --- testpar/t_filters_parallel.c | 526 ++++++++++++++++++++--------------- testpar/t_select_io_dset.c | 28 +- 2 files changed, 311 insertions(+), 243 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 8dfae04ab7d..631e12f9854 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -67,10 +67,11 @@ typedef enum num_chunks_written_t { typedef void (*test_func)(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id, hid_t dcpl_id, hid_t dxpl_id, test_mode_t test_mode); -static herr_t set_dcpl_filter(hid_t dcpl_id, H5Z_filter_t filter_id, filter_options_t *filter_options); -static void verify_space_alloc_status(size_t num_dsets, hid_t *dset_ids, hid_t dcpl_id, - num_chunks_written_t chunks_written); -static void verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bool any_filters, bool collective, bool unalloc_read, bool did_alloc, hid_t dxpl_id); +static herr_t set_dcpl_filter(hid_t dcpl_id, H5Z_filter_t filter_id, filter_options_t *filter_options); +static void verify_space_alloc_status(size_t num_dsets, hid_t *dset_ids, hid_t dcpl_id, + num_chunks_written_t chunks_written); +static void verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bool any_filters, + bool collective, bool unalloc_read, bool did_alloc, hid_t dxpl_id); static const char *test_mode_to_string(test_mode_t test_mode); static void create_datasets(hid_t parent_obj_id, const char *dset_name, hid_t type_id, hid_t filespace_id, @@ -78,9 +79,11 @@ static void create_datasets(hid_t parent_obj_id, const char *dset_name, hid_t ty static void open_datasets(hid_t parent_obj_id, const char *dset_name, size_t num_dsets, test_mode_t test_mode, hid_t *dset_ids); static void write_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id, - hid_t *fspace_ids, hid_t dcpl_id, hid_t dxpl_id, const void **bufs, test_mode_t test_mode, bool any_io, bool collective, bool overwrite); + hid_t *fspace_ids, hid_t dcpl_id, hid_t dxpl_id, const void **bufs, + test_mode_t test_mode, bool any_io, bool collective, bool overwrite); static void read_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id, hid_t fspace_id, - hid_t dcpl_id, hid_t dxpl_id, void **bufs, test_mode_t test_mode, bool any_io, bool collective, bool all_uninit_read); + hid_t dcpl_id, hid_t dxpl_id, void **bufs, test_mode_t test_mode, bool any_io, + bool collective, bool all_uninit_read); static void select_hyperslab(size_t num_dsets, hid_t *dset_ids, hsize_t *start, hsize_t *stride, hsize_t *count, hsize_t *block, hid_t *fspace_ids); @@ -469,14 +472,15 @@ verify_space_alloc_status(size_t num_dsets, hid_t *dset_ids, hid_t dcpl_id, * I/O was performed. */ static void -verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bool any_filters, bool collective, bool unalloc_read, bool did_alloc, hid_t dxpl_id) +verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bool any_filters, + bool collective, bool unalloc_read, bool did_alloc, hid_t dxpl_id) { H5D_mpio_actual_chunk_opt_mode_t chunk_opt_mode; H5D_selection_io_mode_t sel_io_mode; uint32_t actual_sel_io_mode; uint32_t actual_sel_io_mode_reduced; uint32_t no_sel_io_cause = 0; - int mpi_code; + int mpi_code; herr_t ret; if (H5P_DEFAULT != dxpl_id) { @@ -535,47 +539,59 @@ verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bo VRFY((ret >= 0), "H5Pget_actual_selection_io_mode succeeded"); /* Reduce results to process 0 (bitwise OR so we get all I/O types) */ - mpi_code = MPI_Reduce(&actual_sel_io_mode, &actual_sel_io_mode_reduced, 1, MPI_UINT32_T, MPI_BOR, 0, comm); + mpi_code = + MPI_Reduce(&actual_sel_io_mode, &actual_sel_io_mode_reduced, 1, MPI_UINT32_T, MPI_BOR, 0, comm); VRFY((MPI_SUCCESS == mpi_code), "MPI_Reduce succeeded"); /* Verify selection I/O mode on rank 0 */ if (mpi_rank == 0) { if (!any_io) { if (did_alloc) - VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); + VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, + "verified actual selection I/O mode was scalar I/O"); else - VRFY(0 == actual_sel_io_mode_reduced, "verified actual selection I/O mode was 0 (no I/O)"); + VRFY(0 == actual_sel_io_mode_reduced, + "verified actual selection I/O mode was 0 (no I/O)"); } else if (!any_filters) { assert(!unalloc_read && !did_alloc); if (sel_io_mode == H5D_SELECTION_IO_MODE_DEFAULT || sel_io_mode == H5D_SELECTION_IO_MODE_ON) - VRFY(H5D_SELECTION_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was selection I/O"); + VRFY(H5D_SELECTION_IO == actual_sel_io_mode_reduced, + "verified actual selection I/O mode was selection I/O"); else - VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); + VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, + "verified actual selection I/O mode was scalar I/O"); } else if (!collective) { if (unalloc_read) - VRFY(0 == actual_sel_io_mode_reduced, "verified actual selection I/O mode was 0 (no I/O)"); + VRFY(0 == actual_sel_io_mode_reduced, + "verified actual selection I/O mode was 0 (no I/O)"); else - VRFY(H5D_SCALAR_IO ==actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); + VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, + "verified actual selection I/O mode was scalar I/O"); } else switch (test_mode) { case USE_SINGLE_DATASET: case USE_MULTIPLE_DATASETS: if (did_alloc) - VRFY((H5D_SCALAR_IO | H5D_VECTOR_IO) == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar and vector I/O"); + VRFY((H5D_SCALAR_IO | H5D_VECTOR_IO) == actual_sel_io_mode_reduced, + "verified actual selection I/O mode was scalar and vector I/O"); else if (unalloc_read) - VRFY(0 == actual_sel_io_mode_reduced, "verified actual selection I/O mode was 0 (no I/O)"); + VRFY(0 == actual_sel_io_mode_reduced, + "verified actual selection I/O mode was 0 (no I/O)"); else - VRFY(H5D_VECTOR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was vector I/O"); + VRFY(H5D_VECTOR_IO == actual_sel_io_mode_reduced, + "verified actual selection I/O mode was vector I/O"); break; case USE_MULTIPLE_DATASETS_MIXED_FILTERED: if (unalloc_read) - VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); + VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, + "verified actual selection I/O mode was scalar I/O"); else - VRFY((H5D_SCALAR_IO | H5D_VECTOR_IO) == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar and vector I/O"); + VRFY((H5D_SCALAR_IO | H5D_VECTOR_IO) == actual_sel_io_mode_reduced, + "verified actual selection I/O mode was scalar and vector I/O"); break; case TEST_MODE_SENTINEL: @@ -750,10 +766,11 @@ open_datasets(hid_t parent_obj_id, const char *dset_name, size_t num_dsets, test */ static void write_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id, hid_t *fspace_ids, - hid_t dcpl_id, hid_t dxpl_id, const void **bufs, test_mode_t test_mode, bool any_io, bool collective, bool overwrite) + hid_t dcpl_id, hid_t dxpl_id, const void **bufs, test_mode_t test_mode, bool any_io, + bool collective, bool overwrite) { - hid_t mem_type_ids[MAX_NUM_DSETS_MULTI]; - hid_t mem_space_ids[MAX_NUM_DSETS_MULTI]; + hid_t mem_type_ids[MAX_NUM_DSETS_MULTI]; + hid_t mem_space_ids[MAX_NUM_DSETS_MULTI]; H5D_alloc_time_t alloc_time = H5D_ALLOC_TIME_DEFAULT; for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { @@ -785,7 +802,8 @@ write_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id if (!overwrite) VRFY(H5Pget_alloc_time(dcpl_id, &alloc_time) >= 0, "H5Pget_alloc_time succeeded"); - verify_chunk_opt_status(num_dsets, test_mode, any_io, true, collective, false, !overwrite && (alloc_time == H5D_ALLOC_TIME_LATE), dxpl_id); + verify_chunk_opt_status(num_dsets, test_mode, any_io, true, collective, false, + !overwrite && (alloc_time == H5D_ALLOC_TIME_LATE), dxpl_id); } /* @@ -794,11 +812,12 @@ write_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id */ static void read_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id, hid_t fspace_id, - hid_t dcpl_id, hid_t dxpl_id, void **bufs, test_mode_t test_mode, bool any_io, bool collective, bool all_uninit_read) + hid_t dcpl_id, hid_t dxpl_id, void **bufs, test_mode_t test_mode, bool any_io, bool collective, + bool all_uninit_read) { - hid_t mem_type_ids[MAX_NUM_DSETS_MULTI]; - hid_t mem_space_ids[MAX_NUM_DSETS_MULTI]; - hid_t file_space_ids[MAX_NUM_DSETS_MULTI]; + hid_t mem_type_ids[MAX_NUM_DSETS_MULTI]; + hid_t mem_space_ids[MAX_NUM_DSETS_MULTI]; + hid_t file_space_ids[MAX_NUM_DSETS_MULTI]; H5D_alloc_time_t alloc_time = H5D_ALLOC_TIME_DEFAULT; for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { @@ -831,7 +850,10 @@ read_datasets(size_t num_dsets, hid_t *dset_ids, hid_t type_id, hid_t mspace_id, if (all_uninit_read) VRFY(H5Pget_alloc_time(dcpl_id, &alloc_time) >= 0, "H5Pget_alloc_time succeeded"); - verify_chunk_opt_status(num_dsets, test_mode, any_io, true, collective, all_uninit_read && (alloc_time == H5D_ALLOC_TIME_INCR || alloc_time == H5D_ALLOC_TIME_LATE), false, dxpl_id); + verify_chunk_opt_status(num_dsets, test_mode, any_io, true, collective, + all_uninit_read && + (alloc_time == H5D_ALLOC_TIME_INCR || alloc_time == H5D_ALLOC_TIME_LATE), + false, dxpl_id); } static void @@ -1005,8 +1027,8 @@ test_write_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t fil data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -1038,7 +1060,8 @@ test_write_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t fil (C_DATATYPE)dset_idx; } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -1159,8 +1182,8 @@ test_write_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fi data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -1189,7 +1212,8 @@ test_write_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fi (j / (dataset_dims[0] / (hsize_t)mpi_size * dataset_dims[1])) + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -1310,8 +1334,8 @@ test_write_filtered_dataset_no_overlap_partial(const char *parent_group, H5Z_fil data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -1348,7 +1372,8 @@ test_write_filtered_dataset_no_overlap_partial(const char *parent_group, H5Z_fil } } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -1469,8 +1494,8 @@ test_write_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filte data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -1501,7 +1526,8 @@ test_write_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filte dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -1632,8 +1658,8 @@ test_write_filtered_dataset_single_unlim_dim_no_overlap(const char *parent_group select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, i > 0); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, i > 0); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -1647,8 +1673,8 @@ test_write_filtered_dataset_single_unlim_dim_no_overlap(const char *parent_group for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(read_bufs[dset_idx], 255, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Verify the correct data was written */ for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) @@ -1792,8 +1818,8 @@ test_write_filtered_dataset_single_unlim_dim_overlap(const char *parent_group, H select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, i > 0); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, i > 0); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -1807,8 +1833,8 @@ test_write_filtered_dataset_single_unlim_dim_overlap(const char *parent_group, H for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(read_bufs[dset_idx], 255, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Verify the correct data was written */ for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) @@ -1958,8 +1984,8 @@ test_write_filtered_dataset_multi_unlim_dim_no_overlap(const char *parent_group, select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, i > 0); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, i > 0); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -1973,8 +1999,8 @@ test_write_filtered_dataset_multi_unlim_dim_no_overlap(const char *parent_group, for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(read_bufs[dset_idx], 255, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Verify the correct data was written */ for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) @@ -2127,8 +2153,8 @@ test_write_filtered_dataset_multi_unlim_dim_overlap(const char *parent_group, H5 select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, i > 0); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, i > 0); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -2142,8 +2168,8 @@ test_write_filtered_dataset_multi_unlim_dim_overlap(const char *parent_group, H5 for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(read_bufs[dset_idx], 255, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Verify the correct data was written */ for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) @@ -2197,24 +2223,24 @@ test_write_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fi test_mode_t test_mode) { H5D_alloc_time_t alloc_time; - C_DATATYPE *correct_bufs[MAX_NUM_DSETS_MULTI] = {0}; - const void *data_bufs[MAX_NUM_DSETS_MULTI] = {0}; - void *data_bufs_nc[MAX_NUM_DSETS_MULTI] = {0}; /* non-const buffer pointers for freeing */ - void *read_bufs[MAX_NUM_DSETS_MULTI] = {0}; - hsize_t dataset_dims[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t chunk_dims[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t sel_dims[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t start[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t stride[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t count[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t block[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - size_t data_size, correct_buf_size; - size_t num_dsets; - hid_t dset_ids[MAX_NUM_DSETS_MULTI]; - hid_t fspace_ids[MAX_NUM_DSETS_MULTI]; - hid_t file_id = H5I_INVALID_HID, plist_id = H5I_INVALID_HID; - hid_t group_id = H5I_INVALID_HID; - hid_t filespace = H5I_INVALID_HID; + C_DATATYPE *correct_bufs[MAX_NUM_DSETS_MULTI] = {0}; + const void *data_bufs[MAX_NUM_DSETS_MULTI] = {0}; + void *data_bufs_nc[MAX_NUM_DSETS_MULTI] = {0}; /* non-const buffer pointers for freeing */ + void *read_bufs[MAX_NUM_DSETS_MULTI] = {0}; + hsize_t dataset_dims[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t chunk_dims[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t sel_dims[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t start[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t stride[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t count[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t block[WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + size_t data_size, correct_buf_size; + size_t num_dsets; + hid_t dset_ids[MAX_NUM_DSETS_MULTI]; + hid_t fspace_ids[MAX_NUM_DSETS_MULTI]; + hid_t file_id = H5I_INVALID_HID, plist_id = H5I_INVALID_HID; + hid_t group_id = H5I_INVALID_HID; + hid_t filespace = H5I_INVALID_HID; if (MAINPROCESS) puts("Testing write to filtered chunks with a single process having no selection"); @@ -2294,8 +2320,8 @@ test_write_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fi } } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, mpi_size > 1, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, mpi_size > 1, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -2335,7 +2361,8 @@ test_write_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fi } } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, mpi_size == 1 && alloc_time == H5D_ALLOC_TIME_INCR); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, mpi_size == 1 && alloc_time == H5D_ALLOC_TIME_INCR); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -2374,19 +2401,19 @@ test_write_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filte hid_t dcpl_id, hid_t dxpl_id, test_mode_t test_mode) { H5D_alloc_time_t alloc_time; - C_DATATYPE *correct_bufs[MAX_NUM_DSETS_MULTI] = {0}; - const void *data_bufs[MAX_NUM_DSETS_MULTI] = {0}; - void *data_bufs_nc[MAX_NUM_DSETS_MULTI] = {0}; /* non-const buffer pointers for freeing */ - void *read_bufs[MAX_NUM_DSETS_MULTI] = {0}; - hsize_t dataset_dims[WRITE_ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - hsize_t chunk_dims[WRITE_ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; - size_t data_size, correct_buf_size; - size_t num_dsets; - hid_t dset_ids[MAX_NUM_DSETS_MULTI]; - hid_t fspace_ids[MAX_NUM_DSETS_MULTI]; - hid_t file_id = H5I_INVALID_HID, plist_id = H5I_INVALID_HID; - hid_t group_id = H5I_INVALID_HID; - hid_t filespace = H5I_INVALID_HID; + C_DATATYPE *correct_bufs[MAX_NUM_DSETS_MULTI] = {0}; + const void *data_bufs[MAX_NUM_DSETS_MULTI] = {0}; + void *data_bufs_nc[MAX_NUM_DSETS_MULTI] = {0}; /* non-const buffer pointers for freeing */ + void *read_bufs[MAX_NUM_DSETS_MULTI] = {0}; + hsize_t dataset_dims[WRITE_ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + hsize_t chunk_dims[WRITE_ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_DIMS]; + size_t data_size, correct_buf_size; + size_t num_dsets; + hid_t dset_ids[MAX_NUM_DSETS_MULTI]; + hid_t fspace_ids[MAX_NUM_DSETS_MULTI]; + hid_t file_id = H5I_INVALID_HID, plist_id = H5I_INVALID_HID; + hid_t group_id = H5I_INVALID_HID; + hid_t filespace = H5I_INVALID_HID; if (MAINPROCESS) puts("Testing write to filtered chunks with all processes having no selection"); @@ -2443,8 +2470,8 @@ test_write_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filte data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, false, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, false, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -2468,7 +2495,8 @@ test_write_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filte VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, alloc_time == H5D_ALLOC_TIME_INCR); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, alloc_time == H5D_ALLOC_TIME_INCR); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -2585,8 +2613,8 @@ test_write_filtered_dataset_point_selection(const char *parent_group, H5Z_filter data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -2618,7 +2646,8 @@ test_write_filtered_dataset_point_selection(const char *parent_group, H5Z_filter dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -2744,8 +2773,8 @@ test_write_filtered_dataset_interleaved_write(const char *parent_group, H5Z_filt data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -2786,7 +2815,8 @@ test_write_filtered_dataset_interleaved_write(const char *parent_group, H5Z_filt + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -2923,8 +2953,8 @@ test_write_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z /* Set data transform expression */ VRFY((H5Pset_data_transform(plist_id, "x") >= 0), "Set data transform expression succeeded"); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, plist_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, plist_id, + data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -2958,7 +2988,8 @@ test_write_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z (j / (dataset_dims[0] / (hsize_t)mpi_size * dataset_dims[1])) + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -3087,8 +3118,8 @@ test_write_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_grou data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -3117,7 +3148,8 @@ test_write_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_grou (C_DATATYPE)((j % (hsize_t)mpi_size) + (j / (hsize_t)mpi_size) + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -3247,8 +3279,8 @@ test_write_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -3277,7 +3309,8 @@ test_write_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H (j / (dataset_dims[0] * dataset_dims[1])) + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -3404,8 +3437,8 @@ test_write_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fi data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -3451,7 +3484,8 @@ test_write_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fi + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -3595,7 +3629,8 @@ test_write_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -3628,7 +3663,8 @@ test_write_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group } } - read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, + true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -3773,7 +3809,8 @@ test_write_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -3809,7 +3846,8 @@ test_write_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, } } - read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, + true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -4035,7 +4073,8 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_gro if (expected == SUCCEED) verify_chunk_opt_status(1, test_mode, true, false, true, false, false, dxpl_id); else - verify_chunk_opt_status(0, test_mode, false, true, true, false, alloc_time == H5D_ALLOC_TIME_LATE, dxpl_id); + verify_chunk_opt_status(0, test_mode, false, true, true, false, alloc_time == H5D_ALLOC_TIME_LATE, + dxpl_id); } for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) @@ -4061,8 +4100,11 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_gro VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - /* If some writes succeeded (due to mixed filtered mode) or if allocation time is late, then there is data on disk to be read */ - read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, false, !(test_mode == USE_MULTIPLE_DATASETS_MIXED_FILTERED || alloc_time == H5D_ALLOC_TIME_LATE)); + /* If some writes succeeded (due to mixed filtered mode) or if allocation time is late, then there is data + * on disk to be read */ + read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, + true, false, + !(test_mode == USE_MULTIPLE_DATASETS_MIXED_FILTERED || alloc_time == H5D_ALLOC_TIME_LATE)); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { hid_t dset_dcpl; @@ -4308,7 +4350,8 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group if (expected == SUCCEED) verify_chunk_opt_status(1, test_mode, true, false, true, false, false, dxpl_id); else - verify_chunk_opt_status(0, test_mode, false, true, true, false, alloc_time == H5D_ALLOC_TIME_LATE, dxpl_id); + verify_chunk_opt_status(0, test_mode, false, true, true, false, alloc_time == H5D_ALLOC_TIME_LATE, + dxpl_id); } for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) @@ -4334,8 +4377,11 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - /* If some writes succeeded (due to mixed filtered mode) or if allocation time is late, then there is data on disk to be read */ - read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, false, !(test_mode == USE_MULTIPLE_DATASETS_MIXED_FILTERED || alloc_time == H5D_ALLOC_TIME_LATE)); + /* If some writes succeeded (due to mixed filtered mode) or if allocation time is late, then there is data + * on disk to be read */ + read_datasets(num_dsets, dset_ids, memtype, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, + true, false, + !(test_mode == USE_MULTIPLE_DATASETS_MIXED_FILTERED || alloc_time == H5D_ALLOC_TIME_LATE)); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { hid_t dset_dcpl; @@ -4500,8 +4546,8 @@ test_read_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t filt select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, - test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, + data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -4556,8 +4602,8 @@ test_read_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t filt VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -4720,8 +4766,8 @@ test_read_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fil select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, - test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, + data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -4776,8 +4822,8 @@ test_read_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fil VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -4942,8 +4988,8 @@ test_read_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filter select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, - test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, + data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -4998,8 +5044,8 @@ test_read_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filter VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -5188,8 +5234,8 @@ test_read_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fil select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, - test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, + data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -5254,8 +5300,8 @@ test_read_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fil } } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, mpi_size > 1 ? true : false, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, mpi_size > 1 ? true : false, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -5420,8 +5466,8 @@ test_read_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filter select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, - test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, + data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -5466,8 +5512,8 @@ test_read_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filter for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(data_bufs_nc[dset_idx], 0, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, false, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, false, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], data_bufs[dset_idx], data_size)), @@ -5610,8 +5656,8 @@ test_read_filtered_dataset_point_selection(const char *parent_group, H5Z_filter_ select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, - test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, + data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -5667,8 +5713,8 @@ test_read_filtered_dataset_point_selection(const char *parent_group, H5Z_filter_ VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -5865,8 +5911,8 @@ test_read_filtered_dataset_interleaved_read(const char *parent_group, H5Z_filter select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, - test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, + data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -5923,8 +5969,8 @@ test_read_filtered_dataset_interleaved_read(const char *parent_group, H5Z_filter VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -6106,8 +6152,8 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_group select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, - test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, + data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -6170,8 +6216,8 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_group VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -6363,8 +6409,8 @@ test_read_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z_ select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, - test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, + data_bufs, test_mode, true, false, false); VRFY((H5Pclose(plist_id) >= 0), "DXPL close succeeded"); @@ -6430,8 +6476,8 @@ test_read_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z_ VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -6599,8 +6645,8 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H5 select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, - test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, + data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -6662,8 +6708,8 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H5 VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -6846,8 +6892,8 @@ test_read_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fil select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, - test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, + data_bufs, test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -6907,8 +6953,8 @@ test_read_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fil VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -7116,7 +7162,8 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group, select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -7172,7 +7219,8 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group, VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -7366,7 +7414,8 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, H select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -7422,7 +7471,8 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, H VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -7619,7 +7669,8 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_grou select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -7675,7 +7726,8 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_grou VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, test_mode, true, false, false); + read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, false, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -7878,7 +7930,8 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group, select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, memtype, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, + test_mode, true, false, false); /* Verify space allocation status */ plist_id = H5Dget_create_plist(dset_ids[0]); @@ -7934,7 +7987,8 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group, VRFY((NULL != read_bufs[dset_idx]), "calloc succeeded"); } - read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, test_mode, true, false, false); + read_datasets(num_dsets, dset_ids, memtype, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, + test_mode, true, false, false); /* Collect each piece of data from all ranks into a global buffer on all ranks */ global_buf = calloc(1, data_size); @@ -8087,8 +8141,8 @@ test_write_serial_read_parallel(const char *parent_group, H5Z_filter_t filter_id select_all(num_dsets, dset_ids, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, data_bufs, - test_mode, true, false, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, fspace_ids, dcpl_id, H5P_DEFAULT, + data_bufs, test_mode, true, false, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -8132,7 +8186,8 @@ test_write_serial_read_parallel(const char *parent_group, H5Z_filter_t filter_id open_datasets(group_id, WRITE_SERIAL_READ_PARALLEL_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -8258,8 +8313,8 @@ test_write_parallel_read_serial(const char *parent_group, H5Z_filter_t filter_id data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) free(data_bufs_nc[dset_idx]); @@ -8309,8 +8364,8 @@ test_write_parallel_read_serial(const char *parent_group, H5Z_filter_t filter_id (j / (dataset_dims[0] * dataset_dims[1])) + dset_idx); } - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, H5P_DEFAULT, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, H5P_DEFAULT, + read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], correct_bufs[dset_idx], correct_buf_size)), @@ -8447,8 +8502,8 @@ test_shrinking_growing_chunks(const char *parent_group, H5Z_filter_t filter_id, } } - write_datasets(num_dsets, dset_ids, H5T_NATIVE_DOUBLE, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, i > 0); + write_datasets(num_dsets, dset_ids, H5T_NATIVE_DOUBLE, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, i > 0); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -8462,8 +8517,8 @@ test_shrinking_growing_chunks(const char *parent_group, H5Z_filter_t filter_id, } } - read_datasets(num_dsets, dset_ids, H5T_NATIVE_DOUBLE, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, H5T_NATIVE_DOUBLE, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], data_bufs[dset_idx], data_size)), @@ -8592,8 +8647,8 @@ test_edge_chunks_no_overlap(const char *parent_group, H5Z_filter_t filter_id, hi read_bufs[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, @@ -8606,8 +8661,8 @@ test_edge_chunks_no_overlap(const char *parent_group, H5Z_filter_t filter_id, hi /* Verify the correct data was written */ open_datasets(group_id, WRITE_UNSHARED_FILTERED_EDGE_CHUNKS_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], data_bufs[dset_idx], data_size)), @@ -8651,8 +8706,8 @@ test_edge_chunks_no_overlap(const char *parent_group, H5Z_filter_t filter_id, hi select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, @@ -8668,8 +8723,8 @@ test_edge_chunks_no_overlap(const char *parent_group, H5Z_filter_t filter_id, hi for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(read_bufs[dset_idx], 255, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], data_bufs[dset_idx], data_size)), @@ -8798,8 +8853,8 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t read_bufs[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, SOME_CHUNKS_WRITTEN); @@ -8810,8 +8865,8 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t /* Verify the correct data was written */ open_datasets(group_id, WRITE_SHARED_FILTERED_EDGE_CHUNKS_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], data_bufs[dset_idx], data_size)), @@ -8856,8 +8911,8 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, SOME_CHUNKS_WRITTEN); @@ -8871,8 +8926,8 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) memset(read_bufs[dset_idx], 255, data_size); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, read_bufs, - test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids[0], dcpl_id, dxpl_id, + read_bufs, test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((0 == memcmp(read_bufs[dset_idx], data_bufs[dset_idx], data_size)), @@ -8980,7 +9035,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id } /* Read entire dataset and verify that the fill value is returned */ - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, true); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, true); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { for (size_t j = 0; j < read_buf_size / sizeof(C_DATATYPE); j++) @@ -9022,8 +9078,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, SOME_CHUNKS_WRITTEN); @@ -9034,7 +9090,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id /* Verify correct data was written */ open_datasets(group_id, FILL_VALUES_TEST_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* * Each MPI rank communicates their written piece of data @@ -9082,8 +9139,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, true); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, true); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -9094,7 +9151,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id /* Verify correct data was written */ open_datasets(group_id, FILL_VALUES_TEST_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { C_DATATYPE *tmp_buf = read_bufs[dset_idx]; @@ -9127,7 +9185,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); /* Read entire dataset and verify that the fill value is returned */ - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, true); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, true); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { for (size_t j = 0; j < read_buf_size / sizeof(C_DATATYPE); j++) @@ -9162,8 +9221,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id tmp_buf[j] = (C_DATATYPE)(GEN_DATA(j) + dset_idx); } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, SOME_CHUNKS_WRITTEN); @@ -9174,7 +9233,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id /* Verify correct data was written */ open_datasets(group_id, FILL_VALUES_TEST_DATASET_NAME2, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t i = 0; i < (size_t)mpi_size; i++) { recvcounts[i] = (int)(count[1] * block[1]); @@ -9216,8 +9276,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, true); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, true); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -9228,7 +9288,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id /* Verify correct data was written */ open_datasets(group_id, FILL_VALUES_TEST_DATASET_NAME2, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { C_DATATYPE *tmp_buf = read_bufs[dset_idx]; @@ -9405,7 +9466,9 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ if (expected == SUCCEED) verify_chunk_opt_status(1, test_mode, true, false, true, false, false, dxpl_id); else - verify_chunk_opt_status(0, test_mode, false, true, true, alloc_time == H5D_ALLOC_TIME_INCR || alloc_time == H5D_ALLOC_TIME_LATE, false, dxpl_id); + verify_chunk_opt_status( + 0, test_mode, false, true, true, + alloc_time == H5D_ALLOC_TIME_INCR || alloc_time == H5D_ALLOC_TIME_LATE, false, dxpl_id); } } @@ -9439,8 +9502,8 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, SOME_CHUNKS_WRITTEN); @@ -9450,7 +9513,8 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ open_datasets(group_id, FILL_VALUE_UNDEFINED_TEST_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) VRFY((H5Sclose(fspace_ids[dset_idx]) >= 0), "File dataspace close succeeded"); @@ -9474,8 +9538,8 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, true); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, true); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -9486,7 +9550,8 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ /* Verify correct data was written */ open_datasets(group_id, FILL_VALUE_UNDEFINED_TEST_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { free(data_bufs_nc[dset_idx]); @@ -9631,7 +9696,8 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap VRFY((NULL != fill_buf), "calloc succeeded"); /* Read entire dataset and verify that the fill value isn't returned */ - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, true); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, true); for (size_t i = 0; i < read_buf_size / sizeof(C_DATATYPE); i++) fill_buf[i] = FILL_TIME_NEVER_TEST_FILL_VAL; @@ -9676,8 +9742,8 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap data_bufs_nc[dset_idx] = tmp_buf; } - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, SOME_CHUNKS_WRITTEN); @@ -9688,7 +9754,8 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap /* Verify correct data was written */ open_datasets(group_id, FILL_TIME_NEVER_TEST_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); /* * Each MPI rank communicates their written piece of data @@ -9740,8 +9807,8 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap select_hyperslab(num_dsets, dset_ids, start, stride, count, block, fspace_ids); - write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, data_bufs, - test_mode, true, true, false); + write_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_BLOCK, fspace_ids, dcpl_id, dxpl_id, + data_bufs, test_mode, true, true, false); /* Verify space allocation status */ verify_space_alloc_status(num_dsets, dset_ids, plist_id, ALL_CHUNKS_WRITTEN); @@ -9752,7 +9819,8 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap /* Verify correct data was written */ open_datasets(group_id, FILL_TIME_NEVER_TEST_DATASET_NAME, num_dsets, test_mode, dset_ids); - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, false); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, false); for (size_t dset_idx = 0; dset_idx < num_dsets; dset_idx++) { C_DATATYPE *tmp_buf = read_bufs[dset_idx]; diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index 6ff4568d5ee..b85af3264ff 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -54,12 +54,12 @@ int curr_nerrors = 0; */ typedef enum { <<<<<<< HEAD - TEST_NO_TYPE_CONV, /* no type conversion (null case) */ - TEST_NO_SIZE_CHANGE_NO_BKG, /* no size change, no bkg buffer */ - TEST_LARGER_MEM_NO_BKG, /* larger memory type, no bkg buffer */ - TEST_SMALLER_MEM_NO_BKG, /* smaller memory type, no bkg buffer */ - TEST_CMPD_WITH_BKG, /* compound types with bkg buffer */ - TEST_TYPE_CONV_SEL_EMPTY, /* some processes have null/empty selections and with type conversion */ + TEST_NO_TYPE_CONV, /* no type conversion (null case) */ + TEST_NO_SIZE_CHANGE_NO_BKG, /* no size change, no bkg buffer */ + TEST_LARGER_MEM_NO_BKG, /* larger memory type, no bkg buffer */ + TEST_SMALLER_MEM_NO_BKG, /* smaller memory type, no bkg buffer */ + TEST_CMPD_WITH_BKG, /* compound types with bkg buffer */ + TEST_TYPE_CONV_SEL_EMPTY, /* some processes have null/empty selections and with type conversion */ ======= TEST_NO_TYPE_CONV, /* no type conversion (null case) */ TEST_NO_SIZE_CHANGE_NO_BKG, /* no size change, no bkg buffer */ @@ -80,9 +80,9 @@ typedef enum { #define DSET_SELECT_DIM 100 #define DSET_SELECT_CHUNK_DIM 10 -#define MULTI_NUM_DSETS 3 -#define MULTI_MIN_DSETS 3 -#define DSET_NAME_LEN 64 +#define MULTI_NUM_DSETS 3 +#define MULTI_MIN_DSETS 3 +#define DSET_NAME_LEN 64 /* Compound type */ typedef struct s1_t { @@ -128,8 +128,8 @@ typedef enum { } multi_dset_type_t; /* Test setting A and B */ -#define SETTING_A 1 -#define SETTING_B 2 +#define SETTING_A 1 +#define SETTING_B 2 /* Definitions of the test modes for test_get_no_selection_io_cause() */ #define TEST_DISABLE_BY_API 0x001 @@ -139,9 +139,9 @@ typedef enum { #define TEST_IN_PLACE_TCONV 0x010 /* Definitions used by test_bug_optimized_bufs() and test_bug_api_library() */ -#define DIMS 10000 -#define BIG_X_FACTOR 1048576 -#define BIG_Y_FACTOR 32 +#define DIMS 10000 +#define BIG_X_FACTOR 1048576 +#define BIG_Y_FACTOR 32 /* * Helper routine to set dxpl From f27ffa5ff4c992aab30ab63740f6ac737bb44ff0 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Thu, 19 Oct 2023 15:03:38 -0500 Subject: [PATCH 30/37] Add RELEASE.txt entry --- release_docs/RELEASE.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index bcc91df70d2..c520f7d2e56 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -201,6 +201,12 @@ New Features Library: -------- + - Added new API function H5Pget_actual_selection_io_mode() + + This function allows the user to determine if the library performed + selection I/O, vector I/O, or scalar (legacy) I/O during the last HDF5 + operation performed with the provided DXPL. + - Added support for in-place type conversion in most cases In-place type conversion allows the library to perform type conversion From 93efdd7b9a768248847fd33fa24bccc6de7832ae Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Thu, 19 Oct 2023 15:06:29 -0500 Subject: [PATCH 31/37] Remove conflict resoltuion text --- testpar/t_select_io_dset.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index b85af3264ff..f66c2295d73 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -53,22 +53,12 @@ int curr_nerrors = 0; * Test configurations */ typedef enum { -<<<<<<< HEAD TEST_NO_TYPE_CONV, /* no type conversion (null case) */ TEST_NO_SIZE_CHANGE_NO_BKG, /* no size change, no bkg buffer */ TEST_LARGER_MEM_NO_BKG, /* larger memory type, no bkg buffer */ TEST_SMALLER_MEM_NO_BKG, /* smaller memory type, no bkg buffer */ TEST_CMPD_WITH_BKG, /* compound types with bkg buffer */ TEST_TYPE_CONV_SEL_EMPTY, /* some processes have null/empty selections and with type conversion */ -======= - TEST_NO_TYPE_CONV, /* no type conversion (null case) */ - TEST_NO_SIZE_CHANGE_NO_BKG, /* no size change, no bkg buffer */ - TEST_LARGER_MEM_NO_BKG, /* larger memory type, no bkg buffer */ - TEST_SMALLER_MEM_NO_BKG, /* smaller memory type, no bkg buffer */ - TEST_CMPD_WITH_BKG, /* compound types with bkg buffer */ - TEST_TYPE_CONV_SEL_EMPTY, /* some processes have null/empty selections and with type conversion */ -#ifdef OUT ->>>>>>> 45187118ec5e42934279244a0c634a14fafbfe76 TEST_MULTI_CONV_NO_BKG, /* multi dataset test 1 */ TEST_MULTI_CONV_BKG, /* multi dataset test 2 */ TEST_MULTI_CONV_SIZE_CHANGE, /* multi dataset test 3 */ From 7660d9e283a89717c2e389bbc2de6deb7b2e5596 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Thu, 19 Oct 2023 15:21:16 -0500 Subject: [PATCH 32/37] Run bin/format_source --- testpar/t_select_io_dset.c | 94 +++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 38 deletions(-) diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index f66c2295d73..16dfb665f2c 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -53,12 +53,12 @@ int curr_nerrors = 0; * Test configurations */ typedef enum { - TEST_NO_TYPE_CONV, /* no type conversion (null case) */ - TEST_NO_SIZE_CHANGE_NO_BKG, /* no size change, no bkg buffer */ - TEST_LARGER_MEM_NO_BKG, /* larger memory type, no bkg buffer */ - TEST_SMALLER_MEM_NO_BKG, /* smaller memory type, no bkg buffer */ - TEST_CMPD_WITH_BKG, /* compound types with bkg buffer */ - TEST_TYPE_CONV_SEL_EMPTY, /* some processes have null/empty selections and with type conversion */ + TEST_NO_TYPE_CONV, /* no type conversion (null case) */ + TEST_NO_SIZE_CHANGE_NO_BKG, /* no size change, no bkg buffer */ + TEST_LARGER_MEM_NO_BKG, /* larger memory type, no bkg buffer */ + TEST_SMALLER_MEM_NO_BKG, /* smaller memory type, no bkg buffer */ + TEST_CMPD_WITH_BKG, /* compound types with bkg buffer */ + TEST_TYPE_CONV_SEL_EMPTY, /* some processes have null/empty selections and with type conversion */ TEST_MULTI_CONV_NO_BKG, /* multi dataset test 1 */ TEST_MULTI_CONV_BKG, /* multi dataset test 2 */ TEST_MULTI_CONV_SIZE_CHANGE, /* multi dataset test 3 */ @@ -70,9 +70,9 @@ typedef enum { #define DSET_SELECT_DIM 100 #define DSET_SELECT_CHUNK_DIM 10 -#define MULTI_NUM_DSETS 3 -#define MULTI_MIN_DSETS 3 -#define DSET_NAME_LEN 64 +#define MULTI_NUM_DSETS 3 +#define MULTI_MIN_DSETS 3 +#define DSET_NAME_LEN 64 /* Compound type */ typedef struct s1_t { @@ -118,8 +118,8 @@ typedef enum { } multi_dset_type_t; /* Test setting A and B */ -#define SETTING_A 1 -#define SETTING_B 2 +#define SETTING_A 1 +#define SETTING_B 2 /* Definitions of the test modes for test_get_no_selection_io_cause() */ #define TEST_DISABLE_BY_API 0x001 @@ -129,9 +129,9 @@ typedef enum { #define TEST_IN_PLACE_TCONV 0x010 /* Definitions used by test_bug_optimized_bufs() and test_bug_api_library() */ -#define DIMS 10000 -#define BIG_X_FACTOR 1048576 -#define BIG_Y_FACTOR 32 +#define DIMS 10000 +#define BIG_X_FACTOR 1048576 +#define BIG_Y_FACTOR 32 /* * Helper routine to set dxpl @@ -1300,8 +1300,10 @@ test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned if (mwbuf) memcpy(lwbuf, lwbuf_bak, sizeof(lwbuf)); - /* If not using selection I/O there will be no collective I/O, since type conversion is unsupported by legacy collective I/O */ - testing_check_io_mode(dxpl, select ? (chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE) : 0); + /* If not using selection I/O there will be no collective I/O, since type conversion is unsupported by + * legacy collective I/O */ + testing_check_io_mode( + dxpl, select ? (chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE) : 0); /* If not using selection I/O then the main process will do scalar I/O and others will do none */ check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : (MAINPROCESS ? H5D_SCALAR_IO : 0)); @@ -1459,7 +1461,6 @@ test_type_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, unsigned } /* test_type_conv_sel_empty() */ - /* * Test 1 for multi-dataset: * --Datasets with/without type conversion+smaller/larger mem type+no background buffer @@ -1537,7 +1538,8 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned s P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, + H5FD_MPIO_COLLECTIVE_IO, mwbuf); if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) P_TEST_ERROR; @@ -1556,7 +1558,8 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned s /* Generate dataset name */ snprintf(dset_names[i], sizeof(dset_names[i]), "multi_dset%d_%s_%s_%s_%s", i, - chunked ? "chunked" : "contig", dtrans ? "xform" : "noxform", select ? "select" : "noselect", mwbuf ? "mwbuf" : "nomwbuf"); + chunked ? "chunked" : "contig", dtrans ? "xform" : "noxform", select ? "select" : "noselect", + mwbuf ? "mwbuf" : "nomwbuf"); /* Flip a coin to see if we're doing type conversion */ tconv = HDrandom() % 2; @@ -1564,9 +1567,8 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned s any_tconv = true; /* Create ith dataset */ - if ((dset_dids[i] = - H5Dcreate2(fid, dset_names[i], (tconv ? H5T_NATIVE_LONG : H5T_NATIVE_INT), - file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], (tconv ? H5T_NATIVE_LONG : H5T_NATIVE_INT), + file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) P_TEST_ERROR; } @@ -1642,8 +1644,11 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned s if (mwbuf) memcpy(total_wbuf, total_wbuf_bak, ndsets * DSET_SELECT_DIM * sizeof(int)); - /* If doing type conversion or transform and not using selection I/O there will be no collective I/O, since type conversion is unsupported by legacy collective I/O */ - testing_check_io_mode(dxpl, ((any_tconv || dtrans) && !select) ? 0 : (chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE)); + /* If doing type conversion or transform and not using selection I/O there will be no collective I/O, + * since type conversion is unsupported by legacy collective I/O */ + testing_check_io_mode(dxpl, ((any_tconv || dtrans) && !select) + ? 0 + : (chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE)); check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); /* Read data from the dataset (if dtrans, without data transform set in dxpl) */ @@ -1858,7 +1863,8 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned select, uns P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, + H5FD_MPIO_COLLECTIVE_IO, mwbuf); /* Each process takes x number of elements */ block[0] = dims[0] / (hsize_t)mpi_size; @@ -2312,7 +2318,8 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned select P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, + H5FD_MPIO_COLLECTIVE_IO, mwbuf); /* Set up file space ids, mem space ids, and dataset ids */ for (i = 0; i < (int)ndsets; i++) { @@ -2659,7 +2666,8 @@ test_multi_dsets_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, un P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, + H5FD_MPIO_COLLECTIVE_IO, mwbuf); if ((ntrans_dxpl = H5Pcopy(dxpl)) < 0) P_TEST_ERROR; @@ -2676,7 +2684,8 @@ test_multi_dsets_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, un /* Generate dataset name */ snprintf(dset_names[i], sizeof(dset_names[i]), "multi_sel_dset%d_%s_%s_%s_%s", i, - chunked ? "chunked" : "contig", dtrans ? "xform" : "noxform", select ? "select" : "noselect", mwbuf ? "mwbuf" : "nomwbuf"); + chunked ? "chunked" : "contig", dtrans ? "xform" : "noxform", select ? "select" : "noselect", + mwbuf ? "mwbuf" : "nomwbuf"); if (i == 0) { if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], H5T_NATIVE_INT, file_sids[i], H5P_DEFAULT, @@ -2860,8 +2869,10 @@ test_multi_dsets_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, un if (mwbuf) memcpy(total_wbuf, total_wbuf_bak, buf_size); - /* If not using selection I/O there will be no collective I/O, since type conversion is unsupported by legacy collective I/O */ - testing_check_io_mode(dxpl, select ? (chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE) : 0); + /* If not using selection I/O there will be no collective I/O, since type conversion is unsupported by + * legacy collective I/O */ + testing_check_io_mode( + dxpl, select ? (chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE) : 0); check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); /* Initialize buffer indices */ @@ -3073,7 +3084,8 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned select, un P_TEST_ERROR; /* Set selection I/O mode, type of I/O and type of collective I/O */ - set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, H5FD_MPIO_COLLECTIVE_IO, mwbuf); + set_dxpl(dxpl, select ? H5D_SELECTION_IO_MODE_ON : H5D_SELECTION_IO_MODE_OFF, H5FD_MPIO_COLLECTIVE, + H5FD_MPIO_COLLECTIVE_IO, mwbuf); /* Set dataset layout: contiguous or chunked */ dims[0] = DSET_SELECT_DIM; @@ -3135,7 +3147,8 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned select, un if (mm == 0) { dset_types[i] = DSET_WITH_NO_CONV; snprintf(dset_names[i], sizeof(dset_names[i]), "multi_all_nconv_dset%d_%s_%s_%s", i, - chunked ? "chunked" : "contig", select ? "select" : "noselect", mwbuf ? "mwbuf" : "nomwbuf"); + chunked ? "chunked" : "contig", select ? "select" : "noselect", + mwbuf ? "mwbuf" : "nomwbuf"); if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], H5T_NATIVE_INT, file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) P_TEST_ERROR; @@ -3143,7 +3156,8 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned select, un else if (mm == 1) { dset_types[i] = DSET_WITH_CONV_AND_NO_BKG; snprintf(dset_names[i], sizeof(dset_names[i]), "multi_all_conv_nbkg_dset%d_%s_%s_%s", i, - chunked ? "chunked" : "contig", select ? "select" : "noselect", mwbuf ? "mwbuf" : "nomwbuf"); + chunked ? "chunked" : "contig", select ? "select" : "noselect", + mwbuf ? "mwbuf" : "nomwbuf"); if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], H5T_NATIVE_LONG, file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) P_TEST_ERROR; @@ -3151,7 +3165,8 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned select, un else { dset_types[i] = DSET_WITH_CONV_AND_BKG; snprintf(dset_names[i], sizeof(dset_names[i]), "multi_all_conv_bkg_dset%d_%s_%s_%s", i, - chunked ? "chunked" : "contig", select ? "select" : "noselect", mwbuf ? "mwbuf" : "nomwbuf"); + chunked ? "chunked" : "contig", select ? "select" : "noselect", + mwbuf ? "mwbuf" : "nomwbuf"); if ((dset_dids[i] = H5Dcreate2(fid, dset_names[i], s1_tid, file_sids[i], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) P_TEST_ERROR; @@ -3349,8 +3364,11 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned select, un if (H5Dread_multi(ndsets, dset_dids, r_mem_tids, mem_sids, file_sids, dxpl, rbufs) < 0) P_TEST_ERROR; - /* If doing type conversion and not using selection I/O there will be no collective I/O, since type conversion is unsupported by legacy collective I/O */ - testing_check_io_mode(dxpl, (any_tconv && !select) ? 0 : (chunked ? H5D_MPIO_CHUNK_COLLECTIVE : H5D_MPIO_CONTIGUOUS_COLLECTIVE)); + /* If doing type conversion and not using selection I/O there will be no collective I/O, since + * type conversion is unsupported by legacy collective I/O */ + testing_check_io_mode(dxpl, (any_tconv && !select) ? 0 + : (chunked ? H5D_MPIO_CHUNK_COLLECTIVE + : H5D_MPIO_CONTIGUOUS_COLLECTIVE)); check_actual_selection_io_mode(dxpl, select ? H5D_SELECTION_IO : H5D_SCALAR_IO); /* Verify result read */ @@ -4253,8 +4271,8 @@ main(int argc, char *argv[]) } /* end mwbuf */ } /* end select */ - } /* end dtrans */ - } /* end chunked */ + } /* end dtrans */ + } /* end chunked */ if (H5Fclose(fid) < 0) P_TEST_ERROR; From 2f939707a707e16ad78a6d67477d134d1157b86c Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Thu, 19 Oct 2023 22:11:36 -0500 Subject: [PATCH 33/37] Address review comments, add more comments, revert behaviour of scalar I/O with size 0 --- doxygen/examples/tables/propertyLists.dox | 2 +- src/H5CX.c | 4 +-- src/H5FDint.c | 24 ++++++------- src/H5Ppublic.h | 4 +-- testpar/t_filters_parallel.c | 7 +++- testpar/t_select_io_dset.c | 44 +++++------------------ 6 files changed, 31 insertions(+), 54 deletions(-) diff --git a/doxygen/examples/tables/propertyLists.dox b/doxygen/examples/tables/propertyLists.dox index ed4ff41484d..340e13c26a5 100644 --- a/doxygen/examples/tables/propertyLists.dox +++ b/doxygen/examples/tables/propertyLists.dox @@ -712,7 +712,7 @@ of the library for reading or writing the actual data. #H5Pget_actual_selection_io_mode -Gets the type(s) (scalar, vector, selection) of raw data I/O performed I/O on the last I/O call. +Gets the type(s) (scalar, vector, selection) of raw data I/O performed on the last I/O call. #H5Pset_modify_write_buf/#H5Pget_modify_write_buf diff --git a/src/H5CX.c b/src/H5CX.c index d6b8e5c06ca..2c593ded829 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -2546,7 +2546,7 @@ H5CX_get_actual_selection_io_mode(uint32_t *actual_selection_io_mode) assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); /* This property is a special case - we want to wipe out any previous setting. Copy the default setting - * if */ + * if it has not been set yet. */ if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT && !(*head)->ctx.actual_selection_io_mode_set && !(*head)->ctx.actual_selection_io_mode_valid) { (*head)->ctx.actual_selection_io_mode = H5CX_def_dxpl_cache.actual_selection_io_mode; @@ -3548,7 +3548,7 @@ H5CX_set_actual_selection_io_mode(uint32_t actual_selection_io_mode) if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT) { /* Cache the value for later, marking it to set in DXPL when context popped */ (*head)->ctx.actual_selection_io_mode = actual_selection_io_mode; - (*head)->ctx.actual_selection_io_mode_set = TRUE; + (*head)->ctx.actual_selection_io_mode_set = true; } FUNC_LEAVE_NOAPI_VOID diff --git a/src/H5FDint.c b/src/H5FDint.c index cd8006f2948..18bca49dc89 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -259,7 +259,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, void *buf /* HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW && size > 0) { + if (type == H5FD_MEM_DRAW) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_SCALAR_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); @@ -318,7 +318,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, const void HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW && size > 0) { + if (type == H5FD_MEM_DRAW) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_SCALAR_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); @@ -480,7 +480,7 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs /* We must still check if this is a raw data read */ for (i = 0; i < count && types[i] != H5FD_MEM_NOLIST; i++) if (types[i] == H5FD_MEM_DRAW) { - is_raw = TRUE; + is_raw = true; break; } @@ -693,7 +693,7 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr /* Check for raw data operation */ if (type == H5FD_MEM_DRAW) - is_raw = TRUE; + is_raw = true; } } @@ -1067,13 +1067,13 @@ H5FD__read_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_t HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read vector request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW) { + if (type == H5FD_MEM_DRAW && count > 0) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_VECTOR_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } } - else { + else if (count > 0) { uint32_t no_selection_io_cause; uint32_t actual_selection_io_mode; @@ -1270,7 +1270,7 @@ H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_s HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read selection request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW) { + if (type == H5FD_MEM_DRAW && count > 0) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_SELECTION_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); @@ -1433,7 +1433,7 @@ H5FD_read_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_t HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read selection request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW) { + if (type == H5FD_MEM_DRAW && count > 0) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_SELECTION_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); @@ -1759,13 +1759,13 @@ H5FD__write_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_ HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write vector request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW) { + if (type == H5FD_MEM_DRAW && count > 0) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_VECTOR_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); } } - else { + else if (count > 0) { uint32_t no_selection_io_cause; uint32_t actual_selection_io_mode; @@ -1954,7 +1954,7 @@ H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_ HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write selection request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW) { + if (type == H5FD_MEM_DRAW && count > 0) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_SELECTION_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); @@ -2110,7 +2110,7 @@ H5FD_write_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_ HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write selection request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW) { + if (type == H5FD_MEM_DRAW && count > 0) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_SELECTION_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 7cb2eaffe4b..d822925bc0d 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -5818,7 +5818,7 @@ H5_DLL int H5Pget_external_count(hid_t plist_id); * \note H5Pget_fill_time() is designed to work in coordination with the * dataset fill value and dataset storage allocation time properties, * retrieved with the functions H5Pget_fill_value() and - * H5Pget_alloc_time(). + * H5Pget_alloc_time().type == H5FD_MEM_DRAW * * \since 1.6.0 * @@ -8356,7 +8356,7 @@ H5_DLL herr_t H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selectio * or sieve buffer, which may prevent I/O from hitting the disk, and * thereby prevent it from being counted by this function. * - * \since 1.14.2 + * \since 1.14.3 * */ H5_DLL herr_t H5Pget_actual_selection_io_mode(hid_t plist_id, uint32_t *actual_selection_io_mode); diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 631e12f9854..2f2cc911de6 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -545,14 +545,16 @@ verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bo /* Verify selection I/O mode on rank 0 */ if (mpi_rank == 0) { + /* No actual I/O performed, only reported I/O will be from allocation, even if "no" datasets were involved (num_dsets == 0 implies the call was expected to fail, but it fails after allocation). Also if the test mode is mixed filtered and unfiltered and the call did not fail, then there will always be an I/O callback made with raw data. This is because unfiltered datasets fall back to scalar I/O when mixed with filtered, and scalar I/O reports an I/O call was made even with a size of 0 bytes, while vector I/O does not report I/O was made if passed 0 vector elements (because no elements were raw data), which is what happens when performing I/O on a filtered dataset with no selection. Vector I/O does report an I/O call was made if passed a raw data element of size 0, so this is consistent. */ if (!any_io) { - if (did_alloc) + if (did_alloc || (num_dsets > 0 && test_mode == USE_MULTIPLE_DATASETS_MIXED_FILTERED)) VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); else VRFY(0 == actual_sel_io_mode_reduced, "verified actual selection I/O mode was 0 (no I/O)"); } + /* No filters, library should have used selection I/O if enabled, scalar I/O otherwise */ else if (!any_filters) { assert(!unalloc_read && !did_alloc); if (sel_io_mode == H5D_SELECTION_IO_MODE_DEFAULT || sel_io_mode == H5D_SELECTION_IO_MODE_ON) @@ -562,6 +564,7 @@ verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bo VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); } + /* Independent I/O, library should have done no I/O if reading from unallocated datasets, scalar I/O otherwise, since fitlered I/O is only supported with scalar I/O in independent/serial */ else if (!collective) { if (unalloc_read) VRFY(0 == actual_sel_io_mode_reduced, @@ -574,6 +577,7 @@ verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bo switch (test_mode) { case USE_SINGLE_DATASET: case USE_MULTIPLE_DATASETS: + /* Collective case with only filtered datasets. If we performed allocation then there should be scalar I/O for allocation in addition to vector I/O for the actual data. If we're reading from an unallocated dataset then there should be no actual I/O. Otherwise there should only be vector I/O. */ if (did_alloc) VRFY((H5D_SCALAR_IO | H5D_VECTOR_IO) == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar and vector I/O"); @@ -586,6 +590,7 @@ verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bo break; case USE_MULTIPLE_DATASETS_MIXED_FILTERED: + /* Collective case with mixed filtered and unfiltered datasets. If we're reading from a unallocated datasets then there should be scalar I/O from reading the unfilitered datasets, since they are always allocated in parallel. Otherwise there should be vector I/O from the filtered datasets and scalar I/O from the unfiltered datasets. */ if (unalloc_read) VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index 16dfb665f2c..9aab9ecc573 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -3567,20 +3567,12 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ /* Datatype conversion */ if (test_mode & TEST_DATATYPE_CONVERSION) { - /* With one exception, all will land at H5FD__mpio_read/write_selection(). - * As the xfer mode is H5FD_MPIO_INDEPENDENT, this will call - * H5FD__read/write_from_selection() triggering H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB. - */ - // no_selection_io_cause_read_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; - - /* Exception case: This will turn off selection I/O landing at H5FD__mpio_write() */ - if ((test_mode & TEST_TCONV_BUF_TOO_SMALL) && !(test_mode & TEST_IN_PLACE_TCONV)) - no_selection_io_cause_write_expected |= H5D_SEL_IO_TCONV_BUF_TOO_SMALL; - else - // no_selection_io_cause_write_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; + /* With one exception, all will land at H5FD__mpio_read/write_selection() */ - if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_ON) < 0) + if (test_mode & TEST_IN_PLACE_TCONV) + if (H5Pset_modify_write_buf(dxpl, true) < 0) P_TEST_ERROR; + tid = H5T_NATIVE_UINT; /* If we're testing a too small tconv buffer, set the buffer to be too small */ @@ -3588,11 +3580,10 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ if (H5Pset_buffer(dxpl, sizeof(int), NULL, NULL) < 0) P_TEST_ERROR; - if (test_mode & TEST_IN_PLACE_TCONV) { - if (H5Pset_modify_write_buf(dxpl, true) < 0) - P_TEST_ERROR; - } - /* In-place type conversion for read doesn't require modify_write_buf */ + /* Exception case: When the type conversion buffer is too small and we're not allowing the library to modify the write buffer, the library will fall back to scalar independent I/O since the selection I/O path with type conversion requires a full size conversion buffer */ + if (!(test_mode & TEST_IN_PLACE_TCONV)) + /* In-place type conversion for read doesn't require modify_write_buf, so the read will still use selection I/O */ + no_selection_io_cause_write_expected |= H5D_SEL_IO_TCONV_BUF_TOO_SMALL; } } @@ -3664,9 +3655,6 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ static void test_get_no_selection_io_cause(const char *filename, hid_t fapl) { - hid_t dxpl = H5I_INVALID_HID; - H5D_selection_io_mode_t selection_io_mode; - if (MAINPROCESS) { printf("\n"); TESTING("for H5Pget_no_selection_io_cause()"); @@ -3674,24 +3662,8 @@ test_get_no_selection_io_cause(const char *filename, hid_t fapl) curr_nerrors = nerrors; - if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) - P_TEST_ERROR; - if (H5Pget_selection_io(dxpl, &selection_io_mode) < 0) - P_TEST_ERROR; - if (H5Pclose(dxpl) < 0) - P_TEST_ERROR; - - /* The following tests are based on H5D_SELECTION_IO_MODE_DEFAULT as the - * default setting in the library; skip the tests if that is not true */ - if (selection_io_mode != H5D_SELECTION_IO_MODE_DEFAULT) { - if (MAINPROCESS) - SKIPPED(); - return; - } - test_no_selection_io_cause_mode(filename, fapl, TEST_DISABLE_BY_API); test_no_selection_io_cause_mode(filename, fapl, TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET); - /* CHECK: the following tests: modified to have 0 expected ... things changed */ test_no_selection_io_cause_mode(filename, fapl, TEST_DATATYPE_CONVERSION); test_no_selection_io_cause_mode(filename, fapl, TEST_DATATYPE_CONVERSION | TEST_TCONV_BUF_TOO_SMALL); test_no_selection_io_cause_mode( From dbc45108e6fdfa770f4b5cb87545578ebe6c25c4 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Oct 2023 03:14:45 +0000 Subject: [PATCH 34/37] Committing clang-format changes --- testpar/t_filters_parallel.c | 24 ++++++++++++++++++++---- testpar/t_select_io_dset.c | 7 +++++-- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 2f2cc911de6..db8c53c2fb2 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -545,7 +545,15 @@ verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bo /* Verify selection I/O mode on rank 0 */ if (mpi_rank == 0) { - /* No actual I/O performed, only reported I/O will be from allocation, even if "no" datasets were involved (num_dsets == 0 implies the call was expected to fail, but it fails after allocation). Also if the test mode is mixed filtered and unfiltered and the call did not fail, then there will always be an I/O callback made with raw data. This is because unfiltered datasets fall back to scalar I/O when mixed with filtered, and scalar I/O reports an I/O call was made even with a size of 0 bytes, while vector I/O does not report I/O was made if passed 0 vector elements (because no elements were raw data), which is what happens when performing I/O on a filtered dataset with no selection. Vector I/O does report an I/O call was made if passed a raw data element of size 0, so this is consistent. */ + /* No actual I/O performed, only reported I/O will be from allocation, even if "no" datasets were + * involved (num_dsets == 0 implies the call was expected to fail, but it fails after allocation). + * Also if the test mode is mixed filtered and unfiltered and the call did not fail, then there + * will always be an I/O callback made with raw data. This is because unfiltered datasets fall + * back to scalar I/O when mixed with filtered, and scalar I/O reports an I/O call was made even + * with a size of 0 bytes, while vector I/O does not report I/O was made if passed 0 vector + * elements (because no elements were raw data), which is what happens when performing I/O on a + * filtered dataset with no selection. Vector I/O does report an I/O call was made if passed a raw + * data element of size 0, so this is consistent. */ if (!any_io) { if (did_alloc || (num_dsets > 0 && test_mode == USE_MULTIPLE_DATASETS_MIXED_FILTERED)) VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, @@ -564,7 +572,8 @@ verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bo VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); } - /* Independent I/O, library should have done no I/O if reading from unallocated datasets, scalar I/O otherwise, since fitlered I/O is only supported with scalar I/O in independent/serial */ + /* Independent I/O, library should have done no I/O if reading from unallocated datasets, scalar + * I/O otherwise, since fitlered I/O is only supported with scalar I/O in independent/serial */ else if (!collective) { if (unalloc_read) VRFY(0 == actual_sel_io_mode_reduced, @@ -577,7 +586,10 @@ verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bo switch (test_mode) { case USE_SINGLE_DATASET: case USE_MULTIPLE_DATASETS: - /* Collective case with only filtered datasets. If we performed allocation then there should be scalar I/O for allocation in addition to vector I/O for the actual data. If we're reading from an unallocated dataset then there should be no actual I/O. Otherwise there should only be vector I/O. */ + /* Collective case with only filtered datasets. If we performed allocation then there + * should be scalar I/O for allocation in addition to vector I/O for the actual data. + * If we're reading from an unallocated dataset then there should be no actual I/O. + * Otherwise there should only be vector I/O. */ if (did_alloc) VRFY((H5D_SCALAR_IO | H5D_VECTOR_IO) == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar and vector I/O"); @@ -590,7 +602,11 @@ verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bo break; case USE_MULTIPLE_DATASETS_MIXED_FILTERED: - /* Collective case with mixed filtered and unfiltered datasets. If we're reading from a unallocated datasets then there should be scalar I/O from reading the unfilitered datasets, since they are always allocated in parallel. Otherwise there should be vector I/O from the filtered datasets and scalar I/O from the unfiltered datasets. */ + /* Collective case with mixed filtered and unfiltered datasets. If we're reading from + * a unallocated datasets then there should be scalar I/O from reading the unfilitered + * datasets, since they are always allocated in parallel. Otherwise there should be + * vector I/O from the filtered datasets and scalar I/O from the unfiltered datasets. + */ if (unalloc_read) VRFY(H5D_SCALAR_IO == actual_sel_io_mode_reduced, "verified actual selection I/O mode was scalar I/O"); diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index 9aab9ecc573..2be2b407236 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -3580,9 +3580,12 @@ test_no_selection_io_cause_mode(const char *filename, hid_t fapl, uint32_t test_ if (H5Pset_buffer(dxpl, sizeof(int), NULL, NULL) < 0) P_TEST_ERROR; - /* Exception case: When the type conversion buffer is too small and we're not allowing the library to modify the write buffer, the library will fall back to scalar independent I/O since the selection I/O path with type conversion requires a full size conversion buffer */ + /* Exception case: When the type conversion buffer is too small and we're not allowing the library + * to modify the write buffer, the library will fall back to scalar independent I/O since the + * selection I/O path with type conversion requires a full size conversion buffer */ if (!(test_mode & TEST_IN_PLACE_TCONV)) - /* In-place type conversion for read doesn't require modify_write_buf, so the read will still use selection I/O */ + /* In-place type conversion for read doesn't require modify_write_buf, so the read will still + * use selection I/O */ no_selection_io_cause_write_expected |= H5D_SEL_IO_TCONV_BUF_TOO_SMALL; } } From 06782e31be0d1a36b03fcfe86102646e48b8a193 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Thu, 19 Oct 2023 22:15:47 -0500 Subject: [PATCH 35/37] spelling --- testpar/t_filters_parallel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index db8c53c2fb2..a34478728a8 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -573,7 +573,7 @@ verify_chunk_opt_status(size_t num_dsets, test_mode_t test_mode, bool any_io, bo "verified actual selection I/O mode was scalar I/O"); } /* Independent I/O, library should have done no I/O if reading from unallocated datasets, scalar - * I/O otherwise, since fitlered I/O is only supported with scalar I/O in independent/serial */ + * I/O otherwise, since filtered I/O is only supported with scalar I/O in independent/serial */ else if (!collective) { if (unalloc_read) VRFY(0 == actual_sel_io_mode_reduced, From f6e448d3e0396b6f4b0aec635df520a9dfe1addb Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Thu, 19 Oct 2023 22:36:35 -0500 Subject: [PATCH 36/37] Fix formatting --- testpar/t_filters_parallel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index cbb2677f56c..6c054085ed7 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -9803,7 +9803,8 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap * yet, because there's no guarantee as to what may have been * read from the dataset. */ - read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, test_mode, true, true, true); + read_datasets(num_dsets, dset_ids, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dcpl_id, dxpl_id, read_bufs, + test_mode, true, true, true); /* * Write to part of the first chunk in the dataset with From 1fcab120629aa7635ddbe60ee11d448fc0041a75 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Fri, 20 Oct 2023 09:34:06 -0500 Subject: [PATCH 37/37] Revert behavior of selection I/O callbacks to report having done selection I/O even if there are no selections (because the callback is still being made with H5FD_MEM_DRAW) --- src/H5FDint.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5FDint.c b/src/H5FDint.c index 18bca49dc89..5d3a80212ef 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -1270,7 +1270,7 @@ H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_s HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read selection request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW && count > 0) { + if (type == H5FD_MEM_DRAW) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_SELECTION_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); @@ -1433,7 +1433,7 @@ H5FD_read_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_t HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read selection request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW && count > 0) { + if (type == H5FD_MEM_DRAW) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_SELECTION_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); @@ -1954,7 +1954,7 @@ H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_ HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write selection request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW && count > 0) { + if (type == H5FD_MEM_DRAW) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_SELECTION_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode); @@ -2110,7 +2110,7 @@ H5FD_write_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_ HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write selection request failed"); /* Set actual selection I/O, if this is a raw data operation */ - if (type == H5FD_MEM_DRAW && count > 0) { + if (type == H5FD_MEM_DRAW) { H5CX_get_actual_selection_io_mode(&actual_selection_io_mode); actual_selection_io_mode |= H5D_SELECTION_IO; H5CX_set_actual_selection_io_mode(actual_selection_io_mode);