diff options
Diffstat (limited to 'fortran/test')
-rw-r--r-- | fortran/test/t.c | 23 | ||||
-rw-r--r-- | fortran/test/t.h | 2 | ||||
-rw-r--r-- | fortran/test/tH5P_F03.F90 | 25 | ||||
-rw-r--r-- | fortran/test/tf.F90 | 58 |
4 files changed, 100 insertions, 8 deletions
diff --git a/fortran/test/t.c b/fortran/test/t.c index 6c856fa..8917940 100644 --- a/fortran/test/t.c +++ b/fortran/test/t.c @@ -25,6 +25,7 @@ #include "t.h" #include "H5Eprivate.h" +#include "H5VLprivate.h" /*---------------------------------------------------------------------------- * Name: h5_fixname_c @@ -155,3 +156,25 @@ nh5_env_nocleanup_c(int_f *status) if (HDgetenv(HDF5_NOCLEANUP)) *status = (int_f)1; } /* h5_env_nocleanup_c */ + +/*---------------------------------------------------------------------------- + * Name: h5vl_fapl_is_native_c + * Purpose: Invokes the H5VL_fapl_is_native() operation + * Inputs: fapl - file access property list + * flag - flag indicating whether VOL connector stack in FAPL is the native connector + * Returns: 0 on success, -1 on failure + * Programmer: Quincey Koziol + * June 24, 2021 + *---------------------------------------------------------------------------*/ +int_f +h5vl_fapl_is_native_c(hid_t_f *fapl_id, int_f *flag) +{ + int ret_value = 0; + hbool_t is_native = FALSE; + + ret_value = H5VL_fapl_is_native((hid_t)*fapl_id, &is_native); + if (ret_value >= 0) + *flag = (int_f)is_native; + + return ret_value; +} /* h5vl_fapl_is_native_c */ diff --git a/fortran/test/t.h b/fortran/test/t.h index 2066552..a09d0c0 100644 --- a/fortran/test/t.h +++ b/fortran/test/t.h @@ -34,3 +34,5 @@ H5_FCTESTDLL int_f nh5_cleanup_c(_fcd base_name, size_t_f *base_namelen, hid_t_f H5_FCTESTDLL H5_ATTR_NORETURN void nh5_exit_c(int_f *status); H5_FCTESTDLL void nh5_env_nocleanup_c(int_f *status); + +H5_FCDLL int_f h5vl_fapl_is_native_c(hid_t_f *fapl_id, int_f *flag); diff --git a/fortran/test/tH5P_F03.F90 b/fortran/test/tH5P_F03.F90 index 245a588..ea0b678 100644 --- a/fortran/test/tH5P_F03.F90 +++ b/fortran/test/tH5P_F03.F90 @@ -736,6 +736,7 @@ SUBROUTINE test_vds(total_error) INTEGER(SIZE_T) :: nsize LOGICAL :: IsRegular INTEGER(HSIZE_T) :: gap_size + LOGICAL :: IsNative ! For testing against vdsdims_out_correct(1,1) = DIM0_1*5 @@ -904,6 +905,9 @@ SUBROUTINE test_vds(total_error) CALL H5Pcreate_f(H5P_DATASET_ACCESS_F, dapl, error) CALL check("H5Pcreate_f", error, total_error) + ! + ! Check for native VOL connector + CALL H5VL_fapl_is_native_f(H5P_DEFAULT_F, IsNative, error) DO i = 1, 2 IF(i.NE.1)THEN @@ -924,10 +928,24 @@ SUBROUTINE test_vds(total_error) CALL check("H5Sget_simple_extent_dims_f", error, total_error) ! check VDS dimensions + ! + ! NOTE: + ! When not using the native VOL connector, the VDS will have a 0 for the + ! initial dimension. If the library is updated to support virtual datasets + ! with other VOL connector stacks (either passthroughs or other terminal + ! connectors), this code can be returned to just checking that the + ! dimensions are correct. QAK, 2021/06/24 DO j = 1, RANK - IF(vdsdims_out(j).NE.vdsdims_out_correct(i,j))THEN - total_error = total_error + 1 - EXIT + IF(IsNative.OR.j.GT.1)THEN + IF(vdsdims_out(j).NE.vdsdims_out_correct(i,j))THEN + total_error = total_error + 1 + EXIT + ENDIF + ELSE + IF(vdsdims_out(j).NE.0)THEN + total_error = total_error + 1 + EXIT + ENDIF ENDIF ENDDO @@ -942,7 +960,6 @@ SUBROUTINE test_vds(total_error) IF(virtual_view .NE. H5D_VDS_LAST_AVAILABLE_F)THEN total_error = total_error + 1 ENDIF - ENDIF ! Close diff --git a/fortran/test/tf.F90 b/fortran/test/tf.F90 index b2cb746..4d13fb9 100644 --- a/fortran/test/tf.F90 +++ b/fortran/test/tf.F90 @@ -135,7 +135,7 @@ CONTAINS !DEC$if defined(BUILD_HDF5_TEST_DLL) !DEC$attributes dllexport :: h5_fixname_f !DEC$endif - USE H5GLOBAL + USE H5GLOBAL, ONLY : HID_T, SIZE_T IMPLICIT NONE CHARACTER(LEN=*), INTENT(IN) :: base_name ! base name CHARACTER(LEN=*), INTENT(IN) :: full_name ! full name @@ -149,7 +149,7 @@ CONTAINS INTERFACE INTEGER FUNCTION h5_fixname_c(base_name, base_namelen, fapl, & full_name, full_namelen) - USE H5GLOBAL + USE H5GLOBAL, ONLY : HID_T, SIZE_T !DEC$ IF DEFINED(HDF5F90_WINDOWS) !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_FIXNAME_C':: h5_fixname_c !DEC$ ENDIF @@ -195,7 +195,7 @@ CONTAINS !DEC$if defined(BUILD_HDF5_TEST_DLL) !DEC$attributes dllexport :: h5_cleanup_f !DEC$endif - USE H5GLOBAL + USE H5GLOBAL, ONLY : HID_T, SIZE_T IMPLICIT NONE CHARACTER(LEN=*), INTENT(IN) :: base_name ! base name INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -205,7 +205,7 @@ CONTAINS INTERFACE INTEGER FUNCTION h5_cleanup_c(base_name, base_namelen, fapl) - USE H5GLOBAL + USE H5GLOBAL, ONLY : HID_T, SIZE_T !DEC$ IF DEFINED(HDF5F90_WINDOWS) !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5_CLEANUP_C':: h5_cleanup_c !DEC$ ENDIF @@ -304,6 +304,56 @@ CONTAINS END SUBROUTINE h5_env_nocleanup_f +!---------------------------------------------------------------------- +! Name: h5vl_fapl_is_native_f +! +! Purpose: Invokes the H5VL_fapl_is_native() operation +! +! Inputs: fapl - file access property list +! flag - flag indicating whether VOL connector stack in FAPL is the native connector +! +! Outputs: IsNative - .true. - FAPL indicates that VOL connector stack is just native connector +! .false. - Not the native connector +! hdferr - Returns 0 on success and -1 on failure +! +! Programmer: Quincey Koziol +! June 24, 2021 +! +!---------------------------------------------------------------------- + SUBROUTINE h5vl_fapl_is_native_f(fapl_id, IsNative, hdferr) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: h5vl_fapl_is_native_f +!DEC$endif + USE H5GLOBAL, ONLY : HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id + LOGICAL, INTENT(OUT) :: IsNative + INTEGER, INTENT(OUT) :: hdferr +!***** + INTEGER :: flag ! "TRUE/FALSE" flag from C routine + + INTERFACE + INTEGER FUNCTION h5vl_fapl_is_native_c(fapl_id, flag) BIND(C,NAME='h5vl_fapl_is_native_c') + USE H5GLOBAL, ONLY : HID_T + !DEC$ IF DEFINED(HDF5F90_WINDOWS) + !DEC$ ATTRIBUTES C,reference,decorate,alias:'H5VL_FAPL_IS_NATIVE_C':: h5vl_fapl_is_native_c + !DEC$ ENDIF + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id + INTEGER :: flag + END FUNCTION h5vl_fapl_is_native_c + END INTERFACE + + hdferr = h5vl_fapl_is_native_c(fapl_id, flag) + IF(hdferr.GE.0) THEN + IsNative = .FALSE. + IF (flag .EQ. 1) IsNative = .TRUE. + ENDIF + + END SUBROUTINE h5vl_fapl_is_native_f + ! --------------------------------------------------------------------------------------------------- ! H5_SIZEOF routines ! |