Skip to content

Commit 04b49f6

Browse files
committed
test: clearer args
1 parent a0fff40 commit 04b49f6

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

test/test_deflate_write.f90

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ subroutine test_write_deflate(fn, N, mpi_id, Nmpi)
7777
if(debug) print '(a,i0,1x,2i5,2x,2i5)', "write_deflate partition: mpi_id, i0, i1 ", mpi_id, i0, i1
7878

7979
call h5f%open(fn, action='w', comp_lvl=1, mpi=.true.)
80-
call h5f%write('/A', A, N, istart=i0, iend=i1, chunk_size=[5, 50])
80+
call h5f%write('/A', A, dset_dims=N, istart=i0, iend=i1, chunk_size=[5, 50])
8181
call h5f%close()
8282

8383
deallocate(A)
@@ -131,21 +131,22 @@ subroutine test_deflate_whole(fn, N)
131131

132132
call h5f%open(fn, action='w', comp_lvl=3, mpi=.true.)
133133

134-
call h5f%write('/A', A, [N(1), N(2), 4], istart=i0, iend=i1, chunk_size=[4, 20, 1])
134+
call h5f%write('/A', A, dset_dims=[N(1), N(2), 4], istart=i0, iend=i1, chunk_size=[4, 20, 1])
135135
call h5f%chunks('/A', chunks)
136136
if(chunks(1) /= 4 .or. chunks(3) /= 1) then
137137
write(stderr, '(a,3I5)') "expected chunks: 4,*,1 but got chunks ", chunks
138138
error stop '#2 manual chunk unexpected chunk size'
139139
endif
140140

141-
call h5f%write('/A_autochunk', A, [N(1), N(2), 4], istart=i0, iend=i1)
141+
call h5f%write('/A_autochunk', A, dset_dims=[N(1), N(2), 4], istart=i0, iend=i1)
142142
call h5f%chunks('/A_autochunk', chunks)
143143
if(any(chunks < 1)) error stop '#2 auto chunk unexpected chunk size'
144144

145145
call h5f%close()
146146

147-
call h5f%open(fn, action='r', mpi=.false.)
148147
if(mpi_id == 0) then
148+
call h5f%open(fn, action='r', mpi=.false.)
149+
149150
fsize = real(h5f%filesize())
150151
crat = (2 * N(1) * N(2) * 4 * storage_size(A) / 8) / fsize
151152
!! 2* since two datasets same size
@@ -157,9 +158,9 @@ subroutine test_deflate_whole(fn, N)
157158
else
158159
print *, "test_deflate_whole: MPI commpression was disabled, so " // fn // " was not compressed."
159160
endif
160-
endif
161161

162-
call h5f%close()
162+
call h5f%close()
163+
endif
163164

164165
end subroutine test_deflate_whole
165166

@@ -205,8 +206,9 @@ subroutine test_deflate_slice(fn, N)
205206
if(any(chunks < 1)) error stop '#3 auto chunk unexpected chunk size'
206207
call h5f%close()
207208

208-
call h5f%open(fn, action='r', mpi=.false.)
209209
if(mpi_id == 0) then
210+
call h5f%open(fn, action='r', mpi=.false.)
211+
210212
fsize = real(h5f%filesize())
211213
crat = (N(1) * N(2) * storage_size(A) / 8) / fsize
212214

@@ -217,9 +219,9 @@ subroutine test_deflate_slice(fn, N)
217219
else
218220
print *, "test_deflate_slice: MPI commpression was disabled, so " // fn // " was not compressed."
219221
endif
220-
endif
221222

222-
call h5f%close()
223+
call h5f%close()
224+
endif
223225

224226
end subroutine test_deflate_slice
225227

test/test_destructor.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ program test_destruct
44

55
use, intrinsic :: iso_fortran_env, only : stderr=>error_unit
66

7-
use mpi, only : mpi_init, MPI_COMM_WORLD, mpi_comm_rank, mpi_barrier
7+
use mpi, only : mpi_init, MPI_COMM_WORLD, mpi_comm_rank
88

99
use h5mpi, only: hdf5_file
1010

test/test_shape.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ program test_shape
33

44
use, intrinsic:: iso_fortran_env, only: real64, int32, stdout=>output_unit, stderr=>error_unit
55

6-
use mpi, only : mpi_init, mpi_comm_rank, MPI_COMM_WORLD, mpi_barrier
6+
use mpi, only : mpi_init, mpi_comm_rank, MPI_COMM_WORLD
77

88
use h5mpi, only: hdf5_file,hsize_t, is_hdf5
99

0 commit comments

Comments
 (0)