Determine if native connector is terminal (#2397)

* Correct concurrency bugs when running tests, along with a bugfix & small
warning cleanup.

* Committing clang-format changes

* Allow spaces (and tabs) in VOL connector info string from environment variable.

* Parse connector name from HDF5_PLUGIN_PATH environment variable better

* Correct H5VLquery_optional to use H5VL routine instead of H5I.  Also add an
error message to the failure return value from not finding a plugin.

* Play nice with existing plugin paths

* Use API routine to determine if native connector is terminal.

* Committing clang-format changes

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: AWS ParallelCluster user <ec2-user@ip-10-0-0-65.us-east-2.compute.internal>
Co-authored-by: Koziol <qkoziol@88665a374c70.ant.amazon.com>
This commit is contained in:
Quincey Koziol
2023-01-09 15:49:29 -06:00
committed by GitHub
parent 54590f3ebd
commit 90d20764f4
2 changed files with 12 additions and 8 deletions

View File

@@ -817,10 +817,11 @@ done:
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
herr_t herr_t
h5tools_get_vfd_name(hid_t fapl_id, char *drivername, size_t drivername_size) h5tools_get_vfd_name(hid_t fid, hid_t fapl_id, char *drivername, size_t drivername_size)
{ {
hid_t fapl_vol_id = H5I_INVALID_HID; hid_t fapl_vol_id = H5I_INVALID_HID;
herr_t ret_value = SUCCEED; hbool_t is_native = FALSE;
herr_t ret_value = SUCCEED;
if (fapl_id < 0) if (fapl_id < 0)
H5TOOLS_GOTO_ERROR(FAIL, "invalid FAPL"); H5TOOLS_GOTO_ERROR(FAIL, "invalid FAPL");
@@ -839,9 +840,11 @@ h5tools_get_vfd_name(hid_t fapl_id, char *drivername, size_t drivername_size)
if (H5Pget_vol_id(fapl_id, &fapl_vol_id) < 0) if (H5Pget_vol_id(fapl_id, &fapl_vol_id) < 0)
H5TOOLS_ERROR(FAIL, "failed to retrieve VOL ID from FAPL"); H5TOOLS_ERROR(FAIL, "failed to retrieve VOL ID from FAPL");
/* TODO: For now, we have no way of determining if an arbitrary /* Query if the file ID is native-terminal */
* VOL connector is native-terminal. */ if (H5VLobject_is_native(fid, &is_native) < 0)
if (fapl_vol_id == H5VL_NATIVE || fapl_vol_id == H5VL_PASSTHRU) { H5TOOLS_ERROR(FAIL, "failed to determine if file ID is native-terminal");
if (is_native) {
const char *driver_name; const char *driver_name;
hid_t driver_id; hid_t driver_id;
@@ -1072,7 +1075,8 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec
done: done:
/* Save the driver name if using a native-terminal VOL connector */ /* Save the driver name if using a native-terminal VOL connector */
if (drivername && drivername_size && ret_value >= 0) if (drivername && drivername_size && ret_value >= 0)
if (used_fapl_id >= 0 && h5tools_get_vfd_name(used_fapl_id, drivername, drivername_size) < 0) if (used_fapl_id >= 0 &&
h5tools_get_vfd_name(ret_value, used_fapl_id, drivername, drivername_size) < 0)
H5TOOLS_ERROR(H5I_INVALID_HID, "failed to retrieve name of VFD used to open file"); H5TOOLS_ERROR(H5I_INVALID_HID, "failed to retrieve name of VFD used to open file");
if (tmp_fapl_id >= 0) if (tmp_fapl_id >= 0)

View File

@@ -667,7 +667,7 @@ H5TOOLS_DLL int h5tools_set_error_file(const char *fname, int is_bin);
H5TOOLS_DLL hid_t h5tools_get_fapl(hid_t prev_fapl_id, h5tools_vol_info_t *vol_info, H5TOOLS_DLL hid_t h5tools_get_fapl(hid_t prev_fapl_id, h5tools_vol_info_t *vol_info,
h5tools_vfd_info_t *vfd_info); h5tools_vfd_info_t *vfd_info);
H5TOOLS_DLL herr_t h5tools_get_vfd_name(hid_t fapl_id, char *drivername, size_t drivername_size); H5TOOLS_DLL herr_t h5tools_get_vfd_name(hid_t fid, hid_t fapl_id, char *drivername, size_t drivername_size);
H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specific_driver, H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specific_driver,
char *drivername, size_t drivername_size); char *drivername, size_t drivername_size);
H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type); H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type);