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:
@@ -817,9 +817,10 @@ done:
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
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;
|
||||
hbool_t is_native = FALSE;
|
||||
herr_t ret_value = SUCCEED;
|
||||
|
||||
if (fapl_id < 0)
|
||||
@@ -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)
|
||||
H5TOOLS_ERROR(FAIL, "failed to retrieve VOL ID from FAPL");
|
||||
|
||||
/* TODO: For now, we have no way of determining if an arbitrary
|
||||
* VOL connector is native-terminal. */
|
||||
if (fapl_vol_id == H5VL_NATIVE || fapl_vol_id == H5VL_PASSTHRU) {
|
||||
/* Query if the file ID is native-terminal */
|
||||
if (H5VLobject_is_native(fid, &is_native) < 0)
|
||||
H5TOOLS_ERROR(FAIL, "failed to determine if file ID is native-terminal");
|
||||
|
||||
if (is_native) {
|
||||
const char *driver_name;
|
||||
hid_t driver_id;
|
||||
|
||||
@@ -1072,7 +1075,8 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec
|
||||
done:
|
||||
/* Save the driver name if using a native-terminal VOL connector */
|
||||
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");
|
||||
|
||||
if (tmp_fapl_id >= 0)
|
||||
|
||||
@@ -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_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,
|
||||
char *drivername, size_t drivername_size);
|
||||
H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type);
|
||||
|
||||
Reference in New Issue
Block a user