diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2023-05-22 23:17:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-22 23:17:14 (GMT) |
commit | a888742959249605f83a00f1fd769c15b515969b (patch) | |
tree | 4811ce7bac3364f346cc5cac2371d2ce1bd36bf6 /fortran/testpar | |
parent | 8186a8ded043b383004160ec4ad239687c60d5dd (diff) | |
download | hdf5-a888742959249605f83a00f1fd769c15b515969b.zip hdf5-a888742959249605f83a00f1fd769c15b515969b.tar.gz hdf5-a888742959249605f83a00f1fd769c15b515969b.tar.bz2 |
Updated H5Ovisit_f and H5Ovisit_by_name_f wrappers internals. (#2987)
* * Removed C wrappers for H5Ovisit_f and H5Ovist_by_name_f, modifying the Fortran source accordingly.
* The intent for op_data was declared INOUT, even though the pointer address INTENT is, in actuality, IN. gfortran was optimizing out op_data in tests where the values were repeatedly reset to the same value. The values were reset in the test because the data the pointer targeted was updated in the callback.
* Made use of the 'verify' function to check value correctness.
* changed to useing INTEGER(C_INT) instead of C_BOOL, updated the documentation
Diffstat (limited to 'fortran/testpar')
-rw-r--r-- | fortran/testpar/async.F90 | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/fortran/testpar/async.F90 b/fortran/testpar/async.F90 index e3a80ad..83cd41c 100644 --- a/fortran/testpar/async.F90 +++ b/fortran/testpar/async.F90 @@ -26,6 +26,10 @@ MODULE test_async_APIs LOGICAL :: async_enabled = .TRUE. LOGICAL :: mpi_thread_mult = .TRUE. + INTEGER(C_INT), PARAMETER :: logical_true = 1 + INTEGER(C_INT), PARAMETER :: logical_false = 0 + + ! Custom group iteration callback data TYPE, bind(c) :: iter_info CHARACTER(KIND=C_CHAR), DIMENSION(1:12) :: name ! The name of the object @@ -174,7 +178,7 @@ CONTAINS INTEGER(HID_T) :: space_id INTEGER(HID_T) :: attr_id0, attr_id1, attr_id2 LOGICAL :: exists - LOGICAL(C_BOOL), TARGET :: exists0 = .FALSE., exists1 = .FALSE., exists2 = .FALSE., exists3 = .FALSE. + INTEGER(C_INT), TARGET :: exists0=logical_false, exists1=logical_false, exists2=logical_false, exists3=logical_false TYPE(C_PTR) :: f_ptr, f_ptr1, f_ptr2 CALL H5EScreate_f(es_id, hdferror) @@ -300,10 +304,10 @@ CONTAINS CALL check("H5ESwait_f", hdferror, total_error) CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) - CALL VERIFY("H5Aexists_async_f", LOGICAL(exists0), .TRUE., total_error) - CALL VERIFY("H5Aexists_async_f", LOGICAL(exists1), .TRUE., total_error) - CALL VERIFY("H5Aexists_by_name_async_f", LOGICAL(exists2), .TRUE., total_error) - CALL VERIFY("H5Aexists_by_name_async_f", LOGICAL(exists3), .TRUE., total_error) + CALL VERIFY("H5Aexists_async_f", exists0, logical_true, total_error) + CALL VERIFY("H5Aexists_async_f", exists1, logical_true, total_error) + CALL VERIFY("H5Aexists_by_name_async_f", exists2, logical_true, total_error) + CALL VERIFY("H5Aexists_by_name_async_f", exists3, logical_true, total_error) CALL VERIFY("H5Aread_async_f", attr_rdata0, attr_data0, total_error) CALL VERIFY("H5Aread_async_f", attr_rdata1, attr_data1, total_error) @@ -784,7 +788,7 @@ CONTAINS INTEGER(hid_t) :: sid = -1 ! Dataspace ID CHARACTER(LEN=12), PARAMETER :: CORDER_GROUP_NAME = "corder_group" CHARACTER(LEN=12), PARAMETER :: CORDER_GROUP_NAME2 = "corder_grp00" - LOGICAL(C_BOOL), TARGET :: exists1, exists2 + INTEGER(C_INT), TARGET :: exists1, exists2 LOGICAL :: exists TYPE(C_PTR) :: f_ptr @@ -911,12 +915,12 @@ CONTAINS CALL H5Fopen_async_f(filename, H5F_ACC_RDWR_F, file_id, es_id, hdferror, access_prp = fapl_id ) CALL check("h5fopen_async_f",hdferror,total_error) - exists1 = .FALSE. + exists1 = logical_false f_ptr = C_LOC(exists1) CALL H5Lexists_async_f(file_id, "hard_zero", f_ptr, es_id, hdferror) CALL check("H5Lexists_async_f",hdferror,total_error) - exists2 = .FALSE. + exists2 = logical_false f_ptr = C_LOC(exists2) CALL H5Lexists_async_f(file_id, "hard_two", f_ptr, es_id, hdferror) CALL check("H5Lexists_async_f",hdferror,total_error) @@ -931,8 +935,8 @@ CONTAINS CALL check("H5ESwait_f", hdferror, total_error) CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) - CALL VERIFY("H5Lexists_async_f", LOGICAL(exists1), .TRUE., total_error) - CALL VERIFY("H5Lexists_async_f", LOGICAL(exists2), .TRUE., total_error) + CALL VERIFY("H5Lexists_async_f", exists1, logical_true, total_error) + CALL VERIFY("H5Lexists_async_f", exists2, logical_true, total_error) CALL h5fopen_f(filename, H5F_ACC_RDWR_F, file_id, hdferror, access_prp = fapl_id ) CALL check("h5fopen_f",hdferror, total_error) |