diff options
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/src/H5Dff.F90 | 14 | ||||
-rw-r--r-- | fortran/src/H5Pff.F90 | 28 | ||||
-rw-r--r-- | fortran/src/H5_f.c | 54 | ||||
-rw-r--r-- | fortran/test/tH5D.F90 | 10 | ||||
-rw-r--r-- | fortran/testpar/hyper.F90 | 13 |
5 files changed, 72 insertions, 47 deletions
diff --git a/fortran/src/H5Dff.F90 b/fortran/src/H5Dff.F90 index 2353ca2..c8c1212 100644 --- a/fortran/src/H5Dff.F90 +++ b/fortran/src/H5Dff.F90 @@ -2396,7 +2396,7 @@ CONTAINS INTEGER(HID_T) , INTENT(IN) :: dset_id INTEGER(HSIZE_T) , INTENT(IN), DIMENSION(:) :: offset - INTEGER(C_INT32_T), INTENT(INOUT) :: filters + INTEGER , INTENT(INOUT) :: filters TYPE(C_PTR) :: buf INTEGER , INTENT(OUT) :: hdferr INTEGER(HID_T) , INTENT(IN), OPTIONAL :: dxpl_id @@ -2404,6 +2404,7 @@ CONTAINS INTEGER(HID_T) :: dxpl_id_default INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: offset_c INTEGER(HSIZE_T) :: i, rank + INTEGER(C_INT32_T) :: c_filters INTERFACE INTEGER(C_INT) FUNCTION H5Dread_chunk(dset_id, dxpl_id, offset, filters, buf) & @@ -2422,6 +2423,8 @@ CONTAINS dxpl_id_default = H5P_DEFAULT_F IF (PRESENT(dxpl_id)) dxpl_id_default = dxpl_id + c_filters = INT(filters, KIND=C_INT32_T) + rank = SIZE(offset, KIND=HSIZE_T) ALLOCATE(offset_c(rank), STAT=hdferr) @@ -2437,7 +2440,9 @@ CONTAINS offset_c(i) = offset(rank - i + 1) ENDDO - hdferr = INT(H5Dread_chunk(dset_id, dxpl_id_default, offset_c, filters, buf)) + hdferr = INT(H5Dread_chunk(dset_id, dxpl_id_default, offset_c, c_filters, buf)) + + filters = INT(c_filters) DEALLOCATE(offset_c) @@ -2462,7 +2467,7 @@ CONTAINS IMPLICIT NONE INTEGER(HID_T) , INTENT(IN) :: dset_id - INTEGER(C_INT32_T), INTENT(IN) :: filters + INTEGER , INTENT(IN) :: filters INTEGER(HSIZE_T) , INTENT(IN), DIMENSION(:) :: offset INTEGER(SIZE_T) , INTENT(IN) :: data_size TYPE(C_PTR) :: buf @@ -2472,6 +2477,7 @@ CONTAINS INTEGER(HID_T) :: dxpl_id_default INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: offset_c INTEGER(HSIZE_T) :: i, rank + INTEGER(C_INT32_T) :: c_filters INTERFACE INTEGER(C_INT) FUNCTION H5Dwrite_chunk(dset_id, dxpl_id, filters, offset, data_size, buf) & @@ -2506,6 +2512,8 @@ CONTAINS offset_c(i) = offset(rank - i + 1) ENDDO + c_filters = INT(filters, C_INT32_T) + hdferr = INT(H5Dwrite_chunk(dset_id, dxpl_id_default, filters, offset_c, data_size, buf)) DEALLOCATE(offset_c) diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index 1b55fe9..bbc7a9d 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -5346,10 +5346,13 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) SUBROUTINE h5pget_mpio_no_collective_cause_f(plist_id, local_no_collective_cause, global_no_collective_cause, hdferr) IMPLICIT NONE INTEGER(HID_T) , INTENT(IN) :: plist_id - INTEGER(C_INT32_T), INTENT(OUT) :: local_no_collective_cause - INTEGER(C_INT32_T), INTENT(OUT) :: global_no_collective_cause + INTEGER, INTENT(OUT) :: local_no_collective_cause + INTEGER, INTENT(OUT) :: global_no_collective_cause INTEGER , INTENT(OUT) :: hdferr + INTEGER(C_INT32_T) :: c_local_no_collective_cause + INTEGER(C_INT32_T) :: c_global_no_collective_cause + INTERFACE INTEGER(C_INT) FUNCTION H5Pget_mpio_no_collective_cause(plist_id, local_no_collective_cause, global_no_collective_cause) & BIND(C, NAME='H5Pget_mpio_no_collective_cause') @@ -5361,7 +5364,10 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) END FUNCTION H5Pget_mpio_no_collective_cause END INTERFACE - hdferr = INT(H5Pget_mpio_no_collective_cause(plist_id, local_no_collective_cause, global_no_collective_cause)) + hdferr = INT(H5Pget_mpio_no_collective_cause(plist_id, c_local_no_collective_cause, c_global_no_collective_cause)) + + local_no_collective_cause = INT(c_local_no_collective_cause) + global_no_collective_cause = INT(c_global_no_collective_cause) END SUBROUTINE h5pget_mpio_no_collective_cause_f @@ -6328,9 +6334,11 @@ END SUBROUTINE h5pget_virtual_dsetname_f !! SUBROUTINE h5pget_no_selection_io_cause_f(plist_id, no_selection_io_cause, hdferr) IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: plist_id - INTEGER(C_INT32_T), INTENT(OUT) :: no_selection_io_cause - INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER , INTENT(OUT) :: no_selection_io_cause + INTEGER , INTENT(OUT) :: hdferr + + INTEGER(C_INT32_T) :: c_no_selection_io_cause INTERFACE INTEGER(C_INT) FUNCTION H5Pget_no_selection_io_cause(plist_id, no_selection_io_cause) & @@ -6342,7 +6350,9 @@ END SUBROUTINE h5pget_virtual_dsetname_f END FUNCTION H5Pget_no_selection_io_cause END INTERFACE - hdferr = INT( H5Pget_no_selection_io_cause(plist_id, no_selection_io_cause)) + hdferr = INT( H5Pget_no_selection_io_cause(plist_id, c_no_selection_io_cause)) + + no_selection_io_cause = INT(c_no_selection_io_cause) END SUBROUTINE h5pget_no_selection_io_cause_f @@ -6373,7 +6383,7 @@ END SUBROUTINE h5pget_virtual_dsetname_f INTERFACE INTEGER(C_INT) FUNCTION H5Pset_file_space_strategy(plist_id, strategy, persist, threshold) & BIND(C, NAME='H5Pset_file_space_strategy') - IMPORT :: HID_T, HSIZE_T, C_INT, C_INT32_T, C_BOOL + IMPORT :: HID_T, HSIZE_T, C_INT, C_BOOL IMPLICIT NONE INTEGER(HID_T) , VALUE :: plist_id INTEGER(C_INT) , VALUE :: strategy @@ -6416,7 +6426,7 @@ END SUBROUTINE h5pget_virtual_dsetname_f INTERFACE INTEGER(C_INT) FUNCTION H5Pget_file_space_strategy(plist_id, strategy, persist, threshold) & BIND(C, NAME='H5Pget_file_space_strategy') - IMPORT :: HID_T, HSIZE_T, C_INT, C_INT32_T, C_BOOL + IMPORT :: HID_T, HSIZE_T, C_INT, C_BOOL IMPLICIT NONE INTEGER(HID_T), VALUE :: plist_id INTEGER(C_INT) :: strategy diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 067cd3e..181047b 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -449,33 +449,33 @@ h5init_flags_c(int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid h5d_flags[30] = (int_f)H5D_SELECTION_IO_MODE_OFF; h5d_flags[31] = (int_f)H5D_SELECTION_IO_MODE_ON; - h5d_flags[32] = H5D_MPIO_COLLECTIVE; - h5d_flags[33] = H5D_MPIO_SET_INDEPENDENT; - h5d_flags[34] = H5D_MPIO_DATATYPE_CONVERSION; - h5d_flags[35] = H5D_MPIO_DATA_TRANSFORMS; - h5d_flags[36] = H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED; - h5d_flags[37] = H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES; - h5d_flags[38] = H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; - h5d_flags[39] = H5D_MPIO_PARALLEL_FILTERED_WRITES_DISABLED; - h5d_flags[40] = H5D_MPIO_ERROR_WHILE_CHECKING_COLLECTIVE_POSSIBLE; - h5d_flags[41] = H5D_MPIO_NO_SELECTION_IO; - h5d_flags[42] = H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE; - - h5d_flags[43] = H5D_SEL_IO_DISABLE_BY_API; - h5d_flags[44] = H5D_SEL_IO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; - h5d_flags[45] = H5D_SEL_IO_CONTIGUOUS_SIEVE_BUFFER; - h5d_flags[46] = H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; - h5d_flags[47] = H5D_SEL_IO_PAGE_BUFFER; - h5d_flags[48] = H5D_SEL_IO_DATASET_FILTER; - h5d_flags[49] = H5D_SEL_IO_CHUNK_CACHE; - h5d_flags[50] = H5D_SEL_IO_TCONV_BUF_TOO_SMALL; - h5d_flags[51] = H5D_SEL_IO_BKG_BUF_TOO_SMALL; - h5d_flags[52] = H5D_SEL_IO_DEFAULT_OFF; - h5d_flags[53] = H5D_MPIO_NO_SELECTION_IO_CAUSES; - - h5d_flags[54] = H5D_MPIO_NO_CHUNK_OPTIMIZATION; - h5d_flags[55] = H5D_MPIO_LINK_CHUNK; - h5d_flags[56] = H5D_MPIO_MULTI_CHUNK; + h5d_flags[32] = (int_f)H5D_MPIO_COLLECTIVE; + h5d_flags[33] = (int_f)H5D_MPIO_SET_INDEPENDENT; + h5d_flags[34] = (int_f)H5D_MPIO_DATATYPE_CONVERSION; + h5d_flags[35] = (int_f)H5D_MPIO_DATA_TRANSFORMS; + h5d_flags[36] = (int_f)H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED; + h5d_flags[37] = (int_f)H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES; + h5d_flags[38] = (int_f)H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; + h5d_flags[39] = (int_f)H5D_MPIO_PARALLEL_FILTERED_WRITES_DISABLED; + h5d_flags[40] = (int_f)H5D_MPIO_ERROR_WHILE_CHECKING_COLLECTIVE_POSSIBLE; + h5d_flags[41] = (int_f)H5D_MPIO_NO_SELECTION_IO; + h5d_flags[42] = (int_f)H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE; + + h5d_flags[43] = (int_f)H5D_SEL_IO_DISABLE_BY_API; + h5d_flags[44] = (int_f)H5D_SEL_IO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; + h5d_flags[45] = (int_f)H5D_SEL_IO_CONTIGUOUS_SIEVE_BUFFER; + h5d_flags[46] = (int_f)H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB; + h5d_flags[47] = (int_f)H5D_SEL_IO_PAGE_BUFFER; + h5d_flags[48] = (int_f)H5D_SEL_IO_DATASET_FILTER; + h5d_flags[49] = (int_f)H5D_SEL_IO_CHUNK_CACHE; + h5d_flags[50] = (int_f)H5D_SEL_IO_TCONV_BUF_TOO_SMALL; + h5d_flags[51] = (int_f)H5D_SEL_IO_BKG_BUF_TOO_SMALL; + h5d_flags[52] = (int_f)H5D_SEL_IO_DEFAULT_OFF; + h5d_flags[53] = (int_f)H5D_MPIO_NO_SELECTION_IO_CAUSES; + + h5d_flags[54] = (int_f)H5D_MPIO_NO_CHUNK_OPTIMIZATION; + h5d_flags[55] = (int_f)H5D_MPIO_LINK_CHUNK; + h5d_flags[56] = (int_f)H5D_MPIO_MULTI_CHUNK; /* * H5E flags diff --git a/fortran/test/tH5D.F90 b/fortran/test/tH5D.F90 index 328141d..8c1484f 100644 --- a/fortran/test/tH5D.F90 +++ b/fortran/test/tH5D.F90 @@ -1026,7 +1026,7 @@ CONTAINS INTEGER :: i, j, n INTEGER :: error TYPE(C_PTR) :: f_ptr - INTEGER(C_int32_t) :: filters + INTEGER :: filters INTEGER(SIZE_T) :: sizeINT INTEGER(HID_T) :: dxpl @@ -1081,12 +1081,12 @@ CONTAINS f_ptr = C_LOC(wdata1) offset(1:2) = (/0, 0/) - CALL H5Dwrite_chunk_f(dset_id, 0_C_INT32_T, offset, CHUNK0 * CHUNK1 * sizeINT, f_ptr, error) + CALL H5Dwrite_chunk_f(dset_id, 0, offset, CHUNK0 * CHUNK1 * sizeINT, f_ptr, error) CALL check("h5dwrite_f",error,total_error) f_ptr = C_LOC(wdata2) offset(1:2) = (/0, 16/) - CALL H5Dwrite_chunk_f(dset_id, 0_C_INT32_T, offset, CHUNK0 * CHUNK1 * sizeINT, f_ptr, error, dxpl) + CALL H5Dwrite_chunk_f(dset_id, 0, offset, CHUNK0 * CHUNK1 * sizeINT, f_ptr, error, dxpl) CALL check("h5dwrite_f",error,total_error) CALL h5dclose_f(dset_id, error) @@ -1126,7 +1126,7 @@ CONTAINS ENDDO ENDDO - CALL VERIFY("H5Dread_chunk_f",filters, 0_C_INT32_T, total_error) + CALL VERIFY("H5Dread_chunk_f",filters, 0, total_error) f_ptr = C_LOC(rdata2) offset(1:2) = (/0, 16/) @@ -1141,7 +1141,7 @@ CONTAINS ENDDO ENDDO - CALL VERIFY("H5Dread_chunk_f",filters, 0_C_INT32_T, total_error) + CALL VERIFY("H5Dread_chunk_f",filters, 0, total_error) CALL h5dclose_f(dset_id, error) CALL check("h5dclose_f",error,total_error) diff --git a/fortran/testpar/hyper.F90 b/fortran/testpar/hyper.F90 index 2120f48..edd93cf 100644 --- a/fortran/testpar/hyper.F90 +++ b/fortran/testpar/hyper.F90 @@ -52,9 +52,9 @@ SUBROUTINE hyper(length,do_collective,do_chunk, mpi_size, mpi_rank, nerrors) LOGICAL :: is_coll LOGICAL :: is_coll_true = .TRUE. - INTEGER(C_INT32_T) :: local_no_collective_cause - INTEGER(C_INT32_T) :: global_no_collective_cause - INTEGER(C_INT32_T) :: no_selection_io_cause + INTEGER :: local_no_collective_cause + INTEGER :: global_no_collective_cause + INTEGER :: no_selection_io_cause ! ! initialize the array data between the processes (3) @@ -275,6 +275,13 @@ 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) + ! Verify bitwise operations are correct + + IF( IOR(H5D_MPIO_DATATYPE_CONVERSION_F,H5D_MPIO_DATA_TRANSFORMS_F).NE.6)THEN + PRINT*, "Incorrect bitwise operations for Fortran defined constants" + nerrors = nerrors + 1 + ENDIF + CALL h5pget_no_selection_io_cause_f(dxpl_id, no_selection_io_cause, hdferror) CALL check("h5pget_no_selection_io_cause_f", hdferror, nerrors) |