From faf63c68f84952672b74b807c9a490d0a00c7fb8 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 20 May 2006 02:15:49 +0000 Subject: [PATCH] Merge over from the /tmp/fortran-stuff branch - split mpif.h into mpif.h and mpif-common.h[.in] - mpif-common.h is included by various f90 things and contains output from configure - mpif.h defines some f77-specific stuff and then includes mpif-common.h This commit was SVN r9997. --- configure.ac | 2 +- ompi/include/Makefile.am | 11 +- ompi/include/{mpif.h.in => mpif-common.h.in} | 29 +- ompi/include/mpif.h | 77 +++ ompi/mpi/f90/attr_fn-f90-interfaces.h | 2 +- ompi/mpi/f90/mpi.f90 | 2 +- ompi/mpi/f90/scripts/mpi-f90-interfaces.h.sh | 570 +++++++++--------- .../mpi/f90/scripts/mpi_accumulate_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_address_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_allgather_f90.f90.sh | 2 +- .../mpi/f90/scripts/mpi_allgatherv_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_allreduce_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_alltoall_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_alltoallv_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_alltoallw_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_bcast_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_bsend_f90.f90.sh | 2 +- .../mpi/f90/scripts/mpi_bsend_init_f90.f90.sh | 2 +- .../f90/scripts/mpi_buffer_attach_f90.f90.sh | 2 +- .../f90/scripts/mpi_buffer_detach_f90.f90.sh | 2 +- .../mpi_comm_spawn_multiple_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_exscan_f90.f90.sh | 2 +- .../f90/scripts/mpi_file_iread_at_f90.f90.sh | 2 +- .../mpi/f90/scripts/mpi_file_iread_f90.f90.sh | 2 +- .../scripts/mpi_file_iread_shared_f90.f90.sh | 2 +- .../f90/scripts/mpi_file_iwrite_at_f90.f90.sh | 2 +- .../f90/scripts/mpi_file_iwrite_f90.f90.sh | 2 +- .../scripts/mpi_file_iwrite_shared_f90.f90.sh | 2 +- .../mpi_file_read_all_begin_f90.f90.sh | 2 +- .../scripts/mpi_file_read_all_end_f90.f90.sh | 2 +- .../f90/scripts/mpi_file_read_all_f90.f90.sh | 2 +- .../mpi_file_read_at_all_begin_f90.f90.sh | 2 +- .../mpi_file_read_at_all_end_f90.f90.sh | 2 +- .../scripts/mpi_file_read_at_all_f90.f90.sh | 2 +- .../f90/scripts/mpi_file_read_at_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_file_read_f90.f90.sh | 2 +- .../mpi_file_read_ordered_begin_f90.f90.sh | 2 +- .../mpi_file_read_ordered_end_f90.f90.sh | 2 +- .../scripts/mpi_file_read_ordered_f90.f90.sh | 2 +- .../scripts/mpi_file_read_shared_f90.f90.sh | 2 +- .../mpi_file_write_all_begin_f90.f90.sh | 2 +- .../scripts/mpi_file_write_all_end_f90.f90.sh | 2 +- .../f90/scripts/mpi_file_write_all_f90.f90.sh | 2 +- .../mpi_file_write_at_all_begin_f90.f90.sh | 2 +- .../mpi_file_write_at_all_end_f90.f90.sh | 2 +- .../scripts/mpi_file_write_at_all_f90.f90.sh | 2 +- .../f90/scripts/mpi_file_write_at_f90.f90.sh | 2 +- .../mpi/f90/scripts/mpi_file_write_f90.f90.sh | 2 +- .../mpi_file_write_ordered_begin_f90.f90.sh | 2 +- .../mpi_file_write_ordered_end_f90.f90.sh | 2 +- .../scripts/mpi_file_write_ordered_f90.f90.sh | 2 +- .../scripts/mpi_file_write_shared_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_gather_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_gatherv_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_get_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_ibsend_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_irecv_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_irsend_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_isend_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_issend_f90.f90.sh | 2 +- .../f90/scripts/mpi_pack_external_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_pack_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_put_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_recv_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_recv_init_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_reduce_f90.f90.sh | 2 +- .../f90/scripts/mpi_reduce_scatter_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_rsend_f90.f90.sh | 2 +- .../mpi/f90/scripts/mpi_rsend_init_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_scan_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_scatter_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_scatterv_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_send_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_send_init_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_sendrecv_f90.f90.sh | 2 +- .../scripts/mpi_sendrecv_replace_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_sizeof.f90.sh | 16 +- ompi/mpi/f90/scripts/mpi_ssend_f90.f90.sh | 2 +- .../mpi/f90/scripts/mpi_ssend_init_f90.f90.sh | 2 +- .../scripts/mpi_unpack_external_f90.f90.sh | 2 +- ompi/mpi/f90/scripts/mpi_unpack_f90.f90.sh | 2 +- .../mpi/f90/scripts/mpi_win_create_f90.f90.sh | 2 +- ompi/mpi/f90/xml/chasm-mpi.f90.sh.xsl | 2 +- ompi/mpi/f90/xml/chasm-mpi.i.f90.xsl | 4 +- ompi/mpi/f90/xml/mpi.h.xml | 4 +- 85 files changed, 478 insertions(+), 389 deletions(-) rename ompi/include/{mpif.h.in => mpif-common.h.in} (95%) create mode 100644 ompi/include/mpif.h diff --git a/configure.ac b/configure.ac index 89ecef8905..c3224e98cf 100644 --- a/configure.ac +++ b/configure.ac @@ -1107,7 +1107,7 @@ AC_CONFIG_FILES([ ompi/Makefile ompi/etc/Makefile ompi/include/Makefile - ompi/include/mpif.h + ompi/include/mpif-common.h ompi/datatype/Makefile ompi/debuggers/Makefile diff --git a/ompi/include/Makefile.am b/ompi/include/Makefile.am index 5b28b6dcd4..713f785d98 100644 --- a/ompi/include/Makefile.am +++ b/ompi/include/Makefile.am @@ -9,6 +9,7 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. +# Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -16,16 +17,22 @@ # $HEADER$ # -headers = +# mpif.h is not generated, but mpif-common.h is. See big comments in +# these files for an explanation. + +headers = mpif.h nodist_headers = \ ompi_config.h +# Install these in $(includedir) +include_HEADERS = $(headers) + # these two are always installed in $(includedir), but shouldn't be # shipped since they are generated by configure from their .in # counterparts, which AM automatically ships. nodist_include_HEADERS = \ mpi.h \ - mpif.h + mpif-common.h if WANT_INSTALL_HEADERS ompidir = $(includedir)/openmpi diff --git a/ompi/include/mpif.h.in b/ompi/include/mpif-common.h.in similarity index 95% rename from ompi/include/mpif.h.in rename to ompi/include/mpif-common.h.in index d73d28a889..e5772ed131 100644 --- a/ompi/include/mpif.h.in +++ b/ompi/include/mpif-common.h.in @@ -10,6 +10,7 @@ ! University of Stuttgart. All rights reserved. ! Copyright (c) 2004-2005 The Regents of the University of California. ! All rights reserved. +! Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. ! $COPYRIGHT$ ! ! Additional copyrights may follow @@ -50,6 +51,20 @@ ! WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! This file contains the bulk of the Open MPI Fortran interface. It +! is included as a back-end file to both mpif.h (i.e., the +! standardized MPI Fortran header file) and mpi.f90 (the MPI-2 +! Fortran module source file, found in ompi/mpi/f90). +! +! This file is marginally different than mpif.h. mpif.h includes +! some "external" statements that are not suitable for use with the +! MPI-2 F90 module, and therefore cannot be included in the mpi.f90 +! source file. Hence, this file is essentially everything that +! needs to be in the standardized mpif.h *except* the "external" +! statements, and is therefore suitable to be included in mpi.f90. +! + ! ! OMPI version ! This file is generated from configure; do not edit it manually. @@ -444,18 +459,8 @@ parameter (MPI_MAXLOC=11) parameter (MPI_MINLOC=12) parameter (MPI_REPLACE=13) -! -! attribute functions -! - external MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN - external MPI_COMM_NULL_COPY_FN, MPI_COMM_NULL_DELETE_FN - external MPI_TYPE_NULL_COPY_FN, MPI_TYPE_NULL_DELETE_FN - external MPI_DUP_FN, MPI_COMM_DUP_FN, MPI_TYPE_DUP_FN - external MPI_WIN_NULL_COPY_FN - external MPI_WIN_NULL_DELETE_FN - external MPI_WIN_DUP_FN + ! ! double precision functions ! - double precision MPI_WTIME, MPI_WTICK @MPIF_H_PMPI_W_FUNCS@ - external MPI_WTIME, MPI_WTICK @MPIF_H_PMPI_W_FUNCS@ + double precision MPI_WTIME, MPI_WTICK , PMPI_WTICK, PMPI_WTIME diff --git a/ompi/include/mpif.h b/ompi/include/mpif.h new file mode 100644 index 0000000000..8a027ab6e0 --- /dev/null +++ b/ompi/include/mpif.h @@ -0,0 +1,77 @@ +! -*- fortran -*- +! +! 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 +! of Tennessee Research Foundation. All rights +! reserved. +! Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +! University of Stuttgart. All rights reserved. +! Copyright (c) 2004-2005 The Regents of the University of California. +! All rights reserved. +! Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. +! $COPYRIGHT$ +! +! Additional copyrights may follow +! +! $HEADER$ +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! Do ***not*** copy this file to the directory where your Fortran +! fortran application is compiled unless it is absolutely necessary! Most +! modern Fortran compilers now support the -I command line flag, which +! tells the compiler where to find .h files (specifically, this one). For +! example: +! +! shell$ mpif77 foo.f -o foo -I$OMPI_HOME/include +! +! will probably do the trick (assuming that you have set OMPI_HOME +! properly). +! +! That being said, OMPI's "mpif77" wrapper compiler should +! automatically include the -I option for you. The following command +! should be equivalent to the command listed above: +! +! shell$ mpif77 foo.f -o foo +! +! You should not copy this file to your local directory because it is +! possible that this file will be changed between versions of Open MPI. +! Indeed, this mpif.h is incompatible with the mpif.f of other +! implementations of MPI. Using this mpif.h with other implementations +! of MPI, or with other versions of Open MPI will result in undefined +! behavior (to include incorrect results, segmentation faults, +! unexplainable "hanging" in your application, etc.). Always use the +! -I command line option instead (or let mpif77 do it for you). +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +! +! Include the back-end file that has the bulk of the MPI Fortran +! interface. +! + + include 'mpif-common.h' + +! +! These "external" statements are specific to the MPI F77 interface +! (and are toxic to the MPI F90 interface), and are therefore in the +! MPI F77-specific header file (i.e., this one). +! + external MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN + external MPI_COMM_NULL_COPY_FN, MPI_COMM_NULL_DELETE_FN + external MPI_TYPE_NULL_COPY_FN, MPI_TYPE_NULL_DELETE_FN + external MPI_DUP_FN, MPI_COMM_DUP_FN, MPI_TYPE_DUP_FN + external MPI_WIN_NULL_COPY_FN + external MPI_WIN_NULL_DELETE_FN + external MPI_WIN_DUP_FN + +! +! double precision functions +! + external MPI_WTIME, MPI_WTICK, PMPI_WTICK, PMPI_WTIME diff --git a/ompi/mpi/f90/attr_fn-f90-interfaces.h b/ompi/mpi/f90/attr_fn-f90-interfaces.h index 48ff2f203e..9da88b445b 100644 --- a/ompi/mpi/f90/attr_fn-f90-interfaces.h +++ b/ompi/mpi/f90/attr_fn-f90-interfaces.h @@ -10,7 +10,7 @@ ! ! Note about these declarations: these are "external" functions in -! mpif.h. However, if we don't declare them here, compilers will add +! mpif-common.h. However, if we don't declare them here, compilers will add ! them to the "mpi" module namespace, and result in linker errors if MPI ! F90 applications try to use them. because the implementations of ! these functions are not in the MPI module namespace -- they're the F77 diff --git a/ompi/mpi/f90/mpi.f90 b/ompi/mpi/f90/mpi.f90 index 972c5bcca8..3bc30029c0 100644 --- a/ompi/mpi/f90/mpi.f90 +++ b/ompi/mpi/f90/mpi.f90 @@ -19,7 +19,7 @@ module mpi - include "mpif.h" + include "mpif-common.h" ! The MPI attribute callback functions need to be explictly called out ! so that they don't end up in the MPI namespace. See a longer diff --git a/ompi/mpi/f90/scripts/mpi-f90-interfaces.h.sh b/ompi/mpi/f90/scripts/mpi-f90-interfaces.h.sh index baf01644e0..4400a7a95a 100755 --- a/ompi/mpi/f90/scripts/mpi-f90-interfaces.h.sh +++ b/ompi/mpi/f90/scripts/mpi-f90-interfaces.h.sh @@ -64,7 +64,7 @@ output_1() { cat <subroutine ${proc}( ) - include "mpif.h" + include "mpif-common.h" diff --git a/ompi/mpi/f90/xml/chasm-mpi.i.f90.xsl b/ompi/mpi/f90/xml/chasm-mpi.i.f90.xsl index de334693bd..dae0757b79 100644 --- a/ompi/mpi/f90/xml/chasm-mpi.i.f90.xsl +++ b/ompi/mpi/f90/xml/chasm-mpi.i.f90.xsl @@ -112,7 +112,7 @@ output_ () { subroutine ${procedure}( ) - include 'mpif.h' + include 'mpif-common.h' @@ -184,7 +184,7 @@ output_ () { subroutine ${proc}( ) - include 'mpif.h' + include 'mpif-common.h' diff --git a/ompi/mpi/f90/xml/mpi.h.xml b/ompi/mpi/f90/xml/mpi.h.xml index e30d0e7632..82af93fbeb 100644 --- a/ompi/mpi/f90/xml/mpi.h.xml +++ b/ompi/mpi/f90/xml/mpi.h.xml @@ -11178,12 +11178,12 @@