Skip to content

Commit c0a6341

Browse files
committed
%open(mpi=.false.) default, error if .true. and HDF5-MPI not linked
1 parent 618c54e commit c0a6341

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/interface.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ module subroutine h5open(self, filename, action, mpi, comp_lvl, shuffle, fletche
468468
class(hdf5_file), intent(inout) :: self
469469
character(*), intent(in) :: filename
470470
character(*), intent(in), optional :: action !< r, r+, rw, w, a
471-
logical, intent(in) :: mpi
471+
logical, intent(in), optional :: mpi
472472
integer, intent(in), optional :: comp_lvl !< 0: no compression. 1-9: ZLIB compression, higher is more compressior
473473
logical, intent(in), optional :: shuffle
474474
logical, intent(in), optional :: fletcher32

src/mpi.F90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363
call H5Pset_fapl_mpio_f(fapl, MPI_COMM_WORLD, MPI_INFO_NULL, ier)
6464
if(ier /= 0) error stop "ERROR:h5fortran:opener:h5pset_fapl_mpio could not collective open file for " // filename
6565

66+
#else
67+
68+
error stop "%open(mpi=.true.) requires HDF5-MPI, which is not currently linked to h5fortran." // filename
69+
6670
#endif
6771

6872
end procedure mpi_opener

src/utils.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
self%filename = filename
5454

55-
self%use_mpi = mpi
55+
if(present(mpi)) self%use_mpi = mpi
5656

5757
if(present(debug)) self%debug = debug
5858

0 commit comments

Comments
 (0)