Commit f760d48e authored by Andreas Marek's avatar Andreas Marek

Better checking for MPI interfaces

parent 6b3c5b96
......@@ -299,7 +299,43 @@ end program
if test x"${FC_does_infer_interfaces}" = x"yes"; then
#test whether compiler allows switching of argument-checking
# two problems
# 1. some MPIs (at least Intel) do not provide all
# interfaces, which will fail
# in case of MPI and not all interfaces -> switch of
# argument checking or fail
# 2. no MPI case: switch of PACK_REAL_TO_COMPLEX
if test x"${with_mpi}" = x"yes"; then
# check whether MPI module defines all interfaces; not the case for Intel MPI!
program test_mpi_interfaces
use mpi
implicit none
integer :: rank
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
if test x"${MPImodule_has_interfaces}" = x"no"; then
#check whether we can cure this by disabling argument checking
FCFLAGS="$FCFLAGS -fallow-argument-mismatch"
# test again
......@@ -313,19 +349,24 @@ if test x"${FC_does_infer_interfaces}" = x"yes"; then
call foo(b)
end program
if test x"${FC_does_still_infer_interfaces}" = x"yes"; then
AC_MSG_ERROR([Fortran compiler infers interfaces])
AC_MSG_ERROR([Fortran compiler infers interfaces; but MPI module does not supply all of them])
# # no MPI case switch of PACK_REAL_TO_COMPLEX
# # i.e. do _not_ define it
AC_DEFINE([PACK_REAL_TO_COMPLEX], [1], [In some kernels pack real to complex])
if test x"${enable_openmp}" = x"yes"; 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