Change the types of some of the "special" constants in mpif.h so that
they will match the prototypes in the [styictly-typed] MPI F90 bindings. Specifically, fix up MPI_COMM_SPAWN and MPI_COMM_SPAWN_MULTIPLE so that the constants MPI_ARGV_NULL, MPI_ERRCODES_IGNORE, and MPI_ARGVS_NULL can be used in the F90 bindings. Thanks to Michael Kluskens for pointing this out to us. Some work still remains in the F90 bindings -- we are missing all places where choice buffers can be of type CHARACTER. This commit was SVN r9198.
Этот коммит содержится в:
родитель
42f4a6fe03
Коммит
9d119109b6
3
NEWS
3
NEWS
@ -27,6 +27,9 @@ version 1.0.
|
||||
Several Fortran 77 and Fortran 90 tests need to be pre-seeded with
|
||||
results from a config.cache-like file.
|
||||
- Add --debug option to mpirun to generically invoke a parallel debugger.
|
||||
- Fix various MPI F90 interface functions and constant types to match.
|
||||
Thanks to Michael Kluskens for pointing out the problems to us.
|
||||
|
||||
|
||||
|
||||
1.0.2
|
||||
|
@ -1,6 +1,6 @@
|
||||
! -*- fortran -*-
|
||||
!
|
||||
! Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
! Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
! University Research and Technology
|
||||
! Corporation. All rights reserved.
|
||||
! Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
@ -165,9 +165,18 @@
|
||||
!
|
||||
! global variables
|
||||
!
|
||||
double complex MPI_BOTTOM, MPI_IN_PLACE, MPI_ARGV_NULL
|
||||
double complex MPI_ARGVS_NULL, MPI_ERRCODES_IGNORE
|
||||
double complex MPI_STATUS_IGNORE, MPI_STATUSES_IGNORE
|
||||
double complex MPI_BOTTOM, MPI_IN_PLACE
|
||||
character MPI_ARGV_NULL(1)
|
||||
! MPI_ARGVS_NULL must not be a character array so that we can match
|
||||
! an appropriate F90 MPI bindings interface function; see comments
|
||||
! in mpi-f90-interfaces.h for a full explanation.
|
||||
integer MPI_ARGVS_NULL
|
||||
! These must be integer arrays so that we can match the proper
|
||||
! prototypes in the F90 MPI bindings.
|
||||
integer MPI_ERRCODES_IGNORE(1)
|
||||
integer MPI_STATUS_IGNORE(MPI_STATUS_SIZE)
|
||||
integer MPI_STATUSES_IGNORE(MPI_STATUS_SIZE)
|
||||
|
||||
common/mpi_fortran_bottom/MPI_BOTTOM
|
||||
common/mpi_fortran_in_place/MPI_IN_PLACE
|
||||
common/mpi_fortran_argv_null/MPI_ARGV_NULL
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
@ -201,6 +201,7 @@ nodist_libmpi_f90_a_SOURCES = \
|
||||
mpi_bsend_init_f90.f90 \
|
||||
mpi_buffer_attach_f90.f90 \
|
||||
mpi_buffer_detach_f90.f90 \
|
||||
mpi_comm_spawn_multiple_f90.f90 \
|
||||
mpi_file_iread_f90.f90 \
|
||||
mpi_file_iread_at_f90.f90 \
|
||||
mpi_file_iread_shared_f90.f90 \
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
@ -17,8 +17,6 @@
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
|
||||
|
||||
noinst_SCRIPTS = \
|
||||
mpi-f90-interfaces.h.sh \
|
||||
mpi_address_f90.f90.sh \
|
||||
@ -27,6 +25,7 @@ noinst_SCRIPTS = \
|
||||
mpi_bsend_init_f90.f90.sh \
|
||||
mpi_buffer_attach_f90.f90.sh \
|
||||
mpi_buffer_detach_f90.f90.sh \
|
||||
mpi_comm_spawn_multiple_f90.f90.sh \
|
||||
mpi_file_iread_f90.f90.sh \
|
||||
mpi_file_iread_at_f90.f90.sh \
|
||||
mpi_file_iread_shared_f90.f90.sh \
|
||||
|
@ -1,7 +1,6 @@
|
||||
#! /bin/sh
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
@ -15455,8 +15454,39 @@ echo " integer, dimension(*), intent(out) :: array_of_errcodes"
|
||||
echo " integer, intent(out) :: ierr"
|
||||
echo "end subroutine ${proc}"
|
||||
echo
|
||||
echo "end interface ${procedure}"
|
||||
|
||||
# Now we have an interface function to explicitly match the
|
||||
# combinations of MPI_ARGVS_NULL. The rationale is not obvious...
|
||||
|
||||
# The SPAWN_MULTIPLE interface has a nice compile-time check to ensure
|
||||
# that the "count" parameter matches the dimension of the other
|
||||
# parameters. If the constant MPI_ARGVS_NULL is a character array of
|
||||
# some kind, there is no guarantee that the count value provided by
|
||||
# the application will match the dimension of MPI_ARGVS_NULL, which
|
||||
# could therefore result in a[n erroneous] compile-time error. As
|
||||
# such, it is simpler to just make MPI_ARGVS_NULL a wholly different
|
||||
# type (e.g., integer) that matches an entirely different interface
|
||||
# function.
|
||||
|
||||
# ARGVS_NULL variant
|
||||
proc="${procedure}AN"
|
||||
echo "subroutine ${proc}(count, array_of_commands, array_of_argv, array_of_maxprocs, array_of_info, &
|
||||
root, comm, intercomm, array_of_errcodes, ierr)"
|
||||
echo " use mpi_kinds"
|
||||
echo " integer, intent(in) :: count"
|
||||
echo " character(len=*), dimension(*), intent(in) :: array_of_commands"
|
||||
echo " integer, intent(in) :: array_of_argv"
|
||||
echo " integer, dimension(*), intent(in) :: array_of_maxprocs"
|
||||
echo " integer, dimension(*), intent(in) :: array_of_info"
|
||||
echo " integer, intent(in) :: root"
|
||||
echo " integer, intent(in) :: comm"
|
||||
echo " integer, intent(out) :: intercomm"
|
||||
echo " integer, dimension(*), intent(out) :: array_of_errcodes"
|
||||
echo " integer, intent(out) :: ierr"
|
||||
echo "end subroutine ${proc}"
|
||||
echo
|
||||
|
||||
echo "end interface ${procedure}"
|
||||
echo
|
||||
|
||||
echo "Finished generating Fortran 90 interface functions" >&2
|
||||
|
37
ompi/mpi/f90/scripts/mpi_comm_spawn_multiple_f90.f90.sh
Исполняемый файл
37
ompi/mpi/f90/scripts/mpi_comm_spawn_multiple_f90.f90.sh
Исполняемый файл
@ -0,0 +1,37 @@
|
||||
#! /bin/sh
|
||||
|
||||
. "$1/fortran_kinds.sh"
|
||||
|
||||
output() {
|
||||
procedure=$1
|
||||
proc=$2
|
||||
if test "$proc" = ""; then
|
||||
proc=$procedure
|
||||
fi
|
||||
|
||||
cat <<EOF
|
||||
subroutine ${proc}(count, array_of_commands, array_of_argv, &
|
||||
array_of_maxprocs, array_of_info, &
|
||||
root, comm, intercomm, array_of_errcodes, ierr)
|
||||
use mpi_kinds
|
||||
integer, intent(in) :: count
|
||||
character(len=*), dimension(*), intent(in) :: array_of_commands
|
||||
integer, intent(in) :: array_of_argv
|
||||
integer, dimension(*), intent(in) :: array_of_maxprocs
|
||||
integer, dimension(*), intent(in) :: array_of_info
|
||||
integer, intent(in) :: root
|
||||
integer, intent(in) :: comm
|
||||
integer, intent(out) :: intercomm
|
||||
integer, dimension(*), intent(out) :: array_of_errcodes
|
||||
integer, intent(out) :: ierr
|
||||
|
||||
call ${procedure}(count, array_of_commands, array_of_argv, &
|
||||
array_of_maxprocs, array_of_info, root, comm, intercomm, &
|
||||
array_of_errcodes, ierr)
|
||||
end subroutine ${proc}
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
output MPI_Comm_spawn_multiple
|
||||
output MPI_Comm_spawn_multiple MPI_Comm_spawn_multipleAN
|
Загрузка…
x
Ссылка в новой задаче
Block a user