1
1
openmpi/ompi/mpi/fortran/base/attr-fn-int-callback-interfaces.h
Themos Tsikas 4d126c16fa mpi/fortran: use conformant dummy names for Fortran bindings
The MPI spec defines that the "mpi" and "mpi_f08" module Fortran
bindings support passing by parameters by name.  Hence, we need to use
the MPI-spec-defined parameter names ("dummy variables", in Fortran
parlance) for the "mpi" and "mpi_f08" modules.

Specifically, Fortran allows calls to procedures to be written with
keyword arguments, e.g., "call mpi_sizeof(x=x,size=rsize,ierror=ier)"
An "explicit interface" for the procedure must be in scope for this to
be allowed in a Fortran program unit.  Therefore, the explicit
interface blocks we provide in the "mpi" and "mpi_f08" modules must
match the MPI published standard, including the names of the dummy
variables (i.e., parameter names), as that is how Fortran programs may
call them.

Note that we didn't find this issue previously because even though the
MPI spec *allows* for name-based parameter passing, not many people
actually use it.  I suspect that we might have some more incorrect
parameter names -- we should probably do a full "mpi" / "mpi_f08"
module parameter name audit someday.

Thanks to Themos Tsikas for reporting the issue and supplying the
initial fix.

Signed-off-by: themos.tsikas@nag.co.uk
Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
2018-05-02 09:42:19 +09:00

158 строки
5.5 KiB
C

! -*- f90 -*-
! Copyright (c) 2004-2005 The Regents of the University of California.
! All rights reserved.
! Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2013 Los Alamos National Security, LLC. All rights
! reserved.
! Copyright (c) 2015-2018 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! $COPYRIGHT$
!
! Additional copyrights may follow
!
! $HEADER$
!
!
! INTEGER handle pre-defined attribute callback function interfaces
!
interface
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine MPI_DUP_FN( comm, comm_keyval, extra_state, &
attribute_val_in, attribute_val_out, &
flag, ierr )
implicit none
integer :: comm, comm_keyval, extra_state
integer :: attribute_val_in, attribute_val_out, ierr
logical :: flag
end subroutine MPI_DUP_FN
subroutine MPI_NULL_COPY_FN( comm, comm_keyval, extra_state, &
attribute_val_in, attribute_val_out, &
flag, ierr )
implicit none
integer :: comm
integer :: comm_keyval, extra_state
integer :: attribute_val_in, attribute_val_out, ierr
logical :: flag
end subroutine MPI_NULL_COPY_FN
subroutine MPI_NULL_DELETE_FN( comm, comm_keyval, attribute_val_out, &
extra_state, ierr )
implicit none
integer :: comm
integer :: comm_keyval, attribute_val_out, extra_state, ierr
end subroutine MPI_NULL_DELETE_FN
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine MPI_COMM_DUP_FN(oldcomm, comm_keyval, extra_state, attribute_val_in, &
attribute_val_out, flag, ierr )
implicit none
include 'mpif-config.h'
integer :: oldcomm
integer :: comm_keyval
integer(kind=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out
logical :: flag
integer :: ierr
end subroutine MPI_COMM_DUP_FN
subroutine MPI_COMM_NULL_COPY_FN( comm, comm_keyval, extra_state, &
attribute_val_in, attribute_val_out, &
flag, ierr )
implicit none
include 'mpif-config.h'
integer :: comm
integer :: comm_keyval
integer(kind=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out
integer :: ierr
logical :: flag
end subroutine MPI_COMM_NULL_COPY_FN
subroutine MPI_COMM_NULL_DELETE_FN(comm, comm_keyval, attribute_val_out, &
extra_state, ierr )
implicit none
include 'mpif-config.h'
integer :: comm
integer :: comm_keyval
integer(kind=MPI_ADDRESS_KIND) :: attribute_val_out, extra_state
integer :: ierr
end subroutine MPI_COMM_NULL_DELETE_FN
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine MPI_TYPE_DUP_FN( datatype, type_keyval, extra_state, &
attribute_val_in, attribute_val_out, &
flag, ierr )
implicit none
include 'mpif-config.h'
integer :: datatype
integer :: type_keyval
integer(KIND=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out
logical :: flag
integer :: ierr
end subroutine MPI_TYPE_DUP_FN
subroutine MPI_TYPE_NULL_COPY_FN( datatype, type_keyval, extra_state, &
attribute_val_in, attribute_val_out, &
flag, ierr )
implicit none
include 'mpif-config.h'
integer :: datatype
integer :: type_keyval
integer(kind=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out
integer :: ierr
logical :: flag
end subroutine MPI_TYPE_NULL_COPY_FN
subroutine MPI_TYPE_NULL_DELETE_FN( datatype, type_keyval, attribute_val_out, &
extra_state, ierr )
implicit none
include 'mpif-config.h'
integer :: datatype
integer :: type_keyval
integer(kind=MPI_ADDRESS_KIND) :: attribute_val_out, extra_state
integer :: ierr
end subroutine MPI_TYPE_NULL_DELETE_FN
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine MPI_WIN_DUP_FN( oldwin, win_keyval, extra_state, &
attribute_val_in, attribute_val_out, &
flag, ierr)
implicit none
include 'mpif-config.h'
integer :: oldwin
integer :: win_keyval
integer(kind=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out
logical :: flag
integer :: ierr
end subroutine MPI_WIN_DUP_FN
subroutine MPI_WIN_NULL_COPY_FN( window, win_keyval, extra_state, &
attribute_val_in, attribute_val_out, &
flag, ierr )
implicit none
include 'mpif-config.h'
integer :: window
integer :: win_keyval
integer(kind=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out
integer :: ierr
logical :: flag
end subroutine MPI_WIN_NULL_COPY_FN
subroutine MPI_WIN_NULL_DELETE_FN( window, win_keyval, attribute_val_out, &
extra_state, ierr )
implicit none
include 'mpif-config.h'
integer :: window
integer :: win_keyval
integer(kind=MPI_ADDRESS_KIND) :: attribute_val_out, extra_state
integer :: ierr
end subroutine MPI_WIN_NULL_DELETE_FN
end interface