Commit 82df87a2 authored by Hendryk Bockelmann's avatar Hendryk Bockelmann
Browse files

use also MPI parallel hdf5 test for fortran

parent d534122f
......@@ -456,7 +456,7 @@ AC_CONFIG_FILES([tests/test_precision_run
tests/test_sct_run
tests/test_papi_run
tests/test_hdf5_run
tests/test2_hdf5_run
tests/test_hdf5_fortran_run
tests/test_serial_run
tests/test_omp_run
tests/test_mpi_run
......
......@@ -172,7 +172,7 @@ AC_DEFUN_ONCE([_AX_PROG_CC_MPI], [
AC_MSG_WARN([using CC=$CC as MPICC compiler.])
MPICC="$CC"
elif test -n "$CC" && test -n "$MPICC"; then
AC_MSG_WARN([overwriting CC=$MPICC.])
AC_MSG_WARN([overwriting CC=$MPICC. was former '$CC'])
CC="$MPICC"
fi
fi
......
......@@ -16,7 +16,7 @@ endif
if HDF5
noinst_PROGRAMS += test_hdf5
noinst_PROGRAMS += test2_hdf5
noinst_PROGRAMS += test_hdf5_fortran
#LIBS += $(LIBHDF5)
endif
......@@ -51,7 +51,7 @@ endif
test_papi_SOURCES = test_papi.c
test_hdf5_SOURCES = test_hdf5.c
test2_hdf5_SOURCES = test2_hdf5.f90
test_hdf5_fortran_SOURCES = test_hdf5_fortran.f90
test_serial_SOURCES = test_serial.c
test_omp_SOURCES = test_omp.c
test_mpi_SOURCES = test_mpi.c
......@@ -73,7 +73,7 @@ endif
if HDF5
TESTS += test_hdf5_run
TESTS += test2_hdf5_run
TESTS += test_hdf5_fortran_run
endif
if !OPENMP
......
PROGRAM test2_hdf5
PROGRAM test_hdf5_fortran
USE, INTRINSIC :: iso_c_binding, ONLY: c_int, c_long, c_float, c_double
#ifdef HAVE_MPI
USE mpi
#endif
USE sct, ONLY: sct_init, sct_new_timer, sct_start, sct_stop, sct_report, &
& sct_set_callstats, sct_add_report_attribute
......@@ -7,18 +10,21 @@ PROGRAM test2_hdf5
INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(12,307)
INTEGER :: itimer
INTEGER :: itimer, ierr
INTEGER(c_int) :: val_int
INTEGER(c_long) :: val_long
REAL(c_float) :: val_float
REAL(c_double) :: val_double
CHARACTER(len=20) :: val_string
#ifdef HAVE_MPI
CALL MPI_INIT(ierr)
#endif
CALL sct_init(timer_max=3)
itimer = sct_new_timer('test timer')
CALL sct_start(itimer)
CALL test1
CALL sct_stop(itimer)
......@@ -37,6 +43,10 @@ PROGRAM test2_hdf5
CALL sct_report()
#ifdef HAVE_MPI
CALL mpi_finalize(ierr)
#endif
CONTAINS
SUBROUTINE test1
......@@ -55,4 +65,4 @@ CONTAINS
END SUBROUTINE test1
END PROGRAM test2_hdf5
END PROGRAM test_hdf5_fortran
#! @SHELL@
export SCT_OUT="hdf5"
#export SCT_OUT="stdout"
export SCT_FILENAME="sct-testfile.h5"
rm -f $SCT_FILENAME
export SCT_CALLSTATS=1
@abs_top_srcdir@/tests/test2_hdf5 || exit 1
@OPENMP_TRUE@export OMP_NUM_THREADS=4
@MPI_TRUE@@MPI_LAUNCH@ -n 2 @abs_top_srcdir@/tests/test_hdf5_fortran
@MPI_FALSE@@abs_top_srcdir@/tests/test_hdf5_fortran
retval=$?
if (test $retval != 0) ; then
exit 1
fi
h5dump -a '/report_attributes/test_att_int' $SCT_FILENAME | grep 123 || exit 1
h5dump -a '/report_attributes/test_att_long' $SCT_FILENAME | grep 456 || exit 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment