Add h5pget_actual_selection_io_mode fortran wrapper (#3746)

* added h5pget_actual_selection_io_mode_f test

* added tests for h5pget_actual_selection_io_mode_f

* fixed int_f type conversion
This commit is contained in:
Scot Breitenfeld
2023-10-23 14:55:47 -05:00
committed by GitHub
parent a6d1bda6d2
commit da3b7ff945
7 changed files with 77 additions and 3 deletions
+37 -1
View File
@@ -6405,7 +6405,7 @@ END SUBROUTINE h5pget_virtual_dsetname_f
!! \brief Gets the file space handling strategy and persisting free-space values for a file creation property list.
!!
!! \param plist_id File creation property list identifier
!! \param strategy The file space handling strategy to be used.
!! \param strategy The file space handling strategy to be used
!! \param persist Indicate whether free space should be persistent or not
!! \param threshold The free-space section size threshold value
!! \param hdferr \fortran_error
@@ -6507,6 +6507,42 @@ END SUBROUTINE h5pget_virtual_dsetname_f
hdferr = INT(h5pget_file_space_page_size(prp_id, fsp_size))
END SUBROUTINE h5pget_file_space_page_size_f
!>
!! \ingroup FH5P
!!
!! \brief Retrieves the type(s) of I/O that HDF5 actually performed on raw data
!! during the last I/O call.
!!
!! \param plist_id File creation property list identifier
!! \param actual_selection_io_mode A bitwise set value indicating the type(s) of I/O performed
!! \param hdferr \fortran_error
!!
!! See C API: @ref H5Pget_actual_selection_io_mode()
!!
SUBROUTINE h5pget_actual_selection_io_mode_f(plist_id, actual_selection_io_mode, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: plist_id
INTEGER , INTENT(OUT) :: actual_selection_io_mode
INTEGER , INTENT(OUT) :: hdferr
INTEGER(C_INT32_T) :: c_actual_selection_io_mode
INTERFACE
INTEGER(C_INT) FUNCTION H5Pget_actual_selection_io_mode(plist_id, actual_selection_io_mode) &
BIND(C, NAME='H5Pget_actual_selection_io_mode')
IMPORT :: HID_T, C_INT32_T, C_INT
IMPLICIT NONE
INTEGER(HID_T), VALUE :: plist_id
INTEGER(C_INT32_T) :: actual_selection_io_mode
END FUNCTION H5Pget_actual_selection_io_mode
END INTERFACE
hdferr = INT(H5Pget_actual_selection_io_mode(plist_id, c_actual_selection_io_mode))
actual_selection_io_mode = INT(c_actual_selection_io_mode)
END SUBROUTINE h5pget_actual_selection_io_mode_f
END MODULE H5P
+4
View File
@@ -477,6 +477,10 @@ h5init_flags_c(int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid
h5d_flags[55] = (int_f)H5D_MPIO_LINK_CHUNK;
h5d_flags[56] = (int_f)H5D_MPIO_MULTI_CHUNK;
h5d_flags[57] = (int_f)H5D_SCALAR_IO;
h5d_flags[58] = (int_f)H5D_VECTOR_IO;
h5d_flags[59] = (int_f)H5D_SELECTION_IO;
/*
* H5E flags
*/
+4 -1
View File
@@ -74,7 +74,7 @@ MODULE H5LIB
!
! H5D flags declaration
!
INTEGER, PARAMETER :: H5D_FLAGS_LEN = 57
INTEGER, PARAMETER :: H5D_FLAGS_LEN = 60
INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags
INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2
INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags
@@ -467,6 +467,9 @@ CONTAINS
H5D_MPIO_NO_CHUNK_OPTIMIZATION_F = H5D_flags(55)
H5D_MPIO_LINK_CHUNK_F = H5D_flags(56)
H5D_MPIO_MULTI_CHUNK_F = H5D_flags(57)
H5D_SCALAR_IO_F = H5D_flags(58)
H5D_VECTOR_IO_F = H5D_flags(59)
H5D_SELECTION_IO_F = H5D_flags(60)
H5D_CHUNK_CACHE_NSLOTS_DFLT_F = H5D_size_flags(1)
H5D_CHUNK_CACHE_NBYTES_DFLT_F = H5D_size_flags(2)
+10
View File
@@ -374,6 +374,12 @@ MODULE H5GLOBAL
!DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_NO_CHUNK_OPTIMIZATION_F
!DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_LINK_CHUNK_F
!DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_MULTI_CHUNK_F
!DEC$ATTRIBUTES DLLEXPORT :: H5D_SCALAR_IO_F
!DEC$ATTRIBUTES DLLEXPORT :: H5D_VECTOR_IO_F
!DEC$ATTRIBUTES DLLEXPORT :: H5D_SELECTION_IO_F
!DEC$endif
!> \addtogroup FH5D
!> @{
@@ -450,6 +456,10 @@ MODULE H5GLOBAL
INTEGER :: H5D_MPIO_NO_CHUNK_OPTIMIZATION_F !< H5D_MPIO_NO_CHUNK_OPTIMIZATION
INTEGER :: H5D_MPIO_LINK_CHUNK_F !< H5D_MPIO_LINK_CHUNK
INTEGER :: H5D_MPIO_MULTI_CHUNK_F !< H5D_MPIO_MULTI_CHUNK
INTEGER :: H5D_SCALAR_IO_F !< Scalar (or legacy MPIO) I/O was performed
INTEGER :: H5D_VECTOR_IO_F !< Vector I/O was performed
INTEGER :: H5D_SELECTION_IO_F !< Selection I/O was performed
!
! H5E flags declaration
!
+5
View File
@@ -869,6 +869,7 @@ SUBROUTINE test_in_place_conversion(cleanup, total_error)
REAL(KIND=C_DOUBLE), DIMENSION(1:array_len) :: wbuf_d_org
REAL(KIND=C_FLOAT), DIMENSION(1:array_len), TARGET :: rbuf
INTEGER :: i
INTEGER :: actual_selection_io_mode
TYPE(C_PTR) :: f_ptr
! create the data
@@ -919,6 +920,10 @@ SUBROUTINE test_in_place_conversion(cleanup, total_error)
! Should not be equal for in-place buffer use
CALL VERIFY("h5dwrite_f -- in-place", wbuf_d(1), wbuf_d_org(1), total_error, .FALSE.)
CALL h5pget_actual_selection_io_mode_f(plist_id, actual_selection_io_mode, error)
CALL check("h5pget_actual_selection_io_mode_f", error, total_error)
CALL VERIFY("h5pget_actual_selection_io_mode_f", actual_selection_io_mode, H5D_SCALAR_IO_F, total_error)
f_ptr = C_LOC(rbuf)
CALL h5dread_f(dset_id, h5kind_to_type(KIND(rbuf(1)), H5_REAL_KIND), f_ptr, error)
CALL check("h5dread_f", error, total_error)
+15
View File
@@ -55,6 +55,7 @@ SUBROUTINE hyper(length,do_collective,do_chunk, mpi_size, mpi_rank, nerrors)
INTEGER :: local_no_collective_cause
INTEGER :: global_no_collective_cause
INTEGER :: no_selection_io_cause
INTEGER :: actual_selection_io_mode
!
! initialize the array data between the processes (3)
@@ -236,6 +237,20 @@ SUBROUTINE hyper(length,do_collective,do_chunk, mpi_size, mpi_rank, nerrors)
CALL h5dwrite_f(dset_id,H5T_NATIVE_INTEGER,wbuf,dims,hdferror,file_space_id=fspace_id,mem_space_id=mspace_id,xfer_prp=dxpl_id)
CALL check("h5dwrite_f", hdferror, nerrors)
CALL h5pget_actual_selection_io_mode_f(dxpl_id, actual_selection_io_mode, hdferror)
CALL check("h5pget_actual_selection_io_mode_f", hdferror, nerrors)
IF(do_collective)THEN
IF(actual_selection_io_mode .NE. H5D_SELECTION_IO_F)THEN
PRINT*, "Incorrect actual selection io mode"
nerrors = nerrors + 1
ENDIF
ELSE
IF(actual_selection_io_mode .NE. IOR(H5D_SELECTION_IO_F, H5D_SCALAR_IO_F))THEN
PRINT*, "Incorrect actual selection io mode"
nerrors = nerrors + 1
ENDIF
ENDIF
! Check h5pget_mpio_actual_io_mode_f function
CALL h5pget_mpio_actual_io_mode_f(dxpl_id, actual_io_mode, hdferror)
CALL check("h5pget_mpio_actual_io_mode_f", hdferror, nerrors)
+2 -1
View File
@@ -332,7 +332,8 @@ New Features
- Fortran async APIs H5A, H5D, H5ES, H5G, H5F, H5L and H5O were added.
- Added Fortran APIs:
h5pset_selection_io_f, h5pget_selection_io_f
h5pset_selection_io_f, h5pget_selection_io_f,
h5pget_actual_selection_io_mode_f,
h5pset_modify_write_buf_f, h5pget_modify_write_buf_f
- Added Fortran APIs: