Found serious issue for the f90 interfaces for --with-mpi-f90- size=large

Consider

call MPI_REDUCE(MPI_IN_PLACE,sumpfi,sumpfmi,MPI_INTEGER,MPI_SUM, 0,allmpi,ier)

Error: Generic subroutine 'mpi_reduce' at (1) is not consistent with a specific subroutine interface

sumpfi is an integer array, sumpfmi is an integer.

The problem is that MPI_IN_PLACE is an integer, so you can only compile with the large interface file when the second argument of MPI_REDUCE is an integer, not an integer array, or a character, or a logical, ...

So this doubles the number of f90 interfaces needed for MPI_REDUCE (and anything else that uses MPI_IN_PLACE).


Configuration: OpenMPI 1.2a1r10111 (g95 on OS X 10.4.6), configured with "./configure F77=g95 FC=g95 LDFLAGS=-lSystemStubs --with-mpi-f90- size=large --enable-static --with-f90-max-array-dim=3"

I was using "--with-mpi-f90-size=large" to debug my code instead I'm into the OpenMPI scripts.

My solution to deal with this follows:

*** mpi-f90-interfaces.h.sh ***

output_183() {
    if test "$output" = "0"; then
        return 0
    fi

    procedure=$1
    rank=$2
    type=$4
    proc="$1$2D$3"
    cat <<EOF

subroutine ${proc}(sendbuf, recvbuf, count, datatype, op, &
        root, comm, ierr)
  include 'mpif-common.h'
  ${type}, intent(in) :: sendbuf
  ${type}, intent(out) :: recvbuf
  integer, intent(in) :: count
  integer, intent(in) :: datatype
  integer, intent(in) :: op
  integer, intent(in) :: root
  integer, intent(in) :: comm
  integer, intent(out) :: ierr
end subroutine ${proc}

EOF

if [ "${type}" != "integer*4" ]; then
    cat <<EOF

subroutine ${proc}M(sendbuf, recvbuf, count, datatype, op, &
        root, comm, ierr)
  include 'mpif-common.h'
  integer, intent(in) :: sendbuf
  ${type}, intent(out) :: recvbuf
  integer, intent(in) :: count
  integer, intent(in) :: datatype
  integer, intent(in) :: op
  integer, intent(in) :: root
  integer, intent(in) :: comm
  integer, intent(out) :: ierr
end subroutine ${proc}M

EOF

fi

}

-----
*** mpi_reduce_f90.f90.sh ***

output() {
    procedure=$1
    rank=$2
    type=$4
    proc="$1$2D$3"

    cat <<EOF

subroutine ${proc}(sendbuf, recvbuf, count, datatype, op, &
        root, comm, ierr)
  include "mpif-common.h"
  ${type}, intent(in) :: sendbuf
  ${type}, intent(out) :: recvbuf
  integer, intent(in) :: count
  integer, intent(in) :: datatype
  integer, intent(in) :: op
  integer, intent(in) :: root
  integer, intent(in) :: comm
  integer, intent(out) :: ierr
  call ${procedure}(sendbuf, recvbuf, count, datatype, op, &
        root, comm, ierr)
end subroutine ${proc}
EOF

if [ "${type}" != "integer*4" ] ; then
    cat <<EOF

subroutine ${proc}M(sendbuf, recvbuf, count, datatype, op, &
        root, comm, ierr)
  include "mpif-common.h"
  integer, intent(in) :: sendbuf
  ${type}, intent(out) :: recvbuf
  integer, intent(in) :: count
  integer, intent(in) :: datatype
  integer, intent(in) :: op
  integer, intent(in) :: root
  integer, intent(in) :: comm
  integer, intent(out) :: ierr
  call ${procedure}(sendbuf, recvbuf, count, datatype, op, &
        root, comm, ierr)
end subroutine ${proc}M

EOF

fi
}


Reply via email to