summaryrefslogtreecommitdiffstats
path: root/src/H5CX.c
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-10-21 01:08:49 (GMT)
committerGitHub <noreply@github.com>2023-10-21 01:08:49 (GMT)
commitb16808d35160fb0d22999447dbf53838d7918a7a (patch)
treeeaf7a8cb712da1f2b200f6b2f0a44ed538d50409 /src/H5CX.c
parent302f54a566533615545f76af8f34f2665341539b (diff)
downloadhdf5-b16808d35160fb0d22999447dbf53838d7918a7a.zip
hdf5-b16808d35160fb0d22999447dbf53838d7918a7a.tar.gz
hdf5-b16808d35160fb0d22999447dbf53838d7918a7a.tar.bz2
Sync with develop (#3737)
* Correct ld in format strings in cmpd_dset.c (#3697) Removes clang warnings * Clean up comments. (#3695) * Add NVidia compiler support and CI (#3686) * Work around Theta system issue failure in links test (#3710) When the Subfiling VFD is enabled, the links test may try to initialize the Subfiling VFD and call MPI_Init_thread. On Theta, this appears to have an issue that will cause the links test to fail. Reworked the test to check for the same conditions in a more roundabout way that doesn't involved initializing the Subfiling VFD * Fix issue with unmatched messages in ph5diff (#3719) * provide an alternative to mapfile for older bash (#3717) * Attempt to quiet some warnings with cray compilers. (#3724) * Fix CMake VOL passthrough tests by copying files to correct directory (#3721) * Develop intel split (#3722) * Split intel compiler flags into sub-folders * Update Intel options for warnings * Mostly CMake, Autotools needs additional work * Fixes and adjustments to t_filters_parallel (#3714) Broadcast number of datasets to create in multi-dataset I/O cases so that interference with random number generation doesn't cause mismatches between ranks Set fill time for datasets to "never" by default and adjust on a per-test basis to avoid writing fill values to chunks when it's unnecessary Reduce number of loops run in some tests when performing multi-dataset I/O Fix an issue in the "fill time never" test where data verification could fill if file space reuse causes application buffers to be filled with chosen fill value when reading from datasets with uninitialized storage Skip multi-chunk I/O test configurations for multi-dataset I/O configurations when the TestExpress level is > 1 since those tests can be more stressful on the file system Disable use of persistent file free space management for now since it occasionally runs into an infinite loop in the library's free space management code * Suppress cast-qual warning in H5TB Fortran wrapper (#3728) This interface is fundamentally broken, const-wise. * Add new API function H5Pget_actual_select_io_mode() (#2974) 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. Expanded existing tests to check this functionality. * Test scripts now execute in-source with creation of tmp dir (#3723) Fixes a few issues created in #3580: * Fixes a problem where committed tools test files were deleted when cleaning after an in-source build * Fixes issues with test file paths in Autotools tools test scripts * Add -h and --help as flags in h5cc & h5fc (#3729) Adds these common help flags in addition to -help * Update the library version matrix for H5Pset_libver_bounds() (#3702) * Fixed #3524 Added 1.12, 1.14, and 1.16 to the table for libver bounds in the H5Pset_libver_bounds docs. * Remove references to LIBVER_V116 --------- Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org> Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Neil Fortner <fortnern@gmail.com> Co-authored-by: Glenn Song <43005495+glennsong09@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com>
Diffstat (limited to 'src/H5CX.c')
-rw-r--r--src/H5CX.c101
1 files changed, 98 insertions, 3 deletions
diff --git a/src/H5CX.c b/src/H5CX.c
index b3b2fca..c46c58a 100644
--- a/src/H5CX.c
+++ b/src/H5CX.c
@@ -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)