Commit f760d48e authored by Andreas Marek's avatar Andreas Marek

Better checking for MPI interfaces

parent 6b3c5b96
...@@ -299,33 +299,74 @@ end program ...@@ -299,33 +299,74 @@ end program
AC_MSG_RESULT([${FC_does_infer_interfaces}]) AC_MSG_RESULT([${FC_does_infer_interfaces}])
if test x"${FC_does_infer_interfaces}" = x"yes"; then if test x"${FC_does_infer_interfaces}" = x"yes"; then
#test whether compiler allows switching of argument-checking # two problems
FCFLAGS_SAVE2="$FCFLAGS" # 1. some MPIs (at least Intel) do not provide all
FCFLAGS="$FCFLAGS -fallow-argument-mismatch" # interfaces, which will fail
# test again # in case of MPI and not all interfaces -> switch of
AC_COMPILE_IFELSE([AC_LANG_SOURCE([ # argument checking or fail
program test # 2. no MPI case: switch of PACK_REAL_TO_COMPLEX
implicit none if test x"${with_mpi}" = x"yes"; then
integer :: a # check whether MPI module defines all interfaces; not the case for Intel MPI!
real*8 :: b AC_COMPILE_IFELSE([AC_LANG_SOURCE([
program test_mpi_interfaces
call foo(a) use mpi
call foo(b) implicit none
integer :: rank
end program integer :: buf(10)
integer :: ierr
call MPI_Init(ierr)
call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr)
if (rank == 0) then
buf(:) = 42;
end if
! this is OK
call MPI_Bcast(buf, 10, MPI_INT, 0, MPI_COMM_WORLD, ierr)
! Oops, wrong order here:
call MPI_Bcast(10, buf, MPI_INT, 0, MPI_COMM_WORLD, ierr)
call MPI_Finalize(ierr)
end program
])],
[MPImodule_has_interfaces=no],
[MPImodule_has_interfaces=yes]
)
if test x"${MPImodule_has_interfaces}" = x"no"; then
#check whether we can cure this by disabling argument checking
FCFLAGS_SAVE2="$FCFLAGS"
FCFLAGS="$FCFLAGS -fallow-argument-mismatch"
# test again
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
program test
implicit none
integer :: a
real*8 :: b
call foo(a)
call foo(b)
end program
])], ])],
[FC_does_still_infer_interfaces=no], [FC_does_still_infer_interfaces=no],
[FC_does_still_infer_interfaces=yes] [FC_does_still_infer_interfaces=yes]
) )
if test x"${FC_does_still_infer_interfaces}" = x"yes"; then if test x"${FC_does_still_infer_interfaces}" = x"yes"; then
FCFLAGS = "$FCFLAGS_SAVE2" FCFLAGS = "$FCFLAGS_SAVE2"
AC_MSG_ERROR([Fortran compiler infers interfaces]) AC_MSG_ERROR([Fortran compiler infers interfaces; but MPI module does not supply all of them])
fi
fi
#else
# # no MPI case switch of PACK_REAL_TO_COMPLEX
# # i.e. do _not_ define it
fi fi
else else
AC_DEFINE([PACK_REAL_TO_COMPLEX], [1], [In some kernels pack real to complex]) AC_DEFINE([PACK_REAL_TO_COMPLEX], [1], [In some kernels pack real to complex])
fi fi
if test x"${enable_openmp}" = x"yes"; then if test x"${enable_openmp}" = x"yes"; then
AX_ELPA_OPENMP AX_ELPA_OPENMP
if test "$ac_cv_prog_fc_openmp" = unsupported; then if test "$ac_cv_prog_fc_openmp" = unsupported; then
......
Markdown is supported
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