1
1
Jeff Squyres 253444c6d0 == Highlights ==
1. New mpifort wrapper compiler: you can utilize mpif.h, use mpi, and use mpi_f08 through this one wrapper compiler
 1. mpif77 and mpif90 still exist, but are sym links to mpifort and may be removed in a future release
 1. The mpi module has been re-implemented and is significantly "mo' bettah"
 1. The mpi_f08 module offers many, many improvements over mpif.h and the mpi module

This stuff is coming from a VERY long-lived mercurial branch (3 years!); it'll almost certainly take a few SVN commits and a bunch of testing before I get it correctly committed to the SVN trunk.

== More details ==

Craig Rasmussen and I have been working with the MPI-3 Fortran WG and Fortran J3 committees for a long, long time to make a prototype MPI-3 Fortran bindings implementation.  We think we're at a stable enough state to bring this stuff back to the trunk, with the goal of including it in OMPI v1.7.  

Special thanks go out to everyone who has been incredibly patient and helpful to us in this journey:

 * Rolf Rabenseifner/HLRS (mastermind/genius behind the entire MPI-3 Fortran effort)
 * The Fortran J3 committee
 * Tobias Burnus/gfortran
 * Tony !Goetz/Absoft
 * Terry !Donte/Oracle
 * ...and probably others whom I'm forgetting :-(

There's still opportunities for optimization in the mpi_f08 implementation, but by and large, it is as far along as it can be until Fortran compilers start implementing the new F08 dimension(..) syntax.

Note that gfortran is currently unsupported for the mpi_f08 module and the new mpi module.  gfortran users will a) fall back to the same mpi module implementation that is in OMPI v1.5.x, and b) not get the new mpi_f08 module.  The gfortran maintainers are actively working hard to add the necessary features to support both the new mpi_f08 module and the new mpi module implementations.  This will take some time.

As mentioned above, ompi/mpi/f77 and ompi/mpi/f90 no longer exist.  All the fortran bindings implementations have been collated under ompi/mpi/fortran; each implementation has its own subdirectory:

{{{
ompi/mpi/fortran/
  base/               - glue code
  mpif-h/             - what used to be ompi/mpi/f77
  use-mpi-tkr/        - what used to be ompi/mpi/f90
  use-mpi-ignore-tkr/ - new mpi module implementation
  use-mpi-f08/        - new mpi_f08 module implementation
}}}

There's also a prototype 6-function-MPI implementation under use-mpi-f08-desc that emulates the new F08 dimension(..) syntax that isn't fully available in Fortran compilers yet.  We did that to prove it to ourselves that it could be done once the compilers fully support it.  This directory/implementation will likely eventually replace the use-mpi-f08 version.

Other things that were done:

 * ompi_info grew a few new output fields to describe what level of Fortran support is included
 * Existing Fortran examples in examples/ were renamed; new mpi_f08 examples were added
 * The old Fortran MPI libraries were renamed:
   * libmpi_f77 -> libmpi_mpifh
   * libmpi_f90 -> libmpi_usempi
 * The configury for Fortran was consolidated and significantly slimmed down.  Note that the F77 env variable is now IGNORED for configure; you should only use FC. Example:
{{{
shell$ ./configure CC=icc CXX=icpc FC=ifort ...
}}}

All of this work was done in a Mercurial branch off the SVN trunk, and hosted at Bitbucket.  This branch has got to be one of OMPI's longest-running branches.  Its first commit was Tue Apr 07 23:01:46 2009 -0400 -- it's over 3 years old!  :-)  We think we've pulled in all relevant changes from the OMPI trunk (e.g., Fortran implementations of the new MPI-3 MPROBE stuff for mpif.h, use mpi, and use mpi_f08, and the recent Fujitsu Fortran patches).

I anticipate some instability when we bring this stuff into the trunk, simply because it touches a LOT of code in the MPI layer in the OMPI code base.  We'll try our best to make it as pain-free as possible, but please bear with us when it is committed.

This commit was SVN r26283.
2012-04-18 15:57:29 +00:00

270 строки
9.7 KiB
Makefile

