diff --git a/NEWS b/NEWS index 5c04170c75..de9357f1a6 100644 --- a/NEWS +++ b/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 diff --git a/ompi/include/mpif.h.in b/ompi/include/mpif.h.in index 00f953dedf..47137092f2 100644 --- a/ompi/include/mpif.h.in +++ b/ompi/include/mpif.h.in @@ -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 diff --git a/ompi/mpi/f90/Makefile.am b/ompi/mpi/f90/Makefile.am index 233ba91f76..e2430a7b89 100644 --- a/ompi/mpi/f90/Makefile.am +++ b/ompi/mpi/f90/Makefile.am @@ -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 \ diff --git a/ompi/mpi/f90/scripts/Makefile.am b/ompi/mpi/f90/scripts/Makefile.am index 6d435a8f6a..7ac8b6bcae 100644 --- a/ompi/mpi/f90/scripts/Makefile.am +++ b/ompi/mpi/f90/scripts/Makefile.am @@ -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 \ diff --git a/ompi/mpi/f90/scripts/mpi-f90-interfaces.h.sh b/ompi/mpi/f90/scripts/mpi-f90-interfaces.h.sh index 661b15b197..275ac52767 100755 --- a/ompi/mpi/f90/scripts/mpi-f90-interfaces.h.sh +++ b/ompi/mpi/f90/scripts/mpi-f90-interfaces.h.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 diff --git a/ompi/mpi/f90/scripts/mpi_comm_spawn_multiple_f90.f90.sh b/ompi/mpi/f90/scripts/mpi_comm_spawn_multiple_f90.f90.sh new file mode 100755 index 0000000000..b28743dc96 --- /dev/null +++ b/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 <