-
-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VOL refactor and cleanup #4856
VOL refactor and cleanup #4856
Changes from all commits
413c620
efe6746
6cfc479
5c4641f
360a585
4686d86
214fd85
97a5861
fe4a620
c3b9656
e3e48f0
a53ee18
63bb68b
4e2bbbb
cfb1d87
1ba58be
aeeec14
c49d15c
4033e6c
10839a4
7be1641
1be1917
516e020
439024d
07355ec
6406498
8e0058c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,6 +160,7 @@ SUBROUTINE test_registration_by_fapl(total_error) | |
INTEGER(hid_t) :: file_id | ||
INTEGER(hid_t) :: fapl_id | ||
TYPE(C_PTR) :: f_ptr | ||
LOGICAL :: are_same = .FALSE. | ||
|
||
CALL H5VLis_connector_registered_by_name_f( "FAKE_VOL_CONNECTOR_NAME", is_registered, error) | ||
|
||
|
@@ -189,22 +190,30 @@ SUBROUTINE test_registration_by_fapl(total_error) | |
|
||
CALL H5Pget_vol_id_f(fapl_id, vol_id_out, error) | ||
CALL check("H5Pget_vol_id_f",error,total_error) | ||
CALL VERIFY("H5Pget_vol_id_f", vol_id_out, vol_id, total_error) | ||
CALL H5VLcmp_connector_cls_f(are_same, vol_id, vol_id_out, error) | ||
CALL check("H5VLcmp_connector_cls_f",error,total_error) | ||
CALL VERIFY("H5VLcmp_connector_cls_f", are_same, .TRUE., total_error) | ||
|
||
f_ptr = C_NULL_PTR | ||
CALL H5Pset_vol_f(fapl_id, vol_id, error, f_ptr) | ||
CALL check("H5Pset_vol_f",error,total_error) | ||
|
||
CALL H5Pget_vol_id_f(fapl_id, vol_id_out, error) | ||
CALL check("H5Pget_vol_id_f",error,total_error) | ||
CALL VERIFY("H5Pget_vol_id_f", vol_id_out, vol_id, total_error) | ||
are_same = .FALSE. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use new routine instead of directly comparing IDs. |
||
CALL H5VLcmp_connector_cls_f(are_same, vol_id, vol_id_out, error) | ||
CALL check("H5VLcmp_connector_cls_f",error,total_error) | ||
CALL VERIFY("H5VLcmp_connector_cls_f", are_same, .TRUE., total_error) | ||
ENDIF | ||
|
||
CALL H5VLget_connector_id_by_name_f(NATIVE_VOL_CONNECTOR_NAME, vol_id_out, error) | ||
CALL check("H5VLget_connector_id_by_name_f",error,total_error) | ||
CALL VERIFY("H5VLget_connector_id_by_name_f", vol_id_out, vol_id, total_error) | ||
CALL H5Fcreate_f("voltest.h5",H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl_id) | ||
are_same = .FALSE. | ||
CALL H5VLcmp_connector_cls_f(are_same, vol_id, vol_id_out, error) | ||
CALL check("H5VLcmp_connector_cls_f",error,total_error) | ||
CALL VERIFY("H5VLcmp_connector_cls_f", are_same, .TRUE., total_error) | ||
|
||
CALL H5Fcreate_f("voltest.h5",H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl_id) | ||
CALL check("H5F_create_f",error,total_error) | ||
|
||
CALL H5VLclose_f(vol_id_out, error) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15497,6 +15497,24 @@ public synchronized static native String H5VLget_connector_name(long object_id) | |
public synchronized static native void H5VLunregister_connector(long connector_id) | ||
throws HDF5LibraryException; | ||
|
||
/** | ||
* @ingroup JH5VL | ||
* | ||
* H5VLcmp_connector_cls Determines whether two connector identifiers refer to the same connector. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This routine is necessary because it's possible to have VOL connector IDs that are different, but point to the same underlying VOL connector class. |
||
* | ||
* @param conn_id1 | ||
* IN: Identifier of connector to compare. | ||
* @param conn_id2 | ||
* IN: Identifier of connector to compare. | ||
* | ||
* @return true if the connector identifiers refer to the same connector, else false. | ||
* | ||
* @exception HDF5LibraryException | ||
* Error from the HDF5 Library. | ||
**/ | ||
public synchronized static native boolean H5VLcmp_connector_cls(long conn_id1, long conn_id2) | ||
throws HDF5LibraryException; | ||
|
||
// /////// unimplemented //////// | ||
// hid_t H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,8 @@ public void testH5VLget_connector_id() | |
*/ | ||
String connector = System.getenv("HDF5_VOL_CONNECTOR"); | ||
if (connector == null) | ||
assertEquals(HDF5Constants.H5VL_NATIVE, native_id); | ||
assertTrue("H5.H5VLcmp_connector_cls(H5VL_NATIVE_NAME, native_id)", | ||
H5.H5VLcmp_connector_cls(HDF5Constants.H5VL_NATIVE, native_id)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use new routine instead of directly comparing IDs. |
||
} | ||
catch (Throwable err) { | ||
err.printStackTrace(); | ||
|
@@ -122,7 +123,8 @@ public void testH5VLget_connector_id_by_name() | |
try { | ||
long native_id = H5.H5VLget_connector_id_by_name(HDF5Constants.H5VL_NATIVE_NAME); | ||
assertTrue("H5.H5VLget_connector_id_by_name H5VL_NATIVE_NAME", native_id >= 0); | ||
assertEquals(HDF5Constants.H5VL_NATIVE, native_id); | ||
assertTrue("H5.H5VLcmp_connector_cls(H5VL_NATIVE_NAME, native_id)", | ||
H5.H5VLcmp_connector_cls(HDF5Constants.H5VL_NATIVE, native_id)); | ||
} | ||
catch (Throwable err) { | ||
err.printStackTrace(); | ||
|
@@ -136,7 +138,8 @@ public void testH5VLget_connector_id_by_value() | |
try { | ||
long native_id = H5.H5VLget_connector_id_by_value(HDF5Constants.H5VL_NATIVE_VALUE); | ||
assertTrue("H5.H5VLget_connector_id_by_value H5VL_NATIVE_VALUE", native_id >= 0); | ||
assertEquals(HDF5Constants.H5VL_NATIVE, native_id); | ||
assertTrue("H5.H5VLcmp_connector_cls(H5VL_NATIVE_NAME, native_id)", | ||
H5.H5VLcmp_connector_cls(HDF5Constants.H5VL_NATIVE, native_id)); | ||
} | ||
catch (Throwable err) { | ||
err.printStackTrace(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This routine is necessary because it's possible to have VOL connector IDs that are different, but point to the same underlying VOL connector class.