summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-10-25 00:36:18 (GMT)
committerGitHub <noreply@github.com>2023-10-25 00:36:18 (GMT)
commita91be87f072a8020d9a467f1ef81132cb5c40149 (patch)
treee5a3ef49a818d07f5649f9aeaa718047efaef658 /fortran
parent097fd51481a7d5eaf8f94436cf21e08ac516d6ba (diff)
downloadhdf5-a91be87f072a8020d9a467f1ef81132cb5c40149.zip
hdf5-a91be87f072a8020d9a467f1ef81132cb5c40149.tar.gz
hdf5-a91be87f072a8020d9a467f1ef81132cb5c40149.tar.bz2
Sync with develop (#3764)
* Add missing test files to distclean target (#3734) Cleans up new files in Autotools `make distclean` in the test directory * Add tools/libtest to Autotools builds (#3735) This was only added to CMake many years ago and tests the tools library. * Clean up onion VFD files in tools `make clean` (#3739) Cleans up h5dump and h5diff *.onion files in the Autotools when runing `make clean`. * Clean Java test files on Autotools (#3740) Removes generated HDF5 and text output files when running `make clean`. * Clean the flushrefresh test dir on Autotools (#3741) The flushrefresh_test directory was not being cleaned up w/ `make clean` under the Autotools * Fix file names in tfile.c (#3743) Some tests in tfile.c use h5_fileaccess to get a VFD-dependent file name but use the scheme from testhdf5, reusing the FILE1 and FILE8 names. This leads to files like test1.h5.h5 which are unintended and not cleaned up. This changes the filename scheme for a few tests to work with h5test, resulting in more informative names and allowing the files to be cleaned up at the end of the test. The test files have also been added to the `make clean` target for the Autotools. * Clean Autotools files in parallel tests (#3744) Adds missing files to `make clean` for parallel, including Fortran. * Add native VOL checks to deprecated functions (#3647) * Add native VOL checks to deprecated functions * Remove unneeded native VOL checks * Move native checks to top level calls * Fix buffer overflow in cache debugging code (#3691) * update stat arg for apple (#3726) * update stat arg for apple * use H5_HAVE_DARWIN for Apple ifdef * fix typo * removed duplicate H5_ih_info_t * added fortran async test to cmake * Fix windows cpack error in WiX package. (#3747) * Add a simple cache to the ros3 VFD (#3753) Adds a small cache of the first N bytes of a file opened with the read-only S3 (ros3) VFD, where N is 4kiB or the size of the file, whichever is smaller. This avoids a lot of small I/O operations on file open. Addresses GitHub issue #3381 * Update Autotools to correctly configure oneAPI (#3751) * Update Autotools to correctly configure oneAPI Splits the Intel config files under the Autotools into 'classic' Intel and oneAPI versions, fixing 'unsupported option' messages. Also turns off `-check uninit` (new in 2023) in Fortran, which kills the H5_buildiface program due to false positives. * Enable Fortran in oneAPI CI workflow * Turn on Fortran in CMake, update LD_LIBRARY_PATH * Go back to disabling Fortran w/ Intel For some reason there's a linking problem w/ Fortran error while loading shared libraries: libifport.so.5: cannot open shared object file: No such file or directory * 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 * Update fortran action step (#3748) * Added missing DLL for H5PGET_ACTUAL_SELECTION_IO_MODE_F (#3760) * add missing H5PGET_ACTUAL_SELECTION_IO_MODE_F dll * Bump the ros3 VFD cache to 16 MiB (#3759) * Fix hangs during collective I/O with independent metadata writes (#3693) * Fix some issues with collective metadata reads for chunked datasets (#3716) Add functions/callbacks for explicit control over chunk index open/close Add functions/callbacks to check if chunk index is open or not so that it can be opened if necessary before temporarily disabling collective metadata reads in the library Add functions/callbacks for requesting loading of additional chunk index metadata beyond the chunk index itself * Fix failure in t_select_io_dset when run with more than 10 ranks (#3758) * Fix H5Pset_evict_on_close failing regardless of actual parallel use (#3761) Allow H5Pset_evict_on_close to be called regardless of whether a parallel build of HDF5 is being used Fail during file opens if H5Pset_evict_on_close has been set to true on the given File Access Property List and the size of the MPI communicator being used is greater than 1
Diffstat (limited to 'fortran')
-rw-r--r--fortran/src/H5Fff.F906
-rw-r--r--fortran/src/H5Off.F906
-rw-r--r--fortran/src/H5Pff.F9038
-rw-r--r--fortran/src/H5_f.c4
-rw-r--r--fortran/src/H5_ff.F905
-rw-r--r--fortran/src/H5config_f.inc.cmake8
-rw-r--r--fortran/src/H5config_f.inc.in3
-rw-r--r--fortran/src/H5f90global.F9016
-rw-r--r--fortran/src/hdf5_fortrandll.def.in1
-rw-r--r--fortran/test/tH5P.F905
-rw-r--r--fortran/testpar/CMakeTests.cmake1
-rw-r--r--fortran/testpar/Makefile.am2
-rw-r--r--fortran/testpar/hyper.F9015
-rw-r--r--fortran/testpar/subfiling.F9011
14 files changed, 102 insertions, 19 deletions
diff --git a/fortran/src/H5Fff.F90 b/fortran/src/H5Fff.F90
index fee4d3c..d311177 100644
--- a/fortran/src/H5Fff.F90
+++ b/fortran/src/H5Fff.F90
@@ -72,12 +72,6 @@ MODULE H5F
INTEGER(HSIZE_T) :: tot_space !< Amount of free space in the file
END TYPE H5F_info_free_t
-!> @brief H5_ih_info_t derived type.
- TYPE, BIND(C) :: H5_ih_info_t
- INTEGER(HSIZE_T) :: index_size !< btree and/or list
- INTEGER(HSIZE_T) :: heap_size !< Heap size
- END TYPE H5_ih_info_t
-
!> @brief H5F_info_t_sohm derived type.
TYPE, BIND(C) :: H5F_info_sohm_t
INTEGER(C_INT) :: version !< Version # of shared object header info
diff --git a/fortran/src/H5Off.F90 b/fortran/src/H5Off.F90
index 4a0a163..b705ba3 100644
--- a/fortran/src/H5Off.F90
+++ b/fortran/src/H5Off.F90
@@ -110,12 +110,6 @@ MODULE H5O
TYPE(mesg_t) :: mesg
END TYPE c_hdr_t
-!> @brief Extra metadata storage for obj & attributes
- TYPE, BIND(C) :: H5_ih_info_t
- INTEGER(hsize_t) :: index_size !< btree and/or list
- INTEGER(hsize_t) :: heap_size !< heap
- END TYPE H5_ih_info_t
-
!> @brief meta_size_t derived type
TYPE, BIND(C) :: meta_size_t
TYPE(H5_ih_info_t) :: obj !< v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets
diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90
index bbc7a9d..5821889 100644
--- a/fortran/src/H5Pff.F90
+++ b/fortran/src/H5Pff.F90
@@ -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
diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c
index 181047b..0392c2b 100644
--- a/fortran/src/H5_f.c
+++ b/fortran/src/H5_f.c
@@ -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
*/
diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90
index 68b3dd8..5315673 100644
--- a/fortran/src/H5_ff.F90
+++ b/fortran/src/H5_ff.F90
@@ -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)
diff --git a/fortran/src/H5config_f.inc.cmake b/fortran/src/H5config_f.inc.cmake
index 34fb091..71bce0e 100644
--- a/fortran/src/H5config_f.inc.cmake
+++ b/fortran/src/H5config_f.inc.cmake
@@ -23,6 +23,12 @@
#undef H5_HAVE_SUBFILING_VFD
#endif
+! Define if on APPLE
+#cmakedefine01 H5_HAVE_DARWIN
+#if H5_HAVE_DARWIN == 0
+#undef H5_HAVE_DARWIN
+#endif
+
! Define if the intrinsic function STORAGE_SIZE exists
#define H5_FORTRAN_HAVE_STORAGE_SIZE @H5_FORTRAN_HAVE_STORAGE_SIZE@
@@ -81,4 +87,4 @@
#cmakedefine01 H5_NO_DEPRECATED_SYMBOLS
#if H5_NO_DEPRECATED_SYMBOLS == 0
#undef H5_NO_DEPRECATED_SYMBOLS
-#endif \ No newline at end of file
+#endif
diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in
index 7fb76e1..991e4b0 100644
--- a/fortran/src/H5config_f.inc.in
+++ b/fortran/src/H5config_f.inc.in
@@ -20,6 +20,9 @@
! Define if we have subfiling support
#undef HAVE_SUBFILING_VFD
+! Define if on APPLE
+#undef HAVE_DARWIN
+
! Define if the intrinsic function STORAGE_SIZE exists
#undef FORTRAN_HAVE_STORAGE_SIZE
diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90
index e60f1e8..aa04623 100644
--- a/fortran/src/H5f90global.F90
+++ b/fortran/src/H5f90global.F90
@@ -25,6 +25,12 @@ MODULE H5GLOBAL
IMPLICIT NONE
+!> @brief H5_ih_info_t derived type.
+ TYPE, BIND(C) :: H5_ih_info_t
+ INTEGER(HSIZE_T) :: index_size !< btree and/or list
+ INTEGER(HSIZE_T) :: heap_size !< Heap size
+ END TYPE H5_ih_info_t
+
!> \addtogroup FH5
!> @{
! Parameters used in the function 'h5kind_to_type' located in H5_ff.F90.
@@ -368,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
!> @{
@@ -444,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
!
diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in
index 3b6600c..2ded002 100644
--- a/fortran/src/hdf5_fortrandll.def.in
+++ b/fortran/src/hdf5_fortrandll.def.in
@@ -417,6 +417,7 @@ H5P_mp_H5PSET_FILE_SPACE_STRATEGY_F
H5P_mp_H5PGET_FILE_SPACE_STRATEGY_F
H5P_mp_H5PSET_FILE_SPACE_PAGE_SIZE_F
H5P_mp_H5PGET_FILE_SPACE_PAGE_SIZE_F
+H5P_mp_H5PGET_ACTUAL_SELECTION_IO_MODE_F
; Parallel
@H5_NOPAREXP@H5P_mp_H5PSET_FAPL_MPIO_F
@H5_NOPAREXP@H5P_mp_H5PGET_FAPL_MPIO_F
diff --git a/fortran/test/tH5P.F90 b/fortran/test/tH5P.F90
index c73016b..78d665f 100644
--- a/fortran/test/tH5P.F90
+++ b/fortran/test/tH5P.F90
@@ -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)
diff --git a/fortran/testpar/CMakeTests.cmake b/fortran/testpar/CMakeTests.cmake
index 8c15724..473049f 100644
--- a/fortran/testpar/CMakeTests.cmake
+++ b/fortran/testpar/CMakeTests.cmake
@@ -17,3 +17,4 @@
##############################################################################
add_test (NAME MPI_TEST_FORT_parallel_test COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:parallel_test> ${MPIEXEC_POSTFLAGS})
add_test (NAME MPI_TEST_FORT_subfiling_test COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:subfiling_test> ${MPIEXEC_POSTFLAGS})
+add_test (NAME MPI_TEST_FORT_async_test COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:async_test> ${MPIEXEC_POSTFLAGS})
diff --git a/fortran/testpar/Makefile.am b/fortran/testpar/Makefile.am
index 7f9f284..afdda98 100644
--- a/fortran/testpar/Makefile.am
+++ b/fortran/testpar/Makefile.am
@@ -36,7 +36,7 @@ TEST_PROG_PARA=parallel_test subfiling_test async_test
check_PROGRAMS=$(TEST_PROG_PARA)
# Temporary files
-CHECK_CLEANFILES+=parf[12].h5 subf.h5*
+CHECK_CLEANFILES+=parf[12].h5 h5*_tests.h5 subf.h5* test_async_apis.mod
# Test source files
parallel_test_SOURCES=ptest.F90 hyper.F90 mdset.F90 multidsetrw.F90
diff --git a/fortran/testpar/hyper.F90 b/fortran/testpar/hyper.F90
index edd93cf..ec3a657 100644
--- a/fortran/testpar/hyper.F90
+++ b/fortran/testpar/hyper.F90
@@ -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)
diff --git a/fortran/testpar/subfiling.F90 b/fortran/testpar/subfiling.F90
index 043ac6c..a677bea 100644
--- a/fortran/testpar/subfiling.F90
+++ b/fortran/testpar/subfiling.F90
@@ -54,6 +54,7 @@ PROGRAM subfiling_test
INTEGER(HID_T) :: driver_id
CHARACTER(len=8) :: hex1, hex2
+ CHARACTER(len=1) :: arg
!
! initialize MPI
@@ -336,10 +337,14 @@ PROGRAM subfiling_test
WRITE(*,"(A,A)") "Failed to find the stub subfile ",TRIM(filename)
nerrors = nerrors + 1
ENDIF
-
- CALL EXECUTE_COMMAND_LINE("stat --format='%i' "//filename//" >> tmp_inode", EXITSTAT=i)
+#ifdef H5_HAVE_DARWIN
+ arg(1:1)="f"
+#else
+ arg(1:1)="c"
+#endif
+ CALL EXECUTE_COMMAND_LINE("stat -"//arg(1:1)//" %i "//filename//" >> tmp_inode", EXITSTAT=i)
IF(i.ne.0)THEN
- WRITE(*,"(A,A)") "Failed to stat the stub subfile ",TRIM(filename)
+ WRITE(*,"(A,A)") "Failed to stat the stub subfile ",TRIM(filename)
nerrors = nerrors + 1
ENDIF