summaryrefslogtreecommitdiffstats
path: root/src/H5Odeprec.c
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-10-25 00:36:18 (GMT)
committerGitHub <noreply@github.com>2023-10-25 00:36:18 (GMT)
commita91be87f072a8020d9a467f1ef81132cb5c40149 (patch)
treee5a3ef49a818d07f5649f9aeaa718047efaef658 /src/H5Odeprec.c
parent097fd51481a7d5eaf8f94436cf21e08ac516d6ba (diff)
downloadhdf5-a91be87f072a8020d9a467f1ef81132cb5c40149.zip
hdf5-a91be87f072a8020d9a467f1ef81132cb5c40149.tar.gz
hdf5-a91be87f072a8020d9a467f1ef81132cb5c40149.tar.bz2
Sync with develop (#3764)
* Add missing test files to distclean target (#3734) Cleans up new files in Autotools `make distclean` in the test directory * Add tools/libtest to Autotools builds (#3735) This was only added to CMake many years ago and tests the tools library. * Clean up onion VFD files in tools `make clean` (#3739) Cleans up h5dump and h5diff *.onion files in the Autotools when runing `make clean`. * Clean Java test files on Autotools (#3740) Removes generated HDF5 and text output files when running `make clean`. * Clean the flushrefresh test dir on Autotools (#3741) The flushrefresh_test directory was not being cleaned up w/ `make clean` under the Autotools * Fix file names in tfile.c (#3743) Some tests in tfile.c use h5_fileaccess to get a VFD-dependent file name but use the scheme from testhdf5, reusing the FILE1 and FILE8 names. This leads to files like test1.h5.h5 which are unintended and not cleaned up. This changes the filename scheme for a few tests to work with h5test, resulting in more informative names and allowing the files to be cleaned up at the end of the test. The test files have also been added to the `make clean` target for the Autotools. * Clean Autotools files in parallel tests (#3744) Adds missing files to `make clean` for parallel, including Fortran. * Add native VOL checks to deprecated functions (#3647) * Add native VOL checks to deprecated functions * Remove unneeded native VOL checks * Move native checks to top level calls * Fix buffer overflow in cache debugging code (#3691) * update stat arg for apple (#3726) * update stat arg for apple * use H5_HAVE_DARWIN for Apple ifdef * fix typo * removed duplicate H5_ih_info_t * added fortran async test to cmake * Fix windows cpack error in WiX package. (#3747) * Add a simple cache to the ros3 VFD (#3753) Adds a small cache of the first N bytes of a file opened with the read-only S3 (ros3) VFD, where N is 4kiB or the size of the file, whichever is smaller. This avoids a lot of small I/O operations on file open. Addresses GitHub issue #3381 * Update Autotools to correctly configure oneAPI (#3751) * Update Autotools to correctly configure oneAPI Splits the Intel config files under the Autotools into 'classic' Intel and oneAPI versions, fixing 'unsupported option' messages. Also turns off `-check uninit` (new in 2023) in Fortran, which kills the H5_buildiface program due to false positives. * Enable Fortran in oneAPI CI workflow * Turn on Fortran in CMake, update LD_LIBRARY_PATH * Go back to disabling Fortran w/ Intel For some reason there's a linking problem w/ Fortran error while loading shared libraries: libifport.so.5: cannot open shared object file: No such file or directory * Add h5pget_actual_selection_io_mode fortran wrapper (#3746) * added h5pget_actual_selection_io_mode_f test * added tests for h5pget_actual_selection_io_mode_f * fixed int_f type conversion * Update fortran action step (#3748) * Added missing DLL for H5PGET_ACTUAL_SELECTION_IO_MODE_F (#3760) * add missing H5PGET_ACTUAL_SELECTION_IO_MODE_F dll * Bump the ros3 VFD cache to 16 MiB (#3759) * Fix hangs during collective I/O with independent metadata writes (#3693) * Fix some issues with collective metadata reads for chunked datasets (#3716) Add functions/callbacks for explicit control over chunk index open/close Add functions/callbacks to check if chunk index is open or not so that it can be opened if necessary before temporarily disabling collective metadata reads in the library Add functions/callbacks for requesting loading of additional chunk index metadata beyond the chunk index itself * Fix failure in t_select_io_dset when run with more than 10 ranks (#3758) * Fix H5Pset_evict_on_close failing regardless of actual parallel use (#3761) Allow H5Pset_evict_on_close to be called regardless of whether a parallel build of HDF5 is being used Fail during file opens if H5Pset_evict_on_close has been set to true on the given File Access Property List and the size of the MPI communicator being used is greater than 1
Diffstat (limited to 'src/H5Odeprec.c')
-rw-r--r--src/H5Odeprec.c75
1 files changed, 63 insertions, 12 deletions
diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c
index 6e8b34e..3de5818 100644
--- a/src/H5Odeprec.c
+++ b/src/H5Odeprec.c
@@ -116,9 +116,10 @@ static herr_t
H5O__iterate1_adapter(hid_t obj_id, const char *name, const H5O_info2_t *oinfo2, void *op_data)
{
H5O_visit1_adapter_t *shim_data = (H5O_visit1_adapter_t *)op_data;
- H5O_info1_t oinfo; /* Deprecated object info struct */
- unsigned dm_fields; /* Fields for data model query */
- unsigned nat_fields; /* Fields for native query */
+ H5O_info1_t oinfo; /* Deprecated object info struct */
+ unsigned dm_fields; /* Fields for data model query */
+ unsigned nat_fields; /* Fields for native query */
+ H5VL_object_t *vol_obj;
herr_t ret_value = H5_ITER_CONT; /* Return value */
FUNC_ENTER_PACKAGE
@@ -158,7 +159,6 @@ H5O__iterate1_adapter(hid_t obj_id, const char *name, const H5O_info2_t *oinfo2,
/* Check for retrieving native information */
nat_fields = shim_data->fields & (H5O_INFO_HDR | H5O_INFO_META_SIZE);
if (nat_fields) {
- H5VL_object_t *vol_obj; /* Object of obj_id */
H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
H5VL_native_object_optional_args_t obj_opt_args; /* Arguments for optional operation */
H5VL_loc_params_t loc_params; /* Location parameters for VOL callback */
@@ -401,7 +401,8 @@ H5Oget_info1(hid_t loc_id, H5O_info1_t *oinfo /*out*/)
{
H5VL_object_t *vol_obj = NULL; /* Object of loc_id */
H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ bool is_native_vol_obj = false;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", loc_id, oinfo);
@@ -418,6 +419,15 @@ H5Oget_info1(hid_t loc_id, H5O_info1_t *oinfo /*out*/)
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");
+ /* Check if using native VOL connector */
+ if (H5VL_object_is_native(vol_obj, &is_native_vol_obj) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine if VOL object is native connector object");
+
+ /* Must use native VOL connector for this operation */
+ if (!is_native_vol_obj)
+ HGOTO_ERROR(H5E_OHDR, H5E_VOL, FAIL,
+ "Deprecated H5Oget_info1 is only meant to be used with the native VOL connector");
+
/* Retrieve the object's information */
if (H5O__get_info_old(vol_obj, &loc_params, oinfo, H5O_INFO_ALL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get deprecated info for object");
@@ -441,7 +451,8 @@ H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info1_t *oinfo /*out*/,
{
H5VL_object_t *vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ bool is_native_vol_obj = false;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*sxi", loc_id, name, oinfo, lapl_id);
@@ -468,6 +479,15 @@ H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info1_t *oinfo /*out*/,
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");
+ /* Check if using native VOL connector */
+ if (H5VL_object_is_native(vol_obj, &is_native_vol_obj) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine if VOL object is native connector object");
+
+ /* Must use native VOL connector for this operation */
+ if (!is_native_vol_obj)
+ HGOTO_ERROR(H5E_OHDR, H5E_VOL, FAIL,
+ "Deprecated H5Oget_info_by_name1 is only meant to be used with the native VOL connector");
+
/* Retrieve the object's information */
if (H5O__get_info_old(vol_obj, &loc_params, oinfo, H5O_INFO_ALL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get deprecated info for object");
@@ -493,7 +513,8 @@ H5Oget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
{
H5VL_object_t *vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
- herr_t ret_value = SUCCEED; /* Return value */
+ bool is_native_vol_obj = false;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, oinfo, lapl_id);
@@ -524,6 +545,15 @@ H5Oget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");
+ /* Check if using native VOL connector */
+ if (H5VL_object_is_native(vol_obj, &is_native_vol_obj) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine if VOL object is native connector object");
+
+ /* Must use native VOL connector for this operation */
+ if (!is_native_vol_obj)
+ HGOTO_ERROR(H5E_OHDR, H5E_VOL, FAIL,
+ "Deprecated H5Oget_info_by_idx1 is only meant to be used with the native VOL connector");
+
/* Retrieve the object's information */
if (H5O__get_info_old(vol_obj, &loc_params, oinfo, H5O_INFO_ALL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get deprecated info for object");
@@ -574,7 +604,7 @@ H5Oget_info2(hid_t loc_id, H5O_info1_t *oinfo /*out*/, unsigned fields)
"can't determine if VOL object is native connector object");
if (!is_native_vol_obj)
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, H5I_INVALID_HID,
- "H5Oget_info2 is only meant to be used with the native VOL connector");
+ "Deprecated H5Oget_info2 is only meant to be used with the native VOL connector");
/* Retrieve deprecated info struct */
if (H5O__get_info_old(vol_obj, &loc_params, oinfo, fields) < 0)
@@ -637,7 +667,7 @@ H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info1_t *oinfo /*out*/,
"can't determine if VOL object is native connector object");
if (!is_native_vol_obj)
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, H5I_INVALID_HID,
- "H5Oget_info_by_name2 is only meant to be used with the native VOL connector");
+ "Deprecated H5Oget_info_by_name2 is only meant to be used with the native VOL connector");
/* Retrieve deprecated info struct */
if (H5O__get_info_old(vol_obj, &loc_params, oinfo, fields) < 0)
@@ -706,7 +736,7 @@ H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
"can't determine if VOL object is native connector object");
if (!is_native_vol_obj)
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, H5I_INVALID_HID,
- "H5Oget_info_by_idx2 is only meant to be used with the native VOL connector");
+ "Deprecated H5Oget_info_by_idx2 is only meant to be used with the native VOL connector");
/* Retrieve deprecated info struct */
if (H5O__get_info_old(vol_obj, &loc_params, oinfo, fields) < 0)
@@ -753,6 +783,7 @@ H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1
H5VL_loc_params_t loc_params; /* Location parameters for object access */
H5O_visit1_adapter_t shim_data; /* Adapter for passing app callback & user data */
herr_t ret_value; /* Return value */
+ bool is_native_vol_obj = false;
FUNC_ENTER_API(FAIL)
H5TRACE5("e", "iIiIoOi*x", obj_id, idx_type, order, op, op_data);
@@ -769,6 +800,15 @@ H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1
if (NULL == (vol_obj = H5VL_vol_object(obj_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");
+ /* Check if using native VOL connector */
+ if (H5VL_object_is_native(vol_obj, &is_native_vol_obj) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine if VOL object is native connector object");
+
+ /* Must use native VOL connector for this operation */
+ if (!is_native_vol_obj)
+ HGOTO_ERROR(H5E_OHDR, H5E_VOL, FAIL,
+ "Deprecated H5Ovisit1 is only meant to be used with the native VOL connector");
+
/* Set location parameters */
loc_params.type = H5VL_OBJECT_BY_SELF;
loc_params.obj_type = H5I_get_type(obj_id);
@@ -833,6 +873,7 @@ H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it
H5VL_loc_params_t loc_params; /* Location parameters for object access */
H5O_visit1_adapter_t shim_data; /* Adapter for passing app callback & user data */
herr_t ret_value; /* Return value */
+ bool is_native_vol_obj = false;
FUNC_ENTER_API(FAIL)
H5TRACE7("e", "i*sIiIoOi*xi", loc_id, obj_name, idx_type, order, op, op_data, lapl_id);
@@ -857,6 +898,15 @@ H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");
+ /* Check if using native VOL connector */
+ if (H5VL_object_is_native(vol_obj, &is_native_vol_obj) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine if VOL object is native connector object");
+
+ /* Must use native VOL connector for this operation */
+ if (!is_native_vol_obj)
+ HGOTO_ERROR(H5E_OHDR, H5E_VOL, FAIL,
+ "Deprecated H5Ovisit_by_name1 is only meant to be used with the native VOL connector");
+
/* Set location parameters */
loc_params.type = H5VL_OBJECT_BY_NAME;
loc_params.loc_data.loc_by_name.name = obj_name;
@@ -949,9 +999,10 @@ H5Ovisit2(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1
if (H5VL_object_is_native(vol_obj, &is_native_vol_obj) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5I_INVALID_HID,
"can't determine if VOL object is native connector object");
+
if (!is_native_vol_obj)
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, H5I_INVALID_HID,
- "H5Ovisit2 is only meant to be used with the native VOL connector");
+ "Deprecated H5Ovisit2 is only meant to be used with the native VOL connector");
/* Set location parameters */
loc_params.type = H5VL_OBJECT_BY_SELF;
@@ -1053,7 +1104,7 @@ H5Ovisit_by_name2(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it
"can't determine if VOL object is native connector object");
if (!is_native_vol_obj)
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, H5I_INVALID_HID,
- "H5Ovisit_by_name2 is only meant to be used with the native VOL connector");
+ "Deprecated H5Ovisit_by_name2 is only meant to be used with the native VOL connector");
/* Set location parameters */
loc_params.type = H5VL_OBJECT_BY_NAME;