# -*- makefile -*-
#
# 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-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2007 Los Alamos National Security, LLC. All rights
# reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
SUBDIRS = scripts
# THIS MAKEFILE IS OLD AND ONLY TO SUPPORT FORTRAN COMPILERS THAT DO
# NOT SUPPORT "IGNORE TKR" FUNCTIONALITY (cough cough gfortran cough
# cough). All reasonable Fortran compilers support ignore TKR and
# don't compile this directory -- instead, they compile
# ompi/fortran/use-mpi-ignore-tkr.
# This tree is left over to support non-ignore-tkr compilers, but
# hasn't been updated much. Indeed, many of the comments pre-date
# ignore-tkr days and haven't been updated.
if OMPI_BUILD_FORTRAN_USEMPI_TKR_BINDINGS
########################################################################
# This Makefile.am is quite complex and confusing. Part of the
# problem is that Libtool (v1.5.18) does not understand F90, so we
# have to do a few things manually (and no shared libraries). Here's a
# summary of what is happening:
#
# Depedencies / who generates whom:
#
# configure generates fortran_kinds.sh
# |
# \|/
# fortran_kinds.sh ----> sourced by scripts/* ----> generates mpi_*.f90
# | |
# \|/ |
# generates mpi-f90-interfaces.h |
# / |
# \/ |
# mpi-f90-interfaces.h |
# | |
# \|/ \|/
# used by mpi.f90 used by mpi_*.f90
# / | |
# / \|/ \|/
# / generates mpi.o generates mpi_*.o
# \/ \ /
# generates mpi module \/ \/
# (filename unknown) generates libmpi_f90.a
#
# Once you understand this diagram, this Makefile is much more clear.
#
AM_FCFLAGS = -I$(top_builddir)/ompi/include -I$(top_srcdir)/ompi/include \
$(OMPI_FC_MODULE_FLAG). -I$(srcdir) \
-I$(top_builddir)/ompi/mpi/fortran/use-mpi-tkr $(FCFLAGS_f90)
# Do different things if the top-level configure decided that we're
# going to build F90 bindings or not.
lib_LTLIBRARIES =
if OMPI_BUILD_FORTRAN_USEMPI_TKR_BINDINGS
# Add the f90 library to the list of libraries to build
lib_LTLIBRARIES += libmpi_usempi.la
# Ensure that the F90 interfaces are re-generated based on the values
# that come in from configure
mpi-f90-interfaces.h: fortran_kinds.sh
CLEANFILES += mpi-f90-interfaces.h
# Run scripts to generate the f90 source files. We only need to
# generate the .f90 files once, so the "test" checks to see if the
# file exists before running the script. However, the
# mpi-f90-interfaces.h file may need to be generated multiple times
# (even if it already exists), such as if someone re-runs configure
# and changes the value fortran_kinds.sh (which is taken care of by
# the mpi-f90-interfaces.h dependency on fortran_kinds.sh, above).
mpi-f90-interfaces.h: $(srcdir)/scripts/mpi-f90-interfaces.h.sh
@ p="`pwd`"; \
echo $(srcdir)/scripts/mpi-f90-interfaces.h.sh $$p \> $@; \
$(srcdir)/scripts/mpi-f90-interfaces.h.sh $$p > $@
# Unbelievably, some versions of sh (cough cough Solaris 9 cough
# cough) actually seem to internally perform a "cd" into a
# subdirectory when you run "./foo/bar", such that if you try to
# source a script in the top-level directory in the bar script (e.g.,
# ". some_script" in the bar script), it will try to run it in the
# "foo" subdirectory, rather than the top-level directory! #$@#$%#$%
# So we have to pass in the pwd to the scripts so that they know where
# some_script is.
$(nodist_libmpi_usempi_la_SOURCES): fortran_kinds.sh
@ p="`pwd`"; \
echo $(srcdir)/scripts/$@.sh $$p \> $@; \
$(srcdir)/scripts/$@.sh $$p > $@ ;
# Automake doesn't know how to do F90 dependency analysis, so manually
# list this here (i.e., "mpi-f90-interfaces.h" is included in
# mpi.f90).
# Print a warning indicating that compiling mpi.f90 can take a while.
# The only way to do this portably is to have our own rules for mpi.o
# and mpi.obj (having a "fake" target that just has echo statement in
# it may trigger mpi.o|obj to be rebuilt because the fake name doesn't
# exist; there aren't good portable ways to indicate that the target
# name is fake and should never exist).
# Note the "-I." in the commands below. This is because mpi.f90
# includes mpi-f90-interfaces.h, which will be in the build tree
# (i.e., the current directory) because it is generated.
mpi.o: mpi.f90 mpi-f90-interfaces.h
@echo "***************************************************************"
@echo "* Compiling the mpi.f90 file may take a few minutes."
@echo "* This is quite normal -- do not be alarmed if the compile"
@echo "* process seems to 'hang' at this point for several minutes."
@echo "***************************************************************"
$(FCCOMPILE) -c -I. -o $@ $(FCFLAGS_f90) $<
mpi.obj: mpi.f90 mpi-f90-interfaces.h
@echo "***************************************************************"
@echo "* Compiling the mpi.f90 file may take a few minutes."
@echo "* This is quite normal -- do not be alarmed if the compile"
@echo "* process seems to 'hang' at this point for several minutes."
@echo "***************************************************************"
$(FCCOMPILE) -c -I. -o $@ $(FCFLAGS_f90) `$(CYGPATH_W) '$<'`
BUILT_SOURCES = mpi-f90-interfaces.h
endif
# mpi.f90 is the only f90 source file directly in libmpif90 that gets
# distributed.
libmpi_usempi_la_SOURCES = \
attr_fn-f90-interfaces.h \
conversion_fn_null-f90-interface.h \
mpi.f90
libmpi_usempi_la_LIBADD = \
$(top_builddir)/ompi/mpi/fortran/mpif-h/libmpi_mpifh.la
# These files are all generated by scripts in the scripts/ directory.
nodist_libmpi_usempi_la_SOURCES = \
mpi_sizeof.f90 \
mpi_comm_spawn_multiple_f90.f90 \
mpi_testall_f90.f90 \
mpi_testsome_f90.f90 \
mpi_waitall_f90.f90 \
mpi_waitsome_f90.f90 \
mpi_wtick_f90.f90 \
mpi_wtime_f90.f90 \
mpi_address_f90.f90 \
mpi_accumulate_f90.f90 \
mpi_bcast_f90.f90 \
mpi_bsend_f90.f90 \
mpi_bsend_init_f90.f90 \
mpi_buffer_attach_f90.f90 \
mpi_buffer_detach_f90.f90 \
mpi_file_iread_f90.f90 \
mpi_file_iread_at_f90.f90 \
mpi_file_iread_shared_f90.f90 \
mpi_file_iwrite_f90.f90 \
mpi_file_iwrite_at_f90.f90 \
mpi_file_iwrite_shared_f90.f90 \
mpi_file_read_f90.f90 \
mpi_file_read_all_f90.f90 \
mpi_file_read_all_begin_f90.f90 \
mpi_file_read_all_end_f90.f90 \
mpi_file_read_at_f90.f90 \
mpi_file_read_at_all_f90.f90 \
mpi_file_read_at_all_begin_f90.f90 \
mpi_file_read_at_all_end_f90.f90 \
mpi_file_read_ordered_f90.f90 \
mpi_file_read_ordered_begin_f90.f90 \
mpi_file_read_ordered_end_f90.f90 \
mpi_file_read_shared_f90.f90 \
mpi_file_write_f90.f90 \
mpi_file_write_all_f90.f90 \
mpi_file_write_all_begin_f90.f90 \
mpi_file_write_all_end_f90.f90 \
mpi_file_write_at_f90.f90 \
mpi_file_write_at_all_f90.f90 \
mpi_file_write_at_all_begin_f90.f90 \
mpi_file_write_at_all_end_f90.f90 \
mpi_file_write_ordered_f90.f90 \
mpi_file_write_ordered_begin_f90.f90 \
mpi_file_write_ordered_end_f90.f90 \
mpi_file_write_shared_f90.f90 \
mpi_get_f90.f90 \
mpi_ibsend_f90.f90 \
mpi_improbe_f90.90 \
mpi_irecv_f90.f90 \
mpi_irsend_f90.f90 \
mpi_isend_f90.f90 \
mpi_issend_f90.f90 \
mpi_mprobe_f90.90 \
mpi_put_f90.f90 \
mpi_recv_f90.f90 \
mpi_recv_init_f90.f90 \
mpi_rsend_f90.f90 \
mpi_rsend_init_f90.f90 \
mpi_send_f90.f90 \
mpi_send_init_f90.f90 \
mpi_sendrecv_replace_f90.f90 \
mpi_ssend_f90.f90 \
mpi_ssend_init_f90.f90 \
mpi_win_create_f90.f90
# Set the library version
libmpi_usempi_la_LDFLAGS = \
-version-info $(libmpi_usempi_tkr_so_version) \
$(OMPI_FORTRAN_EXTRA_SHARED_LIBRARY_FLAGS)
#
# Clean up all F90 module files and all generated files
#
MOSTLYCLEANFILES = *.mod
DISTCLEANFILES = $(nodist_libmpi_usempi_la_SOURCES)
#
# Install the generated .mod files. Unfortunately, each F90 compiler
# may generate different filenames, so we have to use a glob. :-(
#
if OMPI_BUILD_FORTRAN_USEMPI_TKR_BINDINGS
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
# if OMPI_BUILD_FORTRAN_USEMPI_TKR_BINDINGS
endif