Skip to content

Commit

Permalink
update stat arg for apple (#3726)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
brtnfld authored Oct 23, 2023
1 parent a4c318d commit 34f4569
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 16 deletions.
6 changes: 0 additions & 6 deletions fortran/src/H5Fff.F90
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ END FUNCTION h5fis_accessible
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
Expand Down
6 changes: 0 additions & 6 deletions fortran/src/H5Off.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion fortran/src/H5config_f.inc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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@

Expand Down Expand Up @@ -81,4 +87,4 @@
#cmakedefine01 H5_NO_DEPRECATED_SYMBOLS
#if H5_NO_DEPRECATED_SYMBOLS == 0
#undef H5_NO_DEPRECATED_SYMBOLS
#endif
#endif
3 changes: 3 additions & 0 deletions fortran/src/H5config_f.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions fortran/src/H5f90global.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions fortran/testpar/CMakeTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
11 changes: 8 additions & 3 deletions fortran/testpar/subfiling.F90
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ PROGRAM subfiling_test
INTEGER(HID_T) :: driver_id

CHARACTER(len=8) :: hex1, hex2
CHARACTER(len=1) :: arg

!
! initialize MPI
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 34f4569

Please sign in to comment.