From 134c527f18835feed95c360d43eb342e006d7c19 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 19 Jun 2014 13:44:08 +0000 Subject: [PATCH] Fortran: Move all f08-related modules out of fortran/base Move them all to fortran/use-mpi-f08, since that's the only directory that uses them (the use-mpi-f08-desc directory has been disabled). cmr=v1.8.2:ticket=trac:4736 This commit was SVN r32045. The following Trac tickets were found above: Ticket 4736 --> https://svn.open-mpi.org/trac/ompi/ticket/4736 --- ompi/mpi/fortran/base/Makefile.am | 69 -------------- ompi/mpi/fortran/use-mpi-f08/Makefile.am | 55 ++++++++--- .../mpi-f08-interfaces-callbacks.F90 | 93 ++++++++++--------- .../mpi-f08-interfaces.F90 | 0 .../{base => use-mpi-f08}/mpi-f08-types.F90 | 0 .../pmpi-f08-interfaces.F90 | 0 6 files changed, 89 insertions(+), 128 deletions(-) rename ompi/mpi/fortran/{base => use-mpi-f08}/mpi-f08-interfaces-callbacks.F90 (84%) rename ompi/mpi/fortran/{base => use-mpi-f08}/mpi-f08-interfaces.F90 (100%) rename ompi/mpi/fortran/{base => use-mpi-f08}/mpi-f08-types.F90 (100%) rename ompi/mpi/fortran/{base => use-mpi-f08}/pmpi-f08-interfaces.F90 (100%) diff --git a/ompi/mpi/fortran/base/Makefile.am b/ompi/mpi/fortran/base/Makefile.am index 6f53475379..7c2e63ead2 100644 --- a/ompi/mpi/fortran/base/Makefile.am +++ b/ompi/mpi/fortran/base/Makefile.am @@ -48,72 +48,3 @@ libmpi_fortran_base_la_SOURCES = \ strings.c \ test_constants_f.c endif - -#----------------------------------------------------------------------------- - -# If we're building the mpi_f08 bindings, this glue needs to be built -# first because it is needed by both the mpi_f08 module itself and the -# mpi_f08-based MPI extensions. We don't really care about the actual -# library that is built -- we just want to force the fortran modules -# to be built. -if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -noinst_LTLIBRARIES += \ - libforce_usempif08_internal_modules_to_be_built.la - -libforce_usempif08_internal_modules_to_be_built_la_SOURCES = \ - mpi-f08-types.F90 \ - mpi-f08-interfaces.F90 \ - mpi-f08-interfaces-callbacks.F90 \ - pmpi-f08-interfaces.F90 - -# -# Clean up all module files and all generated files -# - -MOSTLYCLEANFILES = *.mod - -# -# Automake doesn't do Fortran dependency analysis, so must list them -# manually here. Bummer! -# - -config_h = \ - $(top_builddir)/ompi/mpi/fortran/configure-fortran-output.h \ - $(top_srcdir)/ompi/mpi/fortran/configure-fortran-output-bottom.h - -mpi-f08-types.lo: $(config_h) -mpi-f08-types.lo: mpi-f08-types.F90 -mpi-f08-interfaces.lo: $(config_h) -mpi-f08-interfaces.lo: mpi-f08-interfaces.F90 -mpi-f08-interfaces.lo: mpi-f08-interfaces-callbacks.lo -mpi-f08-interfaces-callbacks.lo: $(config_h) -mpi-f08-interfaces-callbacks.lo: mpi-f08-interfaces-callbacks.F90 -mpi-f08-interfaces-callbacks.lo: mpi-f08-types.lo -pmpi-f08-interfaces.lo: $(config_h) -pmpi-f08-interfaces.lo: pmpi-f08-interfaces.F90 -pmpi-f08-interfaces.lo: mpi-f08-interfaces-callbacks.lo - -# Install the generated .mod files. Unfortunately, each F90 compiler -# may generate different filenames, so we have to use a glob. :-( - -install-exec-hook: - @ for file in `ls *.mod`; do \ - echo $(INSTALL) $$file $(DESTDIR)$(libdir); \ - $(INSTALL) $$file $(DESTDIR)$(libdir); \ - done - -uninstall-local: - @ for file in `ls *.mod`; do \ - echo rm -f $(DESTDIR)$(libdir)/$$file; \ - rm -f $(DESTDIR)$(libdir)/$$file; \ - done -else - -# Need to have empty targets because AM can't handle having an -# AM_CONDITIONAL was targets in the "if" statement but not in the -# "else". :-( - -install-exec-hook: -uninstall-local: - -endif diff --git a/ompi/mpi/fortran/use-mpi-f08/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/Makefile.am index d547d3255e..db13102661 100644 --- a/ompi/mpi/fortran/use-mpi-f08/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.am @@ -19,14 +19,21 @@ # MPI bindings. if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \ - $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/base \ +AM_FCFLAGS = -I$(top_builddir)/ompi/include \ + -I$(top_srcdir)/ompi/include \ $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/$(OMPI_FORTRAN_USEMPI_DIR) \ $(OMPI_FC_MODULE_FLAG). \ -I$(top_srcdir) $(FCFLAGS_f90) +MOSTLYCLEANFILES = *.mod + lib_LTLIBRARIES = libmpi_usempif08.la +module_sentinel_file = \ + libforce_usempif08_internal_modules_to_be_built.la + +noinst_LTLIBRARIES = $(module_sentinel_file) + mpi_api_files = \ abort_f08.F90 \ accumulate_f08.F90 \ @@ -705,7 +712,6 @@ endif libmpi_usempif08_la_SOURCES = \ $(mpi_api_files) \ $(pmpi_api_files) \ - mpi-f08-sizeof.F90 \ mpi-f-interfaces-bind.h \ pmpi-f-interfaces-bind.h \ attr-fn-f08-callback-interfaces.h \ @@ -718,21 +724,12 @@ libmpi_usempif08_la_SOURCES = \ # Include the mpi_f08-based MPI extensions in libmpi_usempif08, too. # -module_sentinel_file = \ - $(top_builddir)/ompi/mpi/fortran/base/libforce_usempif08_internal_modules_to_be_built.la - libmpi_usempif08_la_LIBADD = \ - $(module_sentinel_file) \ $(OMPI_MPIEXT_USEMPIF08_LIBS) \ $(top_builddir)/ompi/libmpi.la +libmpi_usempif08_la_DEPENDENCIES = $(module_sentinel_file) libmpi_usempif08_la_LDFLAGS = -version-info $(libmpi_usempif08_so_version) -# -# Clean up all module files -# - -MOSTLYCLEANFILES = *.mod - # # Automake doesn't do Fortran dependency analysis, so must list them # manually here. Bummer! @@ -753,6 +750,38 @@ mpi-f08.lo: mpi-f-interfaces-bind.h pmpi-f-interfaces-bind.h mpi-f08.lo: attr-fn-f08-callback-interfaces.h mpi-f08.lo: conversion-fn-null-f08-interface.h +########################################################################### + +# f08 support modules + +libforce_usempif08_internal_modules_to_be_built_la_SOURCES = \ + mpi-f08-types.F90 \ + mpi-f08-interfaces.F90 \ + mpi-f08-interfaces-callbacks.F90 \ + pmpi-f08-interfaces.F90 + +config_h = \ + $(top_builddir)/ompi/mpi/fortran/configure-fortran-output.h \ + $(top_srcdir)/ompi/mpi/fortran/configure-fortran-output-bottom.h + +# +# Automake doesn't do Fortran dependency analysis, so must list them +# manually here. Bummer! +# + +mpi-f08-types.lo: $(config_h) +mpi-f08-types.lo: mpi-f08-types.F90 +mpi-f08-interfaces.lo: $(config_h) +mpi-f08-interfaces.lo: mpi-f08-interfaces.F90 +mpi-f08-interfaces.lo: mpi-f08-interfaces-callbacks.lo +mpi-f08-interfaces-callbacks.lo: $(config_h) +mpi-f08-interfaces-callbacks.lo: mpi-f08-interfaces-callbacks.F90 +mpi-f08-interfaces-callbacks.lo: mpi-f08-types.lo +pmpi-f08-interfaces.lo: $(config_h) +pmpi-f08-interfaces.lo: pmpi-f08-interfaces.F90 +pmpi-f08-interfaces.lo: mpi-f08-interfaces-callbacks.lo + +########################################################################### # Install the generated .mod files. Unfortunately, each F90 compiler # may generate different filenames, so we have to use a glob. :-( diff --git a/ompi/mpi/fortran/base/mpi-f08-interfaces-callbacks.F90 b/ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces-callbacks.F90 similarity index 84% rename from ompi/mpi/fortran/base/mpi-f08-interfaces-callbacks.F90 rename to ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces-callbacks.F90 index 82e59bfbb7..05a1950949 100644 --- a/ompi/mpi/fortran/base/mpi-f08-interfaces-callbacks.F90 +++ b/ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces-callbacks.F90 @@ -10,9 +10,9 @@ module mpi_f08_interfaces_callbacks OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_User_function(invec, inoutvec, len, datatype) - USE mpi_f08_types - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - IMPLICIT NONE + USE mpi_f08_types + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR + IMPLICIT NONE TYPE(C_PTR), VALUE :: invec, inoutvec INTEGER :: len TYPE(MPI_Datatype) :: datatype @@ -20,7 +20,7 @@ OMPI_ABSTRACT INTERFACE END INTERFACE !Example of a user defined callback function -! +! ! subroutine my_user_function( invec, inoutvec, len, type ) bind(c) ! use, intrinsic :: iso_c_binding, only : c_ptr, c_f_pointer ! type(c_ptr), value :: invec, inoutvec @@ -34,38 +34,39 @@ END INTERFACE ! end if ! end subroutine my_function ! -!The MPI library may internally store such callbacks in a global array All_MPI_Ops: -! +! The MPI library may internally store such callbacks in a global array +! All_MPI_Ops: +! ! type, private :: Internal_MPI_op ! procedure(user_function), nopass, pointer :: user_fn ! end type ! type(Internal_MPI_op), private :: All_MPI_Ops(Max_Operations) -! -!Within MPI_Op_create, the user_fn is stored in All_MPI_Ops: -! +! +! Within MPI_Op_create, the user_fn is stored in All_MPI_Ops: +! ! subroutine MPI_Op_create( user_fn, commute, op ) bind(C) ! procedure(user_function) :: user_fn -! type(MPI_Op), intent(out) :: op -! ... +! type(MPI_Op), intent(out) :: op +! ... ! Registered_Operations = Registered_Operations + 1 ! op%MPI_VAL = Registered_Operations ! All_MPI_Ops(Registered_Operations)%user_fn => user_fn ! -!Within MPI_Reduce, the stored user_fn is used to, e.g., to combine -!recvbuf = sendbuf+recvbuf -! +! Within MPI_Reduce, the stored user_fn is used to, e.g., to combine +! recvbuf = sendbuf+recvbuf +! ! subroutine MPI_Reduce( sendbuf, recvbuf, count, datatype, op ) bind(C) ! use, intrinsic :: iso_c_binding, only : c_loc -! ... +! ... ! call All_MPI_Ops(op%MPI_VAL)%user_fn(c_loc(sendbuf), c_loc(recvbuf), count, datatype) -! - +! + OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Comm_copy_attr_function(oldcomm,comm_keyval,extra_state, & attribute_val_in,attribute_val_out,flag,ierror) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE TYPE(MPI_Comm) :: oldcomm INTEGER :: comm_keyval, ierror INTEGER(KIND=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out @@ -76,8 +77,8 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Comm_delete_attr_function(comm,comm_keyval, & attribute_val, extra_state, ierror) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE TYPE(MPI_Comm) :: comm INTEGER :: comm_keyval, ierror INTEGER(KIND=MPI_ADDRESS_KIND) :: attribute_val, extra_state @@ -87,8 +88,8 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Win_copy_attr_function(oldwin,win_keyval,extra_state, & attribute_val_in,attribute_val_out,flag,ierror) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE TYPE(MPI_Win) :: oldwin INTEGER :: win_keyval, ierror INTEGER(KIND=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out @@ -99,8 +100,8 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Win_delete_attr_function(win,win_keyval,attribute_val, & extra_state,ierror) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE TYPE(MPI_Win) :: win INTEGER :: win_keyval, ierror INTEGER(KIND=MPI_ADDRESS_KIND) :: attribute_val, extra_state @@ -110,8 +111,8 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Type_copy_attr_function(oldtype,type_keyval,extra_state, & attribute_val_in,attribute_val_out,flag,ierror) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE TYPE(MPI_Datatype) :: oldtype INTEGER :: type_keyval, ierror INTEGER(KIND=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out @@ -122,8 +123,8 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Type_delete_attr_function(datatype,type_keyval, & attribute_val,extra_state,ierror) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE TYPE(MPI_Datatype) :: datatype INTEGER :: type_keyval, ierror INTEGER(KIND=MPI_ADDRESS_KIND) :: attribute_val, extra_state @@ -132,8 +133,8 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Comm_errhandler_function(comm,error_code) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE TYPE(MPI_Comm) :: comm INTEGER :: error_code END SUBROUTINE @@ -141,8 +142,8 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Win_errhandler_function(win, error_code) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE TYPE(MPI_Win) :: win INTEGER :: error_code END SUBROUTINE @@ -152,8 +153,8 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_File_errhandler_function(file, error_code) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE TYPE(MPI_File) :: file INTEGER :: error_code END SUBROUTINE @@ -163,8 +164,8 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Grequest_query_function(extra_state,status,ierror) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE TYPE(MPI_Status) :: status INTEGER :: ierror INTEGER(KIND=MPI_ADDRESS_KIND) :: extra_state @@ -173,8 +174,8 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Grequest_free_function(extra_state,ierror) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE INTEGER :: ierror INTEGER(KIND=MPI_ADDRESS_KIND) :: extra_state END SUBROUTINE @@ -182,8 +183,8 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Grequest_cancel_function(extra_state,complete,ierror) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE INTEGER(KIND=MPI_ADDRESS_KIND) :: extra_state LOGICAL :: complete INTEGER :: ierror @@ -192,8 +193,8 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Datarep_extent_function(datatype, extent, extra_state, ierror) - USE mpi_f08_types - IMPLICIT NONE + USE mpi_f08_types + IMPLICIT NONE TYPE(MPI_Datatype) :: datatype INTEGER :: ierror INTEGER(KIND=MPI_ADDRESS_KIND) :: extent, extra_state @@ -203,9 +204,9 @@ END INTERFACE OMPI_ABSTRACT INTERFACE SUBROUTINE MPI_Datarep_conversion_function(userbuf, datatype, count, & filebuf, position, extra_state, ierror) - USE mpi_f08_types - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - IMPLICIT NONE + USE mpi_f08_types + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR + IMPLICIT NONE TYPE(C_PTR), VALUE :: userbuf, filebuf TYPE(MPI_Datatype) :: datatype INTEGER :: count, ierror diff --git a/ompi/mpi/fortran/base/mpi-f08-interfaces.F90 b/ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces.F90 similarity index 100% rename from ompi/mpi/fortran/base/mpi-f08-interfaces.F90 rename to ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces.F90 diff --git a/ompi/mpi/fortran/base/mpi-f08-types.F90 b/ompi/mpi/fortran/use-mpi-f08/mpi-f08-types.F90 similarity index 100% rename from ompi/mpi/fortran/base/mpi-f08-types.F90 rename to ompi/mpi/fortran/use-mpi-f08/mpi-f08-types.F90 diff --git a/ompi/mpi/fortran/base/pmpi-f08-interfaces.F90 b/ompi/mpi/fortran/use-mpi-f08/pmpi-f08-interfaces.F90 similarity index 100% rename from ompi/mpi/fortran/base/pmpi-f08-interfaces.F90 rename to ompi/mpi/fortran/use-mpi-f08/pmpi-f08-interfaces.F90