diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5CX.c | 101 | ||||
-rw-r--r-- | src/H5CXprivate.h | 2 | ||||
-rw-r--r-- | src/H5Dio.c | 76 | ||||
-rw-r--r-- | src/H5Dprivate.h | 19 | ||||
-rw-r--r-- | src/H5FDint.c | 155 | ||||
-rw-r--r-- | src/H5M.c | 21 | ||||
-rw-r--r-- | src/H5Pdxpl.c | 46 | ||||
-rw-r--r-- | src/H5Ppublic.h | 262 |
8 files changed, 568 insertions, 114 deletions
@@ -299,6 +299,11 @@ typedef struct H5CX_t { bool no_selection_io_cause_set; /* Whether reason for not performing selection I/O is set */ bool 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 */ + 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 */ bool encoding_valid; /* Whether link name character encoding is valid */ @@ -380,6 +385,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) */ bool modify_write_buf; /* Whether the library can modify write buffers */ } H5CX_dxpl_cache_t; @@ -571,13 +578,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"); @@ -2515,6 +2527,47 @@ done: } /* end H5CX_get_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. + * + * Return: Non-negative on success / Negative on failure + * + *------------------------------------------------------------------------- + */ +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 */ + assert(actual_selection_io_mode); + head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + 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 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; + (*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) + + /* 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 * * Purpose: Retrieves the modify write buffer property for the current API call context. @@ -3443,7 +3496,7 @@ done: #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. @@ -3472,7 +3525,39 @@ 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_selection_io_mode + * + * Purpose: Sets the actual selection I/O mode for the current API + * call context. + * + * Return: <none> + * + *------------------------------------------------------------------------- + */ +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 */ + 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) { + /* 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; + } + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_actual_selection_io_mode() */ /*------------------------------------------------------------------------- * Function: H5CX_get_ohdr_flags @@ -3529,7 +3614,17 @@ 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 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 aa6883b..76812ee 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -116,6 +116,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(bool *modify_write_buf); /* "Getter" routines for LCPL properties cached in API context */ @@ -162,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/H5Dio.c b/src/H5Dio.c index 2134ce1..611518d 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -143,17 +143,17 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) } /* end if */ #endif /*H5_HAVE_PARALLEL*/ - /* iterate over all dsets and construct I/O information necessary to do I/O */ + /* Iterate over all dsets and construct I/O information necessary to do I/O */ for (i = 0; i < count; i++) { haddr_t prev_tag = HADDR_UNDEF; - /* check args */ + /* Check args */ if (NULL == dset_info[i].dset) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); if (NULL == dset_info[i].dset->oloc.file) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); - /* set metadata tagging with dset oheader addr */ + /* Set metadata tagging with dset oheader addr */ H5AC_tag(dset_info[i].dset->oloc.addr, &prev_tag); /* Set up datatype info for operation */ @@ -173,10 +173,7 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) if (dset_info[i].nelmts > 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer"); - /* If the buffer is nil, and 0 element is selected, make a fake buffer. - * This is for some MPI package like ChaMPIon on NCSA's tungsten which - * doesn't support this feature. - */ + /* If the buffer is nil, and 0 element is selected, make a fake buffer. */ dset_info[i].buf.vp = &fake_char; } /* end if */ @@ -191,8 +188,8 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) * rapidly changing coordinates match up), but the I/O code still has * difficulties with the notion. * - * To solve this, we check to see if H5S_select_shape_same() returns true, - * and if the ranks of the mem and file spaces are different. If they are, + * To solve this, check if H5S_select_shape_same() returns true + * and the ranks of the mem and file spaces are different. If so, * construct a new mem space that is equivalent to the old mem space, and * use that instead. * @@ -347,7 +344,7 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) if (dset_info[i].layout_ops.mdio_init) { haddr_t prev_tag = HADDR_UNDEF; - /* set metadata tagging with dset oheader addr */ + /* Set metadata tagging with dset oheader addr */ H5AC_tag(dset_info[i].dset->oloc.addr, &prev_tag); /* Make second phase IO init call */ @@ -396,7 +393,7 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) if (dset_info[i].skip_io) continue; - /* set metadata tagging with dset oheader addr */ + /* Set metadata tagging with dset object header addr */ H5AC_tag(dset_info[i].dset->oloc.addr, &prev_tag); /* Invoke correct "high level" I/O routine */ @@ -553,18 +550,18 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) if (NULL == (store = (H5D_storage_t *)H5MM_malloc(count * sizeof(H5D_storage_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate dset storage info array buffer"); - /* iterate over all dsets and construct I/O information */ + /* Iterate over all dsets and construct I/O information */ for (i = 0; i < count; i++) { bool should_alloc_space = false; /* Whether or not to initialize dataset's storage */ haddr_t prev_tag = HADDR_UNDEF; - /* check args */ + /* Check args */ if (NULL == dset_info[i].dset) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset"); if (NULL == dset_info[i].dset->oloc.file) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file"); - /* set metadata tagging with dset oheader addr */ + /* Set metadata tagging with dset oheader addr */ H5AC_tag(dset_info[i].dset->oloc.addr, &prev_tag); /* All filters in the DCPL must have encoding enabled. */ @@ -620,10 +617,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) if (dset_info[i].nelmts > 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no input buffer"); - /* If the buffer is nil, and 0 element is selected, make a fake buffer. - * This is for some MPI package like ChaMPIon on NCSA's tungsten which - * doesn't support this feature. - */ + /* If the buffer is nil, and 0 element is selected, make a fake buffer. */ dset_info[i].buf.cvp = &fake_char; } /* end if */ @@ -633,18 +627,18 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) if (!(H5S_has_extent(dset_info[i].mem_space))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "memory dataspace does not have extent set"); - /* H5S_select_shape_same() has been modified to accept topologically - * identical selections with different rank as having the same shape - * (if the most rapidly changing coordinates match up), but the I/O - * code still has difficulties with the notion. + /* H5S_select_shape_same() has been modified to accept topologically identical + * selections with different rank as having the same shape (if the most + * rapidly changing coordinates match up), but the I/O code still has + * difficulties with the notion. * - * To solve this, we check to see if H5S_select_shape_same() returns - * true, and if the ranks of the mem and file spaces are different. - * If they are, construct a new mem space that is equivalent to the - * old mem space, and use that instead. + * To solve this, check if H5S_select_shape_same() returns true + * and the ranks of the mem and file spaces are different. If so, + * construct a new mem space that is equivalent to the old mem space, and + * use that instead. * - * Note that in general, this requires us to touch up the memory buffer - * as well. + * Note that in general, this requires us to touch up the memory buffer as + * well. */ if (dset_info[i].nelmts > 0 && true == H5S_SELECT_SHAPE_SAME(dset_info[i].mem_space, dset_info[i].file_space) && @@ -818,11 +812,11 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) "unable to allocate array of selected pieces"); } - /* loop with serial & single-dset write IO path */ + /* Loop with serial & single-dset write IO path */ for (i = 0; i < count; i++) { assert(!dset_info[i].skip_io); - /* set metadata tagging with dset oheader addr */ + /* Set metadata tagging with dset oheader addr */ H5AC_tag(dset_info->dset->oloc.addr, &prev_tag); /* Invoke correct "high level" I/O routine */ @@ -936,7 +930,7 @@ H5D__ioinfo_init(size_t count, H5D_io_op_type_t op_type, H5D_dset_io_info_t *dse FUNC_ENTER_PACKAGE_NOERR - /* check args */ + /* Check args */ assert(count > 0); assert(dset_info); assert(dset_info[0].dset->oloc.file); @@ -1057,7 +1051,7 @@ H5D__typeinfo_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, hid_t FUNC_ENTER_PACKAGE - /* check args */ + /* Check args */ assert(io_info); assert(dset_info); @@ -1151,7 +1145,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D__typeinfo_init_phase2 * - * Purpose: Continue initializing type info for all datasets after + * Purpose: Continues initializing type info for all datasets after * calculating the max type size across all datasets, and * before final determination of collective/independent in * H5D__ioinfo_adjust(). Currently just checks to see if @@ -1169,7 +1163,7 @@ H5D__typeinfo_init_phase2(H5D_io_info_t *io_info) FUNC_ENTER_PACKAGE - /* check args */ + /* Check args */ assert(io_info); /* If selection I/O mode is default (auto), enable it here if the VFD supports it (it will be turned off @@ -1238,7 +1232,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D__ioinfo_adjust * - * Purpose: Adjust operation's I/O info for any parallel I/O, also + * Purpose: Adjusts operation's I/O info for any parallel I/O, also * handle decision on selection I/O even in serial case * * Return: Non-negative on success/Negative on failure @@ -1253,10 +1247,10 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info) FUNC_ENTER_PACKAGE - /* check args */ + /* Check args */ assert(io_info); - /* check the first dset, should exist either single or multi dset cases */ + /* Check the first dset, should exist either single or multi dset cases */ assert(io_info->dsets_info[0].dset); dset0 = io_info->dsets_info[0].dset; assert(dset0->oloc.file); @@ -1317,7 +1311,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info) if (io_info->dsets_info[i].dset->shared->dcpl_cache.pline.nused > 0) break; - /* If the above loop didn't complete at least one dataset has a filter */ + /* If the above loop didn't complete, at least one dataset has a filter */ if (i < io_info->count) { int comm_size = 0; @@ -1363,9 +1357,9 @@ done: /*------------------------------------------------------------------------- * Function: H5D__typeinfo_init_phase3 * - * Purpose: Finish initializing type info for all datasets after - * calculating the max type size across all datasets. And - * after final collective/independent determination in + * Purpose: Finishes initializing type info for all datasets after + * calculating the max type size across all datasets and + * final collective/independent determination in * H5D__ioinfo_adjust(). * * Return: Non-negative on success/Negative on failure diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 118c6cd..fa8b077 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -78,15 +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 */ -#define H5D_XFER_MODIFY_WRITE_BUF_NAME "modify_write_buf" /* Modify write buffers */ + "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 */ #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/H5FDint.c b/src/H5FDint.c index 082b602..5d3a802 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -212,8 +212,9 @@ done: 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 */ - herr_t ret_value = SUCCEED; /* Return value */ + 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) @@ -257,6 +258,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() */ @@ -273,9 +281,10 @@ done: 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 */ - herr_t ret_value = SUCCEED; /* Return value */ + 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) @@ -308,6 +317,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() */ @@ -360,6 +376,7 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs size_t size = 0; H5FD_mem_t type = H5FD_MEM_DEFAULT; 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) @@ -441,6 +458,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; } } @@ -455,13 +476,27 @@ 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) { - 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); + } } else { @@ -471,6 +506,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++) { @@ -512,6 +548,13 @@ 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, 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: @@ -575,6 +618,7 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr H5FD_mem_t type = H5FD_MEM_DEFAULT; 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) @@ -646,6 +690,10 @@ 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; } } @@ -663,10 +711,17 @@ 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) { - 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); + } } else { /* otherwise, implement the vector write as a sequence of regular @@ -675,6 +730,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++) { @@ -716,6 +772,13 @@ 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 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: @@ -996,18 +1059,35 @@ H5FD__read_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_t /* 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, if this is a raw data operation */ + 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; /* 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, 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: @@ -1161,6 +1241,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])) { @@ -1186,6 +1268,13 @@ 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, 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 @@ -1337,9 +1426,18 @@ H5FD_read_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_t /* if the underlying VFD supports selection read, make the call */ if (!skip_selection_cb && 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, 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 @@ -1653,18 +1751,35 @@ H5FD__write_selection_translate(uint32_t skip_vector_cb, H5FD_t *file, H5FD_mem_ /* 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, if this is a raw data operation */ + 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; /* 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, 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: @@ -1810,6 +1925,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])) { @@ -1835,6 +1952,13 @@ 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, 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 @@ -1979,9 +2103,18 @@ H5FD_write_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_ /* if the underlying VFD supports selection write, make the call */ if (!skip_selection_cb && 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, 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 @@ -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/H5Pdxpl.c b/src/H5Pdxpl.c index b6130f5..9adb2d6 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -175,6 +175,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 0 /* Definitions for modify write buffer property */ #define H5D_XFER_MODIFY_WRITE_BUF_SIZE sizeof(bool) #define H5D_XFER_MODIFY_WRITE_BUF_DEF false @@ -295,7 +298,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 bool 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 bool H5D_def_modify_write_buf_g = H5D_XFER_MODIFY_WRITE_BUF_DEF; /*------------------------------------------------------------------------- * Function: H5P__dxfr_reg_prop @@ -470,6 +474,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) */ + 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, @@ -2457,6 +2468,39 @@ done: } /* 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 * * Purpose: Callback routine which is called whenever the modify write diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index a58d97f..64ccb77 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -420,6 +420,13 @@ typedef enum H5D_selection_io_mode_t { } H5D_selection_io_mode_t; //! <!--[H5D_selection_io_mode_t_snip] --> +/** + * 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 */ /********************/ @@ -4830,9 +4837,8 @@ H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref); * enumerated value in #H5F_libver_t, indicating that this is * currently the latest format available. * - * The library supports the following five pairs of - * (\p low, \p high) combinations as derived from the values - * in #H5F_libver_t: + * The library supports the following pairs of (\p low, \p high) + * combinations as derived from the values in #H5F_libver_t: * * <table> * <tr> @@ -4859,13 +4865,38 @@ H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref); * \li The library will create objects with the earliest possible * format versions. * \li The library will allow objects to be created with the latest - * format versions available to library release 1.10.x. - * Since 1.10.x is also #H5F_LIBVER_LATEST, there is no upper - * limit on the format versions to use. For example, if a newer - * format version is required to support a feature e.g. virtual - * dataset, this setting will allow the object to be created. - * \li This is the library default setting and provides the greatest - * format compatibility. + * format versions available to library release 1.10.x. Note + * that as 1.10.11 is the last release of the 1.10 series. + * \li API calls that create objects or features that are + * available to versions of the library greater than 1.10.x + * release will fail. + * </td> + * </tr> + * <tr> + * <td>\p low=#H5F_LIBVER_EARLIEST<br /> + * \p high=#H5F_LIBVER_V112</td> + * <td> + * \li The library will create objects with the earliest possible + * format versions. + * \li The library will allow objects to be created with the latest + * format versions available to library release 1.12.x. Note + * that as 1.12.3 is the last release of the 1.12 series. + * \li API calls that create objects or features that are + * available to versions of the library greater than 1.12.x + * release will fail. + * </td> + * </tr> + * <tr> + * <td>\p low=#H5F_LIBVER_EARLIEST<br /> + * \p high=#H5F_LIBVER_V114</td> + * <td> + * \li The library will create objects with the earliest possible + * format versions. + * \li The library will allow objects to be created with the latest + * format versions available to library release 1.14.x. + * \li API calls that create objects or features that are + * available to versions of the library greater than 1.14.x + * release will fail. * </td> * </tr> * <tr> @@ -4887,12 +4918,39 @@ H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref); * \li The library will create objects with the latest format * versions available to library release 1.8.x. * \li The library will allow objects to be created with the latest - * format versions available to library release 1.10.x. - * Since 1.10.x is also #H5F_LIBVER_LATEST, there is no upper - * limit on the format versions to use. For example, if a - * newer format version is required to support a feature e.g. - * virtual dataset, this setting will allow the object to be - * created. + * format versions available to library release 1.10.x. Note + * that 1.10.11 is the last release of the 1.10 series. + * \li API calls that create objects or features that are + * available to versions of the library greater than 1.10.x + * release will fail. + * \li Earlier versions of the library may not be able to access + * objects created with this setting.</td> + * </tr> + * <tr> + * <td>\p low=#H5F_LIBVER_V18<br /> + * \p high=#H5F_LIBVER_V112</td> + * <td> + * \li The library will create objects with the latest format + * versions available to library release 1.8.x. + * \li The library will allow objects to be created with the latest + * format versions available to library release 1.12.x. + * \li API calls that create objects or features that are + * available to versions of the library greater than 1.12.x + * release will fail. + * \li Earlier versions of the library may not be able to access + * objects created with this setting.</td> + * </tr> + * <tr> + * <td>\p low=#H5F_LIBVER_V18<br /> + * \p high=#H5F_LIBVER_V114</td> + * <td> + * \li The library will create objects with the latest format + * versions available to library release 1.8.x. + * \li The library will allow objects to be created with the latest + * format versions available to library release 1.14.x. + * \li API calls that create objects or features that are + * available to versions of the library greater than 1.14.x + * release will fail. * \li Earlier versions of the library may not be able to access * objects created with this setting.</td> * </tr> @@ -4904,22 +4962,115 @@ H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref); * \li The library will create objects with the latest format * versions available to library release 1.10.x. * \li The library will allow objects to be created with the latest - * format versions available to library release 1.10.x. - * Since 1.10.x is also #H5F_LIBVER_LATEST, there is no upper - * limit on the format versions to use. For example, if a - * newer format version is required to support a feature e.g. - * virtual dataset, this setting will allow the object to be - * created. - * \li This setting allows users to take advantage of the latest - * features and performance enhancements in the library. - * However, objects written with this setting may be + * format versions available to library release 1.10.x. Note + * that 1.10.11 is the last release of the 1.10 series. + * \li The objects written with this setting may be + * accessible to a smaller range of library versions than + * would be the case if low is set to #H5F_LIBVER_EARLIEST. + * \li API calls that create objects or features that are available + * to versions of the library greater than 1.10.x release will + * fail. + * \li Earlier versions of the library may not be able to access + * objects created with this setting.</td> + * </td> + * </tr> + * <tr> + * <td>\p low=#H5F_LIBVER_V110<br /> + * \p high=#H5F_LIBVER_V112 + * </td> + * <td> + * \li The library will create objects with the latest format + * versions available to library release 1.10.x. + * \li The library will allow objects to be created with the latest + * format versions available to library release 1.12.x. + * \li The objects written with this setting may be * accessible to a smaller range of library versions than * would be the case if low is set to #H5F_LIBVER_EARLIEST. + * \li API calls that create objects or features that are available + * to versions of the library greater than 1.12.x release will + * fail. * \li Earlier versions of the library may not be able to access - * objects created with this - * setting. + * objects created with this setting.</td> * </td> * </tr> + * <tr> + * <td>\p low=#H5F_LIBVER_V110<br /> + * \p high=#H5F_LIBVER_V114 + * </td> + * <td> + * \li The library will create objects with the latest format + * versions available to library release 1.10.x. + * \li The library will allow objects to be created with the latest + * format versions available to library release 1.14.x. + * \li The objects written with this setting may be + * accessible to a smaller range of library versions than + * would be the case if low is set to #H5F_LIBVER_EARLIEST. + * \li API calls that create objects or features that are available + * to versions of the library greater than 1.14.x release will + * fail. + * \li Earlier versions of the library may not be able to access + * objects created with this setting.</td> + * </td> + * </tr> + * <tr> + * <td>\p low=#H5F_LIBVER_V112<br /> + * \p high=#H5F_LIBVER_V112 + * </td> + * <td> + * \li The library will create objects with the latest format + * versions available to library release 1.12.x. + * \li The library will allow objects to be created with the latest + * format versions available to library release 1.12.x. + * \li The objects written with this setting may be + * accessible to a smaller range of library versions than + * would be the case if low is set to #H5F_LIBVER_EARLIEST. + * \li API calls that create objects or features that are available + * to versions of the library greater than 1.12.x release will + * fail. + * \li Earlier versions of the library may not be able to access + * objects created with this setting.</td> + * </td> + * </tr> + * <tr> + * <td>\p low=#H5F_LIBVER_V112<br /> + * \p high=#H5F_LIBVER_V114 + * </td> + * <td> + * \li The library will create objects with the latest format + * versions available to library release 1.12.x. + * \li The library will allow objects to be created with the latest + * format versions available to library release 1.14.x. + * \li The objects written with this setting may be + * accessible to a smaller range of library versions than + * would be the case if low is set to #H5F_LIBVER_EARLIEST. + * \li API calls that create objects or features that are available + * to versions of the library greater than 1.14.x release will + * fail. + * \li Earlier versions of the library may not be able to access + * objects created with this setting.</td> + * </td> + * </tr> + * </tr> + * <tr> + * <td>\p low=#H5F_LIBVER_V114<br /> + * \p high=#H5F_LIBVER_V114 + * </td> + * <td> + * \li The library will create objects with the latest format + * versions available to library release 1.14.x. + * \li The library will allow objects to be created with the latest + * format versions available to library release 1.14.x. + * \li The objects written with this setting may be + * accessible to a smaller range of library versions than + * would be the case if low is set to #H5F_LIBVER_EARLIEST. + * \li API calls that create objects or features that are available + * to versions of the library greater than 1.14.x release will + * fail. + * \li Earlier versions of the library may not be able to access + * objects created with this setting.</td> + * </td> + * </tr> + * </tr> * </table> * * \version 1.10.2 #H5F_LIBVER_V18 added to the enumerated defines in @@ -5811,7 +5962,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 * @@ -8300,6 +8451,61 @@ 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(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 + * type(s) 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. + * 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(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. + * + * Valid bitflags 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 + * + * 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 + * 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.3 + * + */ +H5_DLL herr_t H5Pget_actual_selection_io_mode(hid_t plist_id, uint32_t *actual_selection_io_mode); + +/** * * \ingroup DXPL * |