diff options
author | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2019-05-16 20:05:12 (GMT) |
---|---|---|
committer | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2019-05-16 20:05:12 (GMT) |
commit | 32c4900e89d845f0490bdbabddd2aab9c42165de (patch) | |
tree | 9696fb9367034965b4d9624c6277f2a5b61c9ec8 /fortran | |
parent | 1d6641ee3af65bdbe5e0f1f8fa56be8ea52dd5d7 (diff) | |
download | hdf5-32c4900e89d845f0490bdbabddd2aab9c42165de.zip hdf5-32c4900e89d845f0490bdbabddd2aab9c42165de.tar.gz hdf5-32c4900e89d845f0490bdbabddd2aab9c42165de.tar.bz2 |
removed VOLL NULL connector and replaced it with native VOL
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/src/H5VLff.F90 | 61 | ||||
-rw-r--r-- | fortran/src/hdf5_fortrandll.def.in | 1 | ||||
-rw-r--r-- | fortran/test/Makefile.am | 23 | ||||
-rw-r--r-- | fortran/test/null_vol_connector.c | 2 | ||||
-rw-r--r-- | fortran/test/vol_connector.F90 | 49 |
5 files changed, 33 insertions, 103 deletions
diff --git a/fortran/src/H5VLff.F90 b/fortran/src/H5VLff.F90 index e3469fb..0c5e8fd 100644 --- a/fortran/src/H5VLff.F90 +++ b/fortran/src/H5VLff.F90 @@ -4,7 +4,7 @@ ! MODULE H5VL ! ! PURPOSE -! This file contains Fortran interfaces for H5VL functions. +! This file contains Fortran interfaces for H5VL (VOL) functions. ! ! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -57,9 +57,9 @@ CONTAINS ! layer class by name. ! ! INPUTS -! cls - +! name - Connector name ! OUTPUTS -! vol_id - +! vol_id - VOL id ! hdferr - Returns 0 if successful and -1 if fails ! SOURCE @@ -72,10 +72,10 @@ CONTAINS !***** CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name INTEGER(HID_T) :: vipl_id_default - INTERFACE - INTEGER(HID_T) FUNCTION H5VLregister_connector_by_name(name, vipl_id) BIND(C,NAME='H5VLregister_connector_by_name') + INTEGER(HID_T) FUNCTION H5VLregister_connector_by_name(name, vipl_id) & + BIND(C,NAME='H5VLregister_connector_by_name') IMPORT :: C_CHAR IMPORT :: HID_T CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name @@ -113,7 +113,6 @@ CONTAINS END FUNCTION H5VLregister_connector_by_value END INTERFACE - vipl_id_default = H5P_DEFAULT_F IF(PRESENT(vipl_id)) vipl_id_default = vipl_id @@ -134,9 +133,9 @@ CONTAINS ! Tests whether a VOL class has been registered or not. ! ! INPUTS -! cls - +! name - Connector name ! OUTPUTS -! vol_id - +! registered - state of VOL class registration ! hdferr - Returns 0 if successful and -1 if fails ! SOURCE @@ -177,9 +176,9 @@ CONTAINS ! Retrieves the ID for a registered VOL connector. ! ! INPUTS -! cls - +! name - Connector name ! OUTPUTS -! vol_id - +! vol_id - Connector id ! hdferr - Returns 0 if successful and -1 if fails ! SOURCE @@ -236,15 +235,11 @@ CONTAINS name_len = INT(H5VLget_connector_name(obj_id, c_name, 0_SIZE_T), SIZE_T) IF(name_len.LT.0) hdferr = H5I_INVALID_HID_F ELSE - ! f_ptr = C_LOC(c_name(1)(1:1)) - PRINT*,LEN(name)+1 l = INT(LEN(name)+1,SIZE_T) IF(INT(H5VLget_connector_name(obj_id, c_name, l), SIZE_T).LT.0)THEN hdferr = H5I_INVALID_HID_F ELSE - PRINT*,"C_NAME", c_name CALL HD5c2fstring(name,c_name,LEN(name)) - PRINT*,"name", name ENDIF ENDIF @@ -261,7 +256,7 @@ CONTAINS ! Closes a VOL connector ID. ! ! INPUTS -! plugin_id - A valid identifier of the connectory to unregister. +! vol_id - A valid identifier of the connectory to unregister. ! ! OUTPUTS ! hdferr - Returns 0 if successful and -1 if fails @@ -317,40 +312,4 @@ CONTAINS END SUBROUTINE H5VLunregister_connector_f - !--------------------------------------------------------------------------- - ! Function: H5VLcmp_connector_cls_f - ! - ! Purpose: Compares two connector classes (based on their value field) - ! - ! Return: Success: Non-negative, *cmp set to a value like strcmp - ! - ! Failure: Negative, *cmp unset - ! - !--------------------------------------------------------------------------- - - SUBROUTINE H5VLcmp_connector_cls_f(cmp, connector_id1, connector_id2, hdferr) - IMPLICIT NONE - INTEGER, INTENT(OUT), TARGET :: cmp - INTEGER(HID_T), INTENT(IN) :: connector_id1 - INTEGER(HID_T), INTENT(IN) :: connector_id2 - INTEGER, INTENT(OUT) :: hdferr -!***** - - INTEGER(C_INT) :: cmp_c - - INTERFACE - INTEGER FUNCTION H5VLcmp_connector_cls(cmp, connector_id1, connector_id2) BIND(C, NAME='H5VLcmp_connector_cls') - IMPORT :: HID_T - IMPORT :: C_INT - INTEGER(C_INT) :: cmp - INTEGER(HID_T), INTENT(IN), VALUE :: connector_id1 - INTEGER(HID_T), INTENT(IN), VALUE :: connector_id2 - END FUNCTION H5VLcmp_connector_cls - END INTERFACE - - hdferr = INT(H5VLcmp_connector_cls(cmp_c, connector_id1, connector_id2)) - cmp = INT(cmp_c) - - END SUBROUTINE H5VLcmp_connector_cls_f - END MODULE H5VL diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 390c2b7..e143b45 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -460,7 +460,6 @@ H5VL_mp_H5VLGET_CONNECTOR_ID_F H5VL_mp_H5VLGET_CONNECTOR_NAME_F H5VL_mp_H5VLCLOSE_F H5VL_mp_H5VLUNREGISTER_CONNECTOR_F -H5VL_mp_H5VLCMP_CONNECTOR_CLS_F ; H5Z H5Z_mp_H5ZUNREGISTER_F H5Z_mp_H5ZFILTER_AVAIL_F diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am index ef6cd7e..9e03996 100644 --- a/fortran/test/Makefile.am +++ b/fortran/test/Makefile.am @@ -30,8 +30,6 @@ noinst_LTLIBRARIES=libh5test_fortran.la # want to build a shared C library and a static Fortran library. If so, # pass the -static flag to the library linker. if FORTRAN_SHARED_CONDITIONAL - TEST_SCRIPT = test_vol_connector.sh - SCRIPT_DEPEND = vol_connector$(EXEEXT) else AM_LDFLAGS+=-static endif @@ -39,26 +37,9 @@ endif check_SCRIPTS = $(TEST_SCRIPT) # Our main targets, the tests themselves -TEST_PROG=fortranlib_test fflush1 fflush2 fortranlib_test_1_8 fortranlib_test_F03 +TEST_PROG=fortranlib_test fflush1 fflush2 fortranlib_test_1_8 fortranlib_test_F03 vol_connector check_PROGRAMS=$(TEST_PROG) -if FORTRAN_SHARED_CONDITIONAL - check_PROGRAMS+= vol_connector -endif - -if FORTRAN_SHARED_CONDITIONAL - # The libh5test library provides common support code for the tests. - # The filter_plugin* libraries are for use in filter_plugin.c. - # Build them as shared libraries if that option was enabled in configure. - noinst_LTLIBRARIES += libnull_vol_connector.la - - # VOL plugin test libraries - # - # null_vol_connector is used for testing basic VOL plugin functionality. - libnull_vol_connector_la_SOURCES=null_vol_connector.c - libnull_vol_connector_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere -endif - libh5test_fortran_la_SOURCES = tf_gen.F90 tf.F90 t.c @@ -117,8 +98,6 @@ H5_test_buildiface_SOURCES = H5_test_buildiface.F90 H5_test_buildiface_LDADD = -DISTCLEANFILES=test_vol_connector.sh # TODO:CHECK IF WORKS MSB - # fflush2 depends on files created by fflush1 fflush2.chkexe_: fflush1.chkexe_ diff --git a/fortran/test/null_vol_connector.c b/fortran/test/null_vol_connector.c index 00a22b8..e30a659 100644 --- a/fortran/test/null_vol_connector.c +++ b/fortran/test/null_vol_connector.c @@ -127,6 +127,8 @@ H5VL_file_create(const char *name) { hid_t under_fapl; H5VL_t *file; + + printf(" H5VL_file_create \n"); file = (H5VL_t *)calloc(1, sizeof(H5VL_t)); diff --git a/fortran/test/vol_connector.F90 b/fortran/test/vol_connector.F90 index 7810c97..7f19d79 100644 --- a/fortran/test/vol_connector.F90 +++ b/fortran/test/vol_connector.F90 @@ -31,9 +31,8 @@ MODULE VOL_TMOD USE THDF5_F03 IMPLICIT NONE - - INTEGER, PARAMETER :: NULL_VOL_CONNECTOR_VALUE = 160 - CHARACTER(LEN=18), PARAMETER :: NULL_VOL_CONNECTOR_NAME = "null_vol_connector" + INTEGER, PARAMETER :: NATIVE_VOL_CONNECTOR_VALUE = 0 + CHARACTER(LEN=6), PARAMETER :: NATIVE_VOL_CONNECTOR_NAME = "native" CONTAINS @@ -57,50 +56,47 @@ CONTAINS INTEGER(hid_t) :: vol_id = 0, vol_id_out = 1 CHARACTER(LEN=64) :: name INTEGER(SIZE_T) :: name_len + INTEGER(hid_t) :: file_id INTEGER :: cmp = -1 -! CHARACTER(LEN=12) :: filename = "h5null.posix" -! INTEGER(HID_T) :: file_id ! The null VOL connector should not be registered at the start of the test - CALL H5VLis_connector_registered_f( NULL_VOL_CONNECTOR_NAME, is_registered, error) + CALL H5VLis_connector_registered_f( "FAKE_VOL_CONNECTOR_NAME", is_registered, error) CALL check("H5VLis_connector_registered_f",error,total_error) CALL VERIFY("H5VLis_connector_registered_f", is_registered, .FALSE., total_error) ! Register the connector by name - CALL H5VLregister_connector_by_name_f(NULL_VOL_CONNECTOR_NAME, vol_id, error) + CALL H5VLregister_connector_by_name_f(NATIVE_VOL_CONNECTOR_NAME, vol_id, error) CALL check("H5VLregister_connector_by_name_f",error,total_error) ! The connector should be registered now - CALL H5VLis_connector_registered_f(NULL_VOL_CONNECTOR_NAME, is_registered, error) + CALL H5VLis_connector_registered_f(NATIVE_VOL_CONNECTOR_NAME, is_registered, error) CALL check("H5VLis_connector_registered_f",error,total_error) CALL VERIFY("H5VLis_connector_registered_f", is_registered, .TRUE., total_error) - CALL H5VLget_connector_id_f(NULL_VOL_CONNECTOR_NAME, vol_id_out, error) + CALL H5VLget_connector_id_f(NATIVE_VOL_CONNECTOR_NAME, vol_id_out, error) CALL check("H5VLget_connector_id_f",error,total_error) - PRINT*,vol_id_out + CALL H5Fcreate_f("voltest.h5",H5F_ACC_TRUNC_F, file_id, error) + CALL check("H5F_create_f",error,total_error) - CALL H5VLget_connector_name_f(vol_id_out, name, error, name_len) + CALL H5VLget_connector_name_f(file_id, name, error, name_len) CALL check("H5VLget_connector_name_f",error,total_error) + CALL VERIFY("H5VLget_connector_name_f", INT(name_len), LEN_TRIM(NATIVE_VOL_CONNECTOR_NAME), total_error) - ! CALL H5VLget_connector_name_f(vol_id_out, name, error) - ! CALL check("H5VLget_connector_name_f",error,total_error) + CALL H5VLget_connector_name_f(file_id, name, error) + CALL check("H5VLget_connector_name_f",error,total_error) + CALL VERIFY("H5VLget_connector_name_f", name, NATIVE_VOL_CONNECTOR_NAME, total_error) - CALL H5VLcmp_connector_cls_f( cmp, vol_id_out, vol_id, error) - CALL check("H5VLcmp_connector_cls_f",error, total_error) - CALL VERIFY("H5VLcmp_connector_cls_f", cmp, 0, total_error) + CALL H5Fclose_f(file_id, error) + CALL check("H5Fclose_f",error,total_error) CALL H5VLclose_f(vol_id_out, error) + CALL check("H5VLclose_f",error, total_error) ! Unregister the connector CALL H5VLunregister_connector_f(vol_id, error) CALL check("H5VLunregister_connector_f", error, total_error) - ! The connector should not be registered now - CALL H5VLis_connector_registered_f( NULL_VOL_CONNECTOR_NAME, is_registered, error) - CALL check("H5VLis_connector_registered_f",error,total_error) - CALL VERIFY("H5VLis_connector_registered_f", is_registered, .FALSE., total_error) - END SUBROUTINE test_registration_by_name !------------------------------------------------------------------------- @@ -123,16 +119,16 @@ CONTAINS ! The null VOL connector should not be registered at the start of the test - CALL H5VLis_connector_registered_f( NULL_VOL_CONNECTOR_NAME, is_registered, error) + CALL H5VLis_connector_registered_f( "FAKE_VOL_CONNECTOR_NAME", is_registered, error) CALL check("H5VLis_connector_registered_f",error,total_error) CALL VERIFY("H5VLis_connector_registered_f", is_registered, .FALSE., total_error) ! Register the connector by value - CALL H5VLregister_connector_by_value_f(NULL_VOL_CONNECTOR_VALUE, vol_id, error) + CALL H5VLregister_connector_by_value_f(NATIVE_VOL_CONNECTOR_VALUE, vol_id, error) CALL check("H5VLregister_connector_by_value_f", error, total_error) ! The connector should be registered now - CALL H5VLis_connector_registered_f(NULL_VOL_CONNECTOR_NAME, is_registered, error) + CALL H5VLis_connector_registered_f(NATIVE_VOL_CONNECTOR_NAME, is_registered, error) CALL check("H5VLis_connector_registered_f",error,total_error) CALL VERIFY("H5VLis_connector_registered_f", is_registered, .TRUE., total_error) @@ -140,11 +136,6 @@ CONTAINS CALL H5VLunregister_connector_f(vol_id, error) CALL check("H5VLunregister_connector_f", error, total_error) - ! The connector should not be registered now - CALL H5VLis_connector_registered_f( NULL_VOL_CONNECTOR_NAME, is_registered, error) - CALL check("H5VLis_connector_registered_f",error,total_error) - CALL VERIFY("H5VLis_connector_registered_f", is_registered, .FALSE., total_error) - END SUBROUTINE test_registration_by_value END MODULE VOL_TMOD |