diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2000-10-30 21:03:18 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2000-10-30 21:03:18 (GMT) |
commit | 76807a69853689cae7ce847a113da839db9a2fe8 (patch) | |
tree | 055b42daab4671464a8b460dcd647234fdf8eed8 /fortran/testpar/ptesthdf5_fortran.f90 | |
parent | d26db0af91e1ea5c30d9bea820a36e9a50414bdd (diff) | |
download | hdf5-76807a69853689cae7ce847a113da839db9a2fe8.zip hdf5-76807a69853689cae7ce847a113da839db9a2fe8.tar.gz hdf5-76807a69853689cae7ce847a113da839db9a2fe8.tar.bz2 |
[svn-r2753]
Purpose:
Adding F90 || tests.
Description:
I created testpar directory with the following files
ptesthdf5_fortran.f90 - F90 test driver program
tcheck.f90 thdf5.f90 - handy subroutines to use with the tests
thyperslab_wr.f90 - F90 test:
collectively writes and reads hyperslabs to/from the dataset
Solution:
Platforms tested:
Partially tested on modi4 (O2K)
Diffstat (limited to 'fortran/testpar/ptesthdf5_fortran.f90')
-rw-r--r-- | fortran/testpar/ptesthdf5_fortran.f90 | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/fortran/testpar/ptesthdf5_fortran.f90 b/fortran/testpar/ptesthdf5_fortran.f90 new file mode 100644 index 0000000..fb575ff --- /dev/null +++ b/fortran/testpar/ptesthdf5_fortran.f90 @@ -0,0 +1,64 @@ +! +! Main program for parallel HDF5 Fortran tests. + + PROGRAM PHDF5F90TEST + + USE HDF5 ! This module contains all necessary modules + USE THDF5 + USE MPI + + IMPLICIT NONE + INTEGER :: error ! Error flags + INTEGER :: error_1 = 0 ! Error flags + ! + ! MPI definitions and calls. + ! + INTEGER :: mpierror ! MPI error flag + INTEGER :: comm, info + INTEGER :: mpi_size, mpi_rank + comm = MPI_COMM_WORLD + info = MPI_INFO_NULL + CALL MPI_INIT(mpierror) + CALL MPI_COMM_SIZE(comm, mpi_size, mpierror) + CALL MPI_COMM_RANK(comm, mpi_rank, mpierror) + ! + ! Check that datasets can be divided into equal parts by the processes. + ! + if ( (mod(DIM1, mpi_size) .ne. 0) .or. (mod(DIM2, mpi_size) .ne. 0)) then + if (mpi_rank .eq. 0) then + write(*,*) "Dimensions must be mupltiples of # of processors" + write(*,*) "Exiting..." + goto 1000 + endif + endif + ! + ! Initialize FORTRAN predefined datatypes + ! + CALL h5init_types_f(error) + if (mpi_rank .eq. 0) then + write(*,*) '===========================================' + write(*,*) ' Parallel Fortran Tests ' + write(*,*) '===========================================' + write(*,*) + endif + if (mpi_rank .eq. 0) then + write(*,*) 'Writing/reading dataset by hyperslabs' + endif + CALL dataset_wr_by_hyperslabs(error_1) + if (error_1 .ne. 0 ) write(*,*) 'Process ', mpi_rank, 'reports failure' + if (mpi_rank .eq. 0) then + write(*,*) + write(*,*) '===========================================' + write(*,*) ' Parallel Fortran Tests finished ' + write(*,*) '===========================================' + endif + ! + ! Close FORTRAN predefined datatypes. + ! + CALL h5close_types_f(error) + +1000 continue + + CALL MPI_FINALIZE(mpierror) + + END PROGRAM PHDF5F90TEST |