1
1

== 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.
This commit is contained in:
Jeff Squyres 2012-04-18 15:57:29 +00:00
parent 164eec380c
commit 253444c6d0
1186 changed files with 48284 additions and 13646 deletions

186
README
View File

@ -8,7 +8,7 @@ Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
University of Stuttgart. All rights reserved.
Copyright (c) 2004-2007 The Regents of the University of California.
All rights reserved.
Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
Copyright (c) 2006-2011 Mellanox Technologies. All rights reserved.
Copyright (c) 2006-2012 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2007 Myricom, Inc. All rights reserved.
@ -120,7 +120,7 @@ Compiler Notes
--------------
- Mixing compilers from different vendors when building Open MPI
(e.g., using the C/C++ compiler from one vendor and the F77/F90
(e.g., using the C/C++ compiler from one vendor and the Fortran
compiler from a different vendor) has been successfully employed by
some Open MPI users (discussed on the Open MPI user's mailing list),
but such configurations are not tested and not documented. For
@ -225,72 +225,85 @@ Compiler Notes
- Using the Absoft compiler to build the MPI Fortran bindings on Suse
9.3 is known to fail due to a Libtool compatibility issue.
- While it is possible -- on some platforms -- to configure and build
Open MPI with one Fortran compiler and then build MPI applications
with a different Fortran compiler, this is not recommended. Subtle
problems can arise at run time, even if the MPI application
compiled and linked successfully.
- MPI Fortran API support has been completely overhauled since the
Open MPI v1.5/v1.6 series.
Specifically, the following two cases may not be portable between
different Fortran compilers:
********************************************************************
********************************************************************
*** There is now only a single Fortran MPI wrapper compiler:
*** mpifort. mpif77 and mpif90 still exist, but they are symbolic
*** links to mpifort.
********************************************************************
*** Similarly, Open MPI's configure script only recongizes the FC
*** and FCFLAGS environment variables (to specify the Fortran
*** compiler and compiler flags, respectively). The F77 and FFLAGS
*** environment variables are IGNORED.
********************************************************************
********************************************************************
1. The C constants MPI_F_STATUS_IGNORE and MPI_F_STATUSES_IGNORE
will only compare properly to Fortran applications that were
created with Fortran compilers that that use the same
name-mangling scheme as the Fortran compiler with which Open MPI
was configured.
You can use ompi_info to see with which Fortran compiler Open MPI
was configured and compiled.
2. Fortran compilers may have different values for the logical
.TRUE. constant. As such, any MPI function that uses the Fortran
LOGICAL type may only get .TRUE. values back that correspond to
the the .TRUE. value of the Fortran compiler with which Open MPI
was configured. Note that some Fortran compilers allow forcing
.TRUE. to be 1 and .FALSE. to be 0. For example, the Portland
Group compilers provide the "-Munixlogical" option, and Intel
compilers (version >= 8.) provide the "-fpscomp logicals" option.
There are up to three sets of Fortran MPI bindings that may be
provided (depending on your Fortran compiler):
You can use the ompi_info command to see the Fortran compiler with
which Open MPI was configured.
- mpif.h: This is the first MPI Fortran interface that was defined
in MPI-1. It is a file that is included in Fortran source code.
Open MPI's mpif.h does not declare any MPI subroutines; they are
all implicit.
- The Fortran 90 MPI bindings can now be built in one of three sizes
using --with-mpi-f90-size=SIZE (see description below). These sizes
reflect the number of MPI functions included in the "mpi" Fortran 90
module and therefore which functions will be subject to strict type
checking. All functions not included in the Fortran 90 module can
still be invoked from F90 applications, but will fall back to
Fortran-77 style checking (i.e., little/none).
- mpi module: The mpi module file was added in MPI-2. It provides
strong compile-time parameter type checking for MPI subroutines.
- trivial: Only includes F90-specific functions from MPI-2. This
means overloaded versions of MPI_SIZEOF for all the MPI-supported
F90 intrinsic types.
- mpi_f08 module: The mpi_f08 module was added in MPI-3. It
provides many advantages over the mpif.h file and mpi module. For
example, MPI handles have distinct types (vs. all being integers).
See the MPI-3 document for more details.
- small (default): All the functions in "trivial" plus all MPI
functions that take no choice buffers (meaning buffers that are
specified by the user and are of type (void*) in the C bindings --
generally buffers specified for message passing). Hence,
functions like MPI_COMM_RANK are included, but functions like
MPI_SEND are not.
*** The mpi_f08 module is STRONGLY is recommended for all new MPI
Fortran subroutines and applications. Note that the mpi_f08
module can be used in conjunction with the other two Fortran
MPI bindings in the same application (only one binding can be
used per subroutine/function, however). Full interoperability
between mpif.h/mpi module and mpi_f08 module MPI handle types
is provided, allowing mpi_f08 to be used in new subroutines in
legacy MPI applications.
- medium: All the functions in "small" plus all MPI functions that
take one choice buffer (e.g., MPI_SEND, MPI_RECV, ...). All
one-choice-buffer functions have overloaded variants for each of
the MPI-supported Fortran intrinsic types up to the number of
dimensions specified by --with-f90-max-array-dim (default value is
4).
The following notes apply to the above-listed Fortran bindings:
Increasing the size of the F90 module (in order from trivial, small,
and medium) will generally increase the length of time required to
compile user MPI applications. Specifically, "trivial"- and
"small"-sized F90 modules generally allow user MPI applications to
be compiled fairly quickly but lose type safety for all MPI
functions with choice buffers. "medium"-sized F90 modules generally
take longer to compile user applications but provide greater type
safety for MPI functions.
- The mpi_f08 module is new and has been tested with the Intel
Fortran compiler. Other modern Fortran compilers may also work
(but are, as yet, currently untested). It is expected that this
support will mature over time.
Note that MPI functions with two choice buffers (e.g., MPI_GATHER)
are not currently included in Open MPI's F90 interface. Calls to
these functions will automatically fall through to Open MPI's F77
interface.
The gfortran compiler is *not* supported with the mpi_f08 module
(gfortran lacks some necessary modern Fortran features, sorry).
- All Fortran compilers support the mpif.h-based bindings.
- If Open MPI is built with a non-GNU Fortran compiler, all MPI
subroutines will be prototyped in the mpi module, meaning that all
calls to MPI subroutines will have their parameter types checked
at compile time.
- If Open MPI is built with a GNU Fortran compiler (gfortran), it
will compile a limited "mpi" module -- not all MPI subroutines
will be prototyped due to both poor design of the mpi module in
the MPI-2 specification and a lack of features in gfortran.
Specifically, all MPI subroutines with no "choice" buffers are
prototyped and will receive strong parameter type checking at
run-time (e.g., MPI_INIT, MPI_COMM_RANK, etc.).
MPI subroutines with one choice buffer (e.g., MPI_SEND) are
prototyped for all intrinsic Fortran types for scalars and ranks 1
through 4 (the --with-gfortran-max-array-dim configure switch can
be used to increase the max array rank supported to up to 7).
MPI subroutines with two choice buffers (e.g., MPI_GATHER) are
*not* prototyped. These subroutines can still be called in MPI
applications; they just will not receive strong parameter type
checking.
General Run-Time Support Notes
@ -1006,26 +1019,8 @@ MPI FUNCTIONALITY
disable the C++ checks during configure; some of Open MPI's tools
are written in C++ and therefore require a C++ compiler to be built.
--disable-mpi-f77
Disable building the Fortran 77 MPI bindings.
--disable-mpi-f90
Disable building the Fortran 90 MPI bindings. Also related to the
--with-f90-max-array-dim and --with-mpi-f90-size options.
--with-mpi-f90-size=<SIZE>
Three sizes of the MPI F90 module can be built: trivial (only a
handful of MPI-2 F90-specific functions are included in the F90
module), small (trivial + all MPI functions that take no choice
buffers), and medium (small + all MPI functions that take 1 choice
buffer). This parameter is only used if the F90 bindings are
enabled.
--with-f90-max-array-dim=<DIM>
The F90 MPI bindings are strictly typed, even including the number of
dimensions for arrays for MPI choice buffer parameters. Open MPI
generates these bindings at compile time with a maximum number of
dimensions as specified by this parameter. The default value is 4.
--disable-mpi-fortran
Disable building the Fortran MPI bindings.
--enable-mpi-ext(=<list>)
Enable Open MPI's non-portable API extensions. If no <list> is
@ -1085,8 +1080,7 @@ MPI FUNCTIONALITY
<cflags>: Flags passed by the mpicc wrapper to the C compiler
<cxxflags>: Flags passed by the mpic++ wrapper to the C++ compiler
<fflags>: Flags passed by the mpif77 wrapper to the F77 compiler
<fcflags>: Flags passed by the mpif90 wrapper to the F90 compiler
<fcflags>: Flags passed by the mpifort wrapper to the Fortran compiler
<ldflags>: Flags passed by all the wrappers to the linker
<libs>: Flags passed by all the wrappers to the linker
@ -1108,11 +1102,8 @@ CXX - C++ compiler to use
CXXFLAGS - Compile flags to pass to the C++ compiler
CXXCPPFLAGS - Preprocessor flags to pass to the C++ compiler
F77 - Fortran 77 compiler to use
FFLAGS - Compile flags to pass to the Fortran 77 compiler
FC - Fortran 90 compiler to use
FCFLAGS - Compile flags to pass to the Fortran 90 compiler
FC - Fortran compiler to use
FCFLAGS - Compile flags to pass to the Fortran compiler
LDFLAGS - Linker flags to pass to all compilers
LIBS - Libraries to pass to all compilers (it is rarely
@ -1122,7 +1113,7 @@ PKG_CONFIG - Path to the pkg-config utility
For example:
shell$ ./configure CC=mycc CXX=myc++ F77=myf77 F90=myf90 ...
shell$ ./configure CC=mycc CXX=myc++ FC=myfortran ...
***Note: We generally suggest using the above command line form for
setting different compilers (vs. setting environment variables and
@ -1146,11 +1137,11 @@ Note that you may also want to ensure that the value of
LD_LIBRARY_PATH is set appropriately (or not at all) for your build
(or whatever environment variable is relevant for your operating
system). For example, some users have been tripped up by setting to
use non-default Fortran compilers via FC / F77, but then failing to
set LD_LIBRARY_PATH to include the directory containing that
non-default Fortran compiler's support libraries. This causes Open
MPI's configure script to fail when it tries to compile / link / run
simple Fortran programs.
use a non-default Fortran compiler via FC, but then failing to set
LD_LIBRARY_PATH to include the directory containing that non-default
Fortran compiler's support libraries. This causes Open MPI's
configure script to fail when it tries to compile / link / run simple
Fortran programs.
It is required that the compilers specified be compile and link
compatible, meaning that object files created by one compiler must be
@ -1335,8 +1326,10 @@ Here's how we apply those rules specifically to Open MPI:
applications.
* libmpi
* libmpi_f77
* libmpi_f90
* libmpi_mpifh
* libmpi_usempi_tkr
* libmpi_usempi_ignore_tkr
* libmpi_usempif08
* libmpi_cxx
4. Note, however, that libmpi.so can have its "revision" number
@ -1532,8 +1525,7 @@ compiling MPI applications:
C: mpicc
C++: mpiCC (or mpic++ if your filesystem is case-insensitive)
Fortran 77: mpif77
Fortran 90: mpif90
Fortran: mpifort
For example:
@ -1568,9 +1560,7 @@ ompi Synonym for "ompi-c"; Open MPI applications using the C
MPI bindings
ompi-c Open MPI applications using the C MPI bindings
ompi-cxx Open MPI applications using the C or C++ MPI bindings
ompi-f77 Open MPI applications using the C or "mpif.h" MPI bindings
ompi-f90 Open MPI applications using the C, "mpif.h" or "use mpi" MPI
bindings
ompi-fort Open MPI applications using the Fortran MPI bindings
------------------------------------------------------------------------
The following pkg-config(1) configuration files *may* be installed,

View File

@ -21,7 +21,7 @@ release=0
# only requirement is that it must be entirely printable ASCII
# characters and have no white space.
greek=a1
greek=mpif08-6
# If want_repo_rev=1, then the repo revision number will be included
# in the overall Open MPI version number in some form.
@ -90,8 +90,9 @@ date="Unreleased developer copy"
libmpi_so_version=0:0:0
libmpi_cxx_so_version=0:0:0
libmpi_f77_so_version=0:0:0
libmpi_f90_so_version=0:0:0
libmpi_mpifh_so_version=0:0:0
libmpi_usempi_tkr_so_version=0:0:0
libmpi_usempi_ignore_tkr_so_version=0:0:0
libopen_rte_so_version=0:0:0
libopen_pal_so_version=0:0:0
libmpi_java_so_version=0:0:0

View File

@ -804,6 +804,7 @@ GNU tools:
##############################################################################
sub safe_system {
print "Running: " . join(/ /, @_) . "\n";
my $ret = system(@_);
$ret >>= 8;
if (0 != $ret) {
@ -1088,6 +1089,27 @@ if ($include_arg) {
#---------------------------------------------------------------------------
++$step;
verbose "\n$step. Running template-generating scripts\n\n";
# These scripts generate files that are used by configure (i.e., we
# generate one .h.in file from another .h.in file so that humans don't
# have to maintain two copies).
my @scripts;
push(@scripts, "ompi/include/mpif-common.pl");
foreach my $s (@scripts) {
verbose "=== $s\n";
if (! -x $s) {
print "Cannot find executable $s!\nAborting.\n";
my_exit(1);
}
system($s);
}
#---------------------------------------------------------------------------
# Find projects, frameworks, components
++$step;
verbose "\n$step. Searching for projects, MCA frameworks, and MCA components\n";

View File

@ -5,7 +5,7 @@ dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2006 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -47,7 +47,7 @@ AC_DEFUN([OMPI_CHECK_COMPILER_WORKS],
* but a problem with the local compiler installation. More
* information (including exactly what command was given to the
* compiler and what error resulted when the command was executed) is
* available in the config.log file in this directory.
* available in the config.log file in the Open MPI build directory.
**********************************************************************
EOF
$5], [$4])

View File

@ -9,6 +9,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -46,12 +47,12 @@ AC_DEFUN([OMPI_INTL_PTHREAD_TRY_LINK], [
])dnl
AC_DEFUN([OMPI_INTL_PTHREAD_TRY_LINK_F77], [
# BEGIN: OMPI_INTL_PTHREAD_TRY_LINK_F77
AC_DEFUN([OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN], [
# BEGIN: OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN
#
# Make sure that we can run a small application in Fortran, with
# pthreads living in a C object file
OMPI_F77_MAKE_C_FUNCTION([ompi_ac_thread_fn], [pthreadtest])
OMPI_FORTRAN_MAKE_C_FUNCTION([ompi_ac_thread_fn], [pthreadtest])
# Fortran module
cat > conftestf.f <<EOF
@ -94,7 +95,7 @@ EOF
OPAL_LOG_COMMAND(
[$CC $CFLAGS -I. -c conftest.c],
OPAL_LOG_COMMAND(
[$F77 $FFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
[$FC $FCFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
[HAPPY=1],
[HAPPY=0]),
[HAPPY=0])
@ -115,7 +116,7 @@ fi
unset HAPPY ompi_conftest_h
rm -rf conftest*
# END: OMPI_INTL_PTHREAD_TRY_LINK_F77
# END: OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN
])dnl
@ -224,8 +225,8 @@ AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_FC], [
#
# Fortran compiler
#
if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; then
AC_MSG_CHECKING([if F77 compiler and POSIX threads work as is])
if test "$ompi_pthread_fortran_success" = "0" -a "$OMPI_WANT_FORTRAN_BINDINGS" = "1"; then
AC_MSG_CHECKING([if Fortran compiler and POSIX threads work as is])
if test "$HAVE_POSIX_THREADS" = "1" ; then
run_this_test=1
else
@ -242,10 +243,10 @@ if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; th
if test "$run_this_test" = "1" ; then
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
ompi_pthread_f77_success=0)
OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN(ompi_pthread_fortran_success=1,
ompi_pthread_fortran_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_f77_success" = "1"; then
if test "$ompi_pthread_fortran_success" = "1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
@ -274,9 +275,9 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
[OMPI_INTL_POSIX_THREADS_PLAIN_CXX],
[ompi_pthread_cxx_success=1])
AC_PROVIDE_IFELSE([AC_PROG_F77],
AC_PROVIDE_IFELSE([AC_PROG_FC],
[OMPI_INTL_POSIX_THREADS_PLAIN_FC],
[ompi_pthread_f77_success=1])
[ompi_pthread_fortran_success=1])
# End: OMPI_INTL_POSIX_THREADS_PLAIN
])dnl
@ -343,15 +344,15 @@ AC_DEFUN([OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC], [
#
# Fortran compiler
#
if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; then
if test "$ompi_pthread_fortran_success" = "0" -a "$OMPI_WANT_FORTRAN_BINDINGS" = "1"; then
for pf in $pflags; do
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $pf])
AC_MSG_CHECKING([if Fortran compiler and POSIX threads work with $pf])
FFLAGS="$orig_FFLAGS $pf"
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
ompi_pthread_f77_success=0)
OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN(ompi_pthread_fortran_success=1,
ompi_pthread_fortran_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_f77_success" = "1"; then
if test "$ompi_pthread_fortran_success" = "1"; then
PTHREAD_FFLAGS="$pf"
AC_MSG_RESULT([yes])
break
@ -400,9 +401,9 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_CXX],
[ompi_pthread_cxx_success=1])
AC_PROVIDE_IFELSE([AC_PROG_F77],
AC_PROVIDE_IFELSE([AC_PROG_FC],
[OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS_FC],
[ompi_pthread_f77_success=1])
[ompi_pthread_fortran_success=1])
# End: OMPI_INTL_POSIX_THREADS_SPECIAL_FLAGS
])dnl
@ -528,15 +529,15 @@ AC_DEFUN([OMPI_INTL_POSIX_THREADS_LIBS_FC],[
#
# Fortran compiler
#
if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; then
if test "$ompi_pthread_fortran_success" = "0" -a "$OMPI_WANT_FORTRAN_BINDINGS" = "1"; then
if test ! "$ompi_pthread_c_success" = "0" -a ! "$PTHREAD_LIBS" = "" ; then
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $PTHREAD_LIBS])
AC_MSG_CHECKING([if Fortran compiler and POSIX threads work with $PTHREAD_LIBS])
LIBS="$orig_LIBS $PTHREAD_LIBS"
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
ompi_pthread_f77_success=0)
OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN(ompi_pthread_fortran_success=1,
ompi_pthread_fortran_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_f77_success" = "1"; then
if test "$ompi_pthread_fortran_success" = "1"; then
AC_MSG_RESULT([yes])
else
LIBS="$orig_LIBS"
@ -545,13 +546,13 @@ if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; th
fi
else
for pl in $plibs; do
AC_MSG_CHECKING([if F77 compiler and POSIX threads work with $pl])
AC_MSG_CHECKING([if Fortran compiler and POSIX threads work with $pl])
LIBS="$orig_LIBS $pl"
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
ompi_pthread_f77_success=0)
OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN(ompi_pthread_fortran_success=1,
ompi_pthread_fortran_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_f77_success" = "1"; then
if test "$ompi_pthread_fortran_success" = "1"; then
PTHREAD_LIBS="$pl"
AC_MSG_RESULT([yes])
break
@ -587,9 +588,9 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
[OMPI_INTL_POSIX_THREADS_LIBS_CXX],
[ompi_pthread_cxx_success=1])
AC_PROVIDE_IFELSE([AC_PROG_F77],
AC_PROVIDE_IFELSE([AC_PROG_FC],
[OMPI_INTL_POSIX_THREADS_LIBS_FC],
[ompi_pthread_f77_success=1])
[ompi_pthread_fortran_success=1])
# End: OMPI_INTL_POSIX_THREADS_LIBS]
)dnl
@ -604,7 +605,7 @@ AC_DEFUN([OMPI_CONFIG_POSIX_THREADS],[
AC_REQUIRE([AC_PROG_GREP])
ompi_pthread_c_success=0
ompi_pthread_f77_success=0
ompi_pthread_fortran_success=0
ompi_pthread_cxx_success=0
orig_CFLAGS="$CFLAGS"
@ -667,13 +668,13 @@ CXXCPPFLAGS="$orig_CXXCPPFLAGS"
LDFLAGS="$orig_LDFLAGS"
LIBS="$orig_LIBS"
if test "$OMPI_WANT_F77_BINDINGS" != "1"; then
ompi_pthread_f77_success=1
if test "$OMPI_WANT_FORTRAN_BINDINGS" != "1"; then
ompi_pthread_fortran_success=1
fi
if test "$ompi_pthread_c_success" = "1" -a \
"$ompi_pthread_cxx_success" = "1" -a \
"$ompi_pthread_f77_success" = "1"; then
"$ompi_pthread_fortran_success" = "1"; then
internal_useless=1
$1
else
@ -681,6 +682,6 @@ else
$2
fi
unset ompi_pthread_c_success ompi_pthread_f77_success ompi_pthread_cxx_success
unset ompi_pthread_c_success ompi_pthread_fortran_success ompi_pthread_cxx_success
unset internal_useless
])dnl

View File

@ -3,7 +3,7 @@ dnl
dnl Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2011-2012 Oak Ridge National Labs. All rights reserved.
dnl $COPYRIGHT$
dnl
@ -68,15 +68,7 @@ AC_DEFUN([OMPI_EXT],[
m4_ifdef([ompi_mpiext_list], [],
[m4_fatal([Could not find MPI Extensions list. Aborting.])])
EXT_NO_CONFIG_CONFIG_FILES()
EXT_CONFIGURE()
AC_SUBST(EXT_C_HEADERS)
AC_SUBST(EXT_F77_HEADERS)
AC_SUBST(EXT_F90_HEADERS)
AC_SUBST(EXT_C_LIBS)
AC_SUBST(EXT_F77_LIBS)
AC_SUBST(EXT_F90_LIBS)
EXT_CONFIGURE
])
@ -89,12 +81,6 @@ AC_DEFUN([OMPI_EXT],[
#
######################################################################
AC_DEFUN([EXT_CONFIGURE],[
OPAL_VAR_SCOPE_PUSH([all_components outfile outfile_real])
all_components=
static_components=
static_ltlibs=
outdir=ompi/include
# first create the output include directory
@ -125,9 +111,8 @@ extern "C" {
EOF
###############
# F77 Bindings
# mpif.h Bindings
###############
# remove any previously generated #include files
@ -138,29 +123,44 @@ EOF
cat > $mpif_ext_h <<EOF
! -*- fortran -*-
! \$HEADER\$
!
! *** THIS FILE IS AUTOMATICALLY GENERATED!
! *** Any manual edits will be lost!
!
integer OMPI_HAVE_MPI_EXT
parameter (OMPI_HAVE_MPI_EXT=1)
!
EOF
###############
# "use mpi" Bindings
###############
###############
# F90 Bindings
###############
# Although Fortran module files are essentially compiled header
# files, we don't create them in ompi/include, like we do for
# mpi.h and mpif.h. Instead, we build them down in ompi/fortran,
# when we build the rest of the Fortran modules. Indeed, in the
# "use mpi" case, it needs some of the same internal modules that
# the mpi_f08 module itself needs. So the mpi_f08_ext module has
# to be built *after* the mpi_f08 module (so that all the internal
# modules it needs are already built).
# remove any previously generated #include files
mpif90_ext_h=$outdir/mpif90-ext.f90
rm -f $mpif90_ext_h
outdir=ompi/mpi/fortran/mpiext
mkdir -p $outdir
mpiusempi_ext_h=$outdir/mpi-ext-module.F90
rm -f $mpiusempi_ext_h
# Create the final mpif90-ext.h file.
cat > $mpif90_ext_h <<EOF
# Create the final mpiusempi-ext.h file.
cat > $mpiusempi_ext_h <<EOF
! -*- fortran -*-
! \$HEADER\$
!
! *** THIS FILE IS AUTOMATICALLY GENERATED!
! *** Any manual edits will be lost!
!
module mpi_ext
! Eventhough this is not a useful parameter (cannot be used as a
! Even though this is not a useful parameter (cannot be used as a
! preprocessor catch) define it to keep the linker from complaining
! during the build.
integer OMPI_HAVE_MPI_EXT
@ -168,6 +168,59 @@ module mpi_ext
!
EOF
# Make an AM conditional to see whether we're building the mpi_ext
# module. Note that we only build it if we support the ignore-tkr
# mpi module.
AS_IF([test $OMPI_BUILD_FORTRAN_USEMPI_BINDINGS -eq 1 -a \
$OMPI_FORTRAN_HAVE_IGNORE_TKR -eq 1],
[OMPI_BUILD_FORTRAN_USEMPI_EXT=1],
[OMPI_BUILD_FORTRAN_USEMPI_EXT=0])
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_USEMPI_EXT,
[test $OMPI_BUILD_FORTRAN_USEMPI_EXT -eq 1])
###############
# "use mpi_f08" Bindings
###############
# See note above: we generate the mpi_f08_ext module in
# ompi/mpi/fortran/mpiext
# remove any previously generated #include files
mpiusempif08_ext_h=$outdir/mpi-f08-ext-module.F90
rm -f $mpiusempif08_ext_h
# Create the final mpiusempi-ext.h file.
cat > $mpiusempif08_ext_h <<EOF
! -*- fortran -*-
! \$HEADER\$
!
! *** THIS FILE IS AUTOMATICALLY GENERATED!
! *** Any manual edits will be lost!
!
module mpi_f08_ext
! Even though this is not a useful parameter (cannot be used as a
! preprocessor catch) define it to keep the linker from complaining
! during the build.
integer OMPI_HAVE_MPI_EXT
parameter (OMPI_HAVE_MPI_EXT=1)
!
EOF
# Only build this mpi_f08_ext module if we're building the "use
# mpi_f08" module *and* it's the non-descriptor one.
AS_IF([test $OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1 -a \
$OMPI_BUILD_FORTRAN_F08_SUBARRAYS -eq 0],
[OMPI_BUILD_FORTRAN_USEMPIF08_EXT=1],
[OMPI_BUILD_FORTRAN_USEMPIF08_EXT=0])
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_USEMPIF08_EXT,
[test $OMPI_BUILD_FORTRAN_USEMPIF08_EXT -eq 1])
# Make an AM conditional to see whether we're building either the
# mpi_ext or mpi_f08_Ext modules.
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_USEMPI_OR_USEMPIF08_EXT,
[test $OMPI_BUILD_FORTRAN_USEMPI_EXT -eq 1 -o \
$OMPI_BUILD_FORTRAN_USEMPIF08_EXT -eq 1])
#
# Process each component
#
@ -182,9 +235,11 @@ EOF
m4_foreach(extension, [ompi_mpiext_list],
[m4_ifval(extension,
[EXT_CONFIGURE_M4_CONFIG_COMPONENT(extension,
[all_components],
[static_components],
[static_ltlibs])])])
[OMPI_MPIEXT_ALL],
[OMPI_MPIEXT_C],
[OMPI_MPIEXT_MPIFH],
[OMPI_MPIEXT_USEMPI],
[OMPI_MPIEXT_USEMPIF08])])])
###############
# C Bindings
@ -201,7 +256,7 @@ EOF
EOF
###############
# F77 Bindings
# mpif.h Bindings
###############
# Create the final mpif-ext.h file.
cat >> $mpif_ext_h <<EOF
@ -209,14 +264,22 @@ EOF
EOF
###############
# F90 Bindings
# "use mpi" Bindings
###############
# Create the final mpif90-ext.h file.
cat >> $mpif90_ext_h <<EOF
# Create the final mpiusempi-ext.h file.
cat >> $mpiusempi_ext_h <<EOF
!
end module mpi_ext
EOF
###############
# "use mpi_f08" Bindings
###############
# Create the final mpiusempi-ext.h file.
cat >> $mpiusempif08_ext_h <<EOF
!
end module mpi_f08_ext
EOF
# Create the final .h file that will be included in the type's
# top-level glue. This lists all the static components. We don't
@ -256,16 +319,19 @@ EOF
fi
rm -f $outfile.struct $outfile.extern
OMPI_EXT_MAKE_DIR_LIST(OMPI_MPIEXT_ALL_SUBDIRS, [$all_components])
OMPI_EXT_MAKE_DIR_LIST(OMPI_MPIEXT_SUBDIRS, [$static_components])
# We have all the results we need. Now put them in various
# variables/defines so that others can see the results.
comps=`echo $static_components | sed -e 's/^[ \t]*//;s/[ \t]*$//;s/ /, /g'`
AC_DEFINE_UNQUOTED([OMPI_MPIEXT_COMPONENTS], ["$comps"], [MPI Extensions included in libmpi])
OMPI_EXT_MAKE_DIR_LIST(OMPI_MPIEXT_ALL_SUBDIRS, $OMPI_MPIEXT_ALL)
OMPI_MPIEXT_LIBS="${static_ltlibs}"
AC_SUBST(OMPI_MPIEXT_LIBS)
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_C, $OMPI_MPIEXT_C, c, c)
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_MPIFH, $OMPI_MPIEXT_MPIFH, mpif-h, mpifh)
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_USEMPI, $OMPI_MPIEXT_USEMPI, use-mpi, usempi)
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_USEMPIF08, $OMPI_MPIEXT_USEMPIF08, use-mpi-f08, usempif08)
OPAL_VAR_SCOPE_POP
comps=`echo $OMPI_MPIEXT_C | sed -e 's/^[ \t]*//;s/[ \t]*$//;s/ /, /g'`
AC_DEFINE_UNQUOTED([OMPI_MPIEXT_COMPONENTS], ["$comps"],
[MPI Extensions included in libmpi])
])
@ -275,10 +341,17 @@ EOF
#
#
# USAGE:
# EXT_CONFIGURE_PROJECT(component_name
# all_components_variable,
# static_components_variable,
# static_ltlibs_variable)
# EXT_CONFIGURE_M4_CONFIG_COMPONENT((1) component_name,
# (2) all_components_variable,
# (3) c_components_variable,
# (4) mpifh_components_variable,
# (5) usempi_components_variable,
# (6) usempif08_components_variable)
#
# - component_name is a single, naked string (no prefix)
# - all others are naked component names (e.g., "example"). If an
# extension is named in that variable, it means that that extension
# has bindings of that flavor.
#
######################################################################
AC_DEFUN([EXT_CONFIGURE_M4_CONFIG_COMPONENT],[
@ -291,16 +364,11 @@ AC_DEFUN([EXT_CONFIGURE_M4_CONFIG_COMPONENT],[
m4_ifdef([OMPI_MPIEXT_$1_CONFIG], [],
[m4_fatal([Could not find OMPI_MPIEXT_]$1[_CONFIG macro for ]$1[ component])])
OMPI_MPIEXT_$1_CONFIG([should_build=${should_build}],
[should_build=0])
OMPI_MPIEXT_$1_CONFIG([should_build=${should_build}], [should_build=0])
AS_IF([test "$should_build" = "1"],
[EXT_PROCESS_COMPONENT($1, $2, $4)
# add component to static component list
$3="$$3 $1" ],
[EXT_PROCESS_DEAD_COMPONENT($1)
# add component to all component list
$2="$$2 $1"])
AS_IF([test $should_build -eq 1],
[EXT_PROCESS_COMPONENT([$1], [$2], [$3], [$4], [$5], [$6])],
[EXT_PROCESS_DEAD_COMPONENT([$1], [$2])])
])
######################################################################
@ -311,23 +379,63 @@ AC_DEFUN([EXT_CONFIGURE_M4_CONFIG_COMPONENT],[
# calling that this component can build properly (and exists)
#
# USAGE:
# EXT_CONFIGURE_ALL_CONFIG_COMPONENTS(component_name
# all_components_variable (2),
# static_ltlibs_variable (3),
# compile_mode_variable (4))
# EXT_CONFIGURE_ALL_CONFIG_COMPONENTS((1) component_name
# (2) all_components_variable,
# (3) c_components_variable,
# (4) mpifh_components_variable,
# (5) usempi_components_variable,
# (6) usempif08_components_variable)
#
# NOTE: component_name may not be determined until runtime....
# C bindings are mandatory. Other bindings are optional / built if
# they are found. Here's the files that the m4 expects:
#
#--------------------
#
# C:
# - c/mpiext_<component>_c.h: is included in mpi_ext.h
# - c/libmpiext_<component>.la: convneience library slurped into libmpi.la
#
# mpi.f.h:
# - mpif-h/mpiext_<component>_mpifh.h: is included mpi mpif_ext.h
# - mpif-h/libmpiext_<component>_mpifh.la: convenience library slurped
# into libmpi_mpifh.la
#
# If the ..._mpifh.h file exists, it is assumed that "make all" will
# build the .la file. And therefore we'll include full support for
# the mpif.h bindings for this extension in OMPI.
#
#--------------------
#
# use mpi:
# - use-mpi/mpiext_<component>_usempi.h: included in the mpi_ext module
#
# Only supported when the ignore-tkr mpi module is built (this
# currently means: when you don't use gfortran).
#
# If the ..._usempi.h file exists, it is assumed that we'll include
# full support for the mpi_ext bindings for this extension in OMPI.
#
# NO LIBRARY IS SUPPORTED FOR THE mpi MODULE BINDINGS! It is assumed
# that all required symbols will be in the
# libmpiext_<component>_mpifh.la library, and all that this set of
# bindings does it give strong type checking to those subroutines.
#
#--------------------
#
# use mpi_f08:
# - use-mpi-f08/mpiext_<component>_usempif08.h: included in the mpi_ext module
# - use-mpi-f08/libmpiext_<component>_usempif08.la: convenience
# library slurped into libmpi_usempif08.la
#
# Only supported when the non-descriptor-based mpi_f08 module is built
# (this currently means: when you don't use gfortran).
#
# If the ..._usempif08.h file exists, it is assumed that "make all"
# will build the .la file. And therefore we'll include full support
# for the mpi_f08 bindings for this extension in OMPI.
#
# M4 directive to disable language support in configure.m4
# Need to build a list of .la for each lang. to pull into final library
# List ext_c_headers, ext_c_libs {same for other lang.}
# C: framework_component_c{.h, .la}
# F77: framework_component_f77{.h, .la}
# F90: framework_component_f90{.h, .la} ???
######################################################################
AC_DEFUN([EXT_PROCESS_COMPONENT],[
AC_REQUIRE([AC_PROG_GREP])
component=$1
# Output pretty results
@ -340,67 +448,57 @@ AC_DEFUN([EXT_PROCESS_COMPONENT],[
###############
# C Bindings
###############
test_header="${srcdir}/ompi/mpiext/$component/mpiext_${component}_c.h"
test_header="${srcdir}/ompi/mpiext/$component/c/mpiext_${component}_c.h"
AC_MSG_CHECKING([if MPI Extension $component has C bindings])
AC_MSG_CHECKING([if MPI Extension $component has C bindings])
if test -e "$test_header" ; then
AC_MSG_RESULT([yes])
AS_IF([test ! -e "$test_header"],
[ # There *must* be C bindings
AC_MSG_RESULT([no])
AC_MSG_WARN([C bindings for MPI extensions are required])
AC_MSG_ERROR([Cannot continue])])
# Save the list of headers and convenience libraries that this component will output
EXT_C_HEADERS="$EXT_C_HEADERS mpiext/$component/mpiext_${component}_c.h"
EXT_C_LIBS="$EXT_C_LIBS mpiext/$component/libext_mpiext_${component}.la"
$3="mpiext/${component}/libext_mpiext_${component}.la $$3"
AC_MSG_RESULT([yes (required)])
component_header="mpiext_${component}_c.h"
# Save the list of headers and convenience libraries that this
# component will output
thisdir="mpiext/$component"
$2="$$2 $thisdir"
$3="$$3 $component"
cat >> $mpi_ext_h <<EOF
# JMS Where is this needed?
EXT_C_HEADERS="$EXT_C_HEADERS mpiext/$component/c/mpiext_${component}_c.h"
component_header="mpiext_${component}_c.h"
cat >> $mpi_ext_h <<EOF
/* Enabled Extension: $component */
#define $component_define 1
#include "openmpi/ompi/mpiext/$component/$component_header"
#include "openmpi/ompi/mpiext/$component/c/$component_header"
EOF
#
# Profiling interface
#
test_header="${srcdir}/ompi/mpiext/$component/c/profile/defines.h"
AC_MSG_CHECKING([if MPI Extension $component has C bindings for profiling])
if test -e "$test_header" ; then
AC_MSG_RESULT([yes])
# Save the list of headers and convenience libraries that this component will output
$3="mpiext/${component}/c/profile/libext_pmpiext_c_${component}.la $$3"
else
AC_MSG_RESULT([no])
fi
else
# There *must* be C bindings
AC_MSG_RESULT([no])
AC_MSG_WARN([C Bindings are required])
AC_MSG_ERROR([Cannot continue])
fi
###############
# F77 Bindings
# mpif.h bindings
###############
#
# Test if this extension has f77 bindings
# Test if this extension has mpif.h bindings
# If not, skip this step.
#
test_header="${srcdir}/ompi/mpiext/$component/mpiext_${component}_f77.h"
enabled_f77=0
test_header="${srcdir}/ompi/mpiext/$component/mpif-h/mpiext_${component}_mpifh.h"
enabled_mpifh=0
AC_MSG_CHECKING([if MPI Extension $component has F77 bindings])
AC_MSG_CHECKING([if MPI Extension $component has mpif.h bindings])
if test -e "$test_header" ; then
AC_MSG_RESULT([yes])
enabled_f77=1
enabled_mpifh=1
EXT_F77_HEADERS="$EXT_F77_HEADERS mpiext/$component/mpiext_${component}_f77.h"
EXT_F77_LIBS="$EXT_F77_LIBS mpiext/$component/libext_mpiext_${component}_f77.la"
$3="$$3 mpiext/${component}/libext_mpiext_${component}_f77.la"
# JMS Where is this needed?
EXT_MPIFH_HEADERS="$EXT_MPIFH_HEADERS mpiext/$component/mpif-h/mpiext_${component}_mpifh.h"
$4="$$4 $component"
component_header="mpiext_${component}_f77.h"
component_header="mpiext_${component}_mpifh.h"
cat >> $mpif_ext_h <<EOF
!
@ -409,92 +507,130 @@ EOF
integer $component_define
parameter ($component_define=1)
include 'openmpi/ompi/mpiext/$component/$component_header'
include 'openmpi/ompi/mpiext/$component/mpif-h/$component_header'
EOF
#
# Profiling interface
#
test_header="${srcdir}/ompi/mpiext/$component/f77/profile/defines.h"
AC_MSG_CHECKING([if MPI Extension $component has F77 bindings for profiling])
if test -e "$test_header" ; then
AC_MSG_RESULT([yes])
# Save the list of headers and convenience libraries that this component will output
$3="mpiext/${component}/f77/profile/libext_pmpiext_f77_${component}.la $$3"
else
AC_MSG_RESULT([no])
fi
else
AC_MSG_RESULT([no])
cat >> $mpif_ext_h <<EOF
!
! Enabled Extension: $component
! No F77 Bindings available
! No mpif.h bindings available
!
integer $component_define
parameter ($component_define=0)
EOF
fi
###############
# F90 Bindings
# "use mpi" bindings
###############
#
# Test if this extension has f90 bindings
# Test if this extension has "use mpi" bindings
# If not, skip this step.
#
test_header="${srcdir}/ompi/mpiext/$component/mpiext_${component}_f90.h"
test_header="${srcdir}/ompi/mpiext/$component/use-mpi/mpiext_${component}_usempi.h"
AC_MSG_CHECKING([if MPI Extension $component has F90 bindings])
AC_MSG_CHECKING([if MPI Extension $component has "use mpi" bindings])
if test -e "$test_header" ; then
AC_MSG_RESULT([yes])
EXT_F90_HEADERS="$EXT_F90_HEADERS mpiext/$component/mpiext_${component}_f90.h"
#EXT_F90_LIBS="$EXT_F90_LIBS mpiext/$component/libext_mpiext_${component}_f90.la"
#$3="$$3 mpiext/${component}/libext_mpiext_${component}_f90.la"
# JMS Where is this needed?
EXT_USEMPI_HEADERS="$EXT_USEMPI_HEADERS mpiext/$component/use-mpi/mpiext_${component}_usempi.h"
$5="$$5 $component"
component_header="mpiext_${component}_usempi.h"
component_header="mpiext_${component}_f90.h"
cat >> $mpif90_ext_h <<EOF
cat >> $mpiusempi_ext_h <<EOF
!
! Enabled Extension: $component
!
EOF
#
# Include the f77 header if it is available
# Cannot do this from inside the f90.h since, for VPATH builds,
# the top_ompi_srcdir is needed to find the header.
# Include the mpif.h header if it is available. Cannot do
# this from inside the usempi.h since, for VPATH builds, the
# top_ompi_srcdir is needed to find the header.
#
if test "$enabled_f77" = 1; then
f77_component_header="mpiext_${component}_f77.h"
cat >> $mpif90_ext_h <<EOF
include '$top_ompi_srcdir/ompi/mpiext/$component/$f77_component_header'
if test "$enabled_mpifh" = 1; then
mpifh_component_header="mpiext_${component}_mpifh.h"
cat >> $mpiusempi_ext_h <<EOF
include '$top_ompi_srcdir/ompi/mpiext/$component/mpif-h/$mpifh_component_header'
EOF
fi
cat >> $mpif90_ext_h <<EOF
include '$top_ompi_srcdir/ompi/mpiext/$component/$component_header'
cat >> $mpiusempi_ext_h <<EOF
include '$top_ompi_srcdir/ompi/mpiext/$component/use-mpi/$component_header'
EOF
else
AC_MSG_RESULT([no])
cat >> $mpif90_ext_h <<EOF
cat >> $mpiusempi_ext_h <<EOF
!
! Enabled Extension: $component
! No F90 Bindings available
! No "use mpi" bindings available
!
EOF
fi
###############
# "use mpi_f08" bindings
###############
#
# Test if this extension has "use mpi_f08" bindings
# If not, skip this step.
#
test_header="${srcdir}/ompi/mpiext/$component/use-mpi-f08/mpiext_${component}_usempif08.h"
# Add this subdir to the mast list of all EXT component subdirs
AC_MSG_CHECKING([if MPI Extension $component has "use mpi_f08" bindings])
if test -e "$test_header" ; then
AC_MSG_RESULT([yes])
# JMS Where is this needed?
EXT_USEMPIF08_HEADERS="$EXT_USEMPIF08_HEADERS mpiext/$component/use-mpi-f08/mpiext_${component}_usempif08.h"
$6="$$6 $component"
component_header="mpiext_${component}_usempif08.h"
cat >> $mpiusempif08_ext_h <<EOF
!
! Enabled Extension: $component
!
EOF
#
# Include the mpif.h header if it is available. Cannot do
# this from inside the usempif08.h since, for VPATH builds,
# the top_ompi_srcdir is needed to find the header.
#
if test "$enabled_mpifh" = 1; then
mpifh_component_header="mpiext_${component}_mpifh.h"
cat >> $mpiusempif08_ext_h <<EOF
include '$top_ompi_srcdir/ompi/mpiext/$component/mpif-h/$mpifh_component_header'
EOF
fi
cat >> $mpiusempif08_ext_h <<EOF
include '$top_ompi_srcdir/ompi/mpiext/$component/use-mpi-f08/$component_header'
EOF
else
AC_MSG_RESULT([no])
cat >> $mpiusempif08_ext_h <<EOF
!
! Enabled Extension: $component
! No "use mpi_f08" bindings available
!
EOF
fi
# Add this component name to the master list of all EXT component
# subdirs
$2="$$2 ${component}"
m4_ifdef([OMPI_MPIEXT_]$1[_NEED_INIT],
@ -526,13 +662,19 @@ EOF
# to make sure the user isn't doing something stupid.
#
# USAGE:
# EXT_PROCESS_DEAD_COMPONENT(component_name)
# EXT_PROCESS_DEAD_COMPONENT((1) component_name,
# (2) all_components_variable)
#
# NOTE: component_name may not be determined until runtime....
# NOTE: component_name will not be determined until run time.
#
######################################################################
AC_DEFUN([EXT_PROCESS_DEAD_COMPONENT],[
AC_MSG_CHECKING([if MPI Extension $1 can compile])
# Need to add this component to the "all" list so that it is
# included in DIST SUBDIRS
$2="$$2 $1"
AC_MSG_RESULT([no])
])
@ -603,6 +745,8 @@ AC_DEFUN([EXT_COMPONENT_BUILD_CHECK],[
# OMPI_EXT_MAKE_DIR_LIST(subst'ed variable, shell list)
#
# Prefix every extension name with "mpiext/" and AC subst it.
# -------------------------------------------------------------------------
AC_DEFUN([OMPI_EXT_MAKE_DIR_LIST],[
$1=
@ -611,3 +755,28 @@ AC_DEFUN([OMPI_EXT_MAKE_DIR_LIST],[
done
AC_SUBST($1)
])
# OMPI_EXT_MAKE_LISTS((1) subst'ed variable prefix,
# (2) shell list,
# (3) bindings dir name,
# (4) bindings suffix)
#
# Prefix every extension name with "mpiext/".
# -------------------------------------------------------------------------
AC_DEFUN([OMPI_EXT_MAKE_LISTS],[
# Make the directory list
tmp=
for item in $2 ; do
tmp="$tmp mpiext/$item/$3"
done
$1_DIRS=$tmp
AC_SUBST($1_DIRS)
# Make the list of libraries
tmp=
for item in $2 ; do
tmp="$tmp "'$(top_builddir)'"/ompi/mpiext/$item/$3/libmpiext_${item}_$4.la"
done
$1_LIBS=$tmp
AC_SUBST($1_LIBS)
])

View File

@ -2,7 +2,7 @@ dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2006 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -21,12 +21,8 @@ AC_DEFUN([OMPI_LANG_LINK_WITH_C], [
AC_CACHE_CHECK([if C and $1 are link compatible],
lang_var,
[m4_if([$1], [Fortran],
[m4_define([ompi_lang_link_with_c_fortran], 1)],
[m4_if([$1], [Fortran 77],
[m4_define([ompi_lang_link_with_c_fortran], 1)],
[m4_define([ompi_lang_link_with_c_fortran], 0)])])
m4_if(ompi_lang_link_with_c_fortran, 1,
[OMPI_F77_MAKE_C_FUNCTION([testfunc_name], [testfunc])],
[m4_define([ompi_lang_link_with_c_fortran], 1)
OMPI_FORTRAN_MAKE_C_FUNCTION([testfunc_name], [testfunc])],
[testfunc_name="testfunc"])
# Write out C part

View File

@ -10,7 +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-2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2006-2011 Los Alamos National Security, LLC. All rights
# reserved.
@ -121,8 +121,9 @@ OPAL_SAVE_VERSION([OPAL], [Open Portable Access Layer], [$srcdir/VERSION],
m4_ifdef([project_ompi],
[AC_SUBST(libmpi_so_version)
AC_SUBST(libmpi_cxx_so_version)
AC_SUBST(libmpi_f77_so_version)
AC_SUBST(libmpi_f90_so_version)
AC_SUBST(libmpi_mpifh_so_version)
AC_SUBST(libmpi_usempi_tkr_so_version)
AC_SUBST(libmpi_usempi_ignore_tkr_so_version)
AC_SUBST(libmpi_java_so_version)
# It's icky that we have to hard-code the names of the
# common components here. :-( This could probably be done
@ -347,6 +348,7 @@ AC_CHECK_TYPES(__float128)
AC_CHECK_TYPES(long double)
# We only need these types if we're building the OMPI project, but
# OPAL currently doesn't protect for their lack of presence well.
AC_CHECK_HEADERS(complex.h)
AC_CHECK_TYPES(float _Complex)
AC_CHECK_TYPES(double _Complex)
AC_CHECK_TYPES(long double _Complex)
@ -927,7 +929,6 @@ LIBS="$LIBS $THREAD_LIBS"
WRAPPER_EXTRA_CFLAGS="$WRAPPER_EXTRA_CFLAGS $THREAD_CFLAGS"
m4_ifdef([project_ompi],
[WRAPPER_EXTRA_CXXFLAGS="$WRAPPER_EXTRA_CXXFLAGS $THREAD_CXXFLAGS"
WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $THREAD_FFLAGS"
WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $THREAD_FFLAGS"])
WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS $THREAD_LDFLAGS"
# no need to update WRAPPER_EXTRA_LIBS - we'll get it from LT later

View File

@ -10,6 +10,7 @@
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2007 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
# $COPYRIGHT$
#
@ -25,8 +26,7 @@
CC = mpicc
CXX = mpic++
CCC = mpic++
F90 = mpif90
F77 = mpif77
FC = mpifort
JAVAC = mpijavac
# Using -g is not necessary, but it is helpful for example programs,
@ -37,13 +37,24 @@ JAVAC = mpijavac
CFLAGS = -g
CXXFLAGS = -g
CCFLAGS = -g
F77FLAGS = -g
F90FLAGS = -g
FCFLAGS = -g
# Example programs to build
EXAMPLES = hello_c hello_cxx hello_f77 hello_f90 Hello.class \
ring_c ring_cxx ring_f77 ring_f90 connectivity_c Ring.class
EXAMPLES = \
hello_c \
hello_cxx \
hello_mpifh \
hello_usempi \
hello_usempif08 \
Hello.class \
ring_c \
ring_cxx \
ring_mpifh \
ring_usempi \
ring_usempif08 \
Ring.class \
connectivity_c
# Default target. Always build the C example. Only build the others
# if Open MPI was build with the relevant language bindings.
@ -52,41 +63,42 @@ all: hello_c ring_c connectivity_c
@ if ompi_info --parsable | grep bindings:cxx:yes >/dev/null; then \
$(MAKE) hello_cxx ring_cxx; \
fi
@ if ompi_info --parsable | grep bindings:f77:yes >/dev/null; then \
$(MAKE) hello_f77 ring_f77; \
@ if ompi_info --parsable | grep bindings:mpif.h:yes >/dev/null; then \
$(MAKE) hello_mpifh ring_mpifh; \
fi
@ if ompi_info --parsable | grep bindings:f90:yes >/dev/null; then \
$(MAKE) hello_f90 ring_f90; \
@ if ompi_info --parsable | grep bindings:use_mpi:yes >/dev/null; then \
$(MAKE) hello_usempi ring_usempi; \
fi
@ if ompi_info --parsable | grep bindings:use_mpi_f08:yes >/dev/null; then \
$(MAKE) hello_usempif08 ring_usempif08; \
fi
@ if ompi_info --parsable | grep bindings:java:yes >/dev/null; then \
$(MAKE) Hello.class; \
$(MAKE) Hello.class Ring.class; \
fi
@ if ompi_info --parsable | grep bindings:java:yes >/dev/null; then \
$(MAKE) Ring.class; \
fi
# The usual "clean" target
clean:
rm -f $(EXAMPLES) *~ *.o
# Don't rely on default rules for the fortran and Java examples
# Don't rely on default rules for the Fortran and Java examples
hello_f77: hello_f77.f
$(F77) $(F77FLAGS) $^ -o $@
ring_f77: ring_f77.f
$(F77) $(F77FLAGS) $^ -o $@
hello_mpifh: hello_mpifh.f
$(FC) $(FCFLAGS) $^ -o $@
ring_mpifh: ring_mpifh.f
$(FC) $(FCFLAGS) $^ -o $@
hello_f90: hello_f90.f90
$(F90) $(F90FLAGS) $^ -o $@
ring_f90: ring_f90.f90
$(F90) $(F90FLAGS) $^ -o $@
hello_usempi: hello_usempi.f90
$(FC) $(FCFLAGS) $^ -o $@
ring_usempi: ring_usempi.f90
$(FC) $(FCFLAGS) $^ -o $@
hello_usempif08: hello_usempif08.f90
$(FC) $(FCFLAGS) $^ -o $@
ring_usempif08: ring_usempif08.f90
$(FC) $(FCFLAGS) $^ -o $@
Hello.class: Hello.java
$(JAVAC) Hello.java
Ring.class: Ring.java
$(JAVAC) Ring.java

View File

@ -10,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
# $COPYRIGHT$
@ -34,12 +34,14 @@ EXTRA_DIST += \
examples/Makefile \
examples/hello_c.c \
examples/hello_cxx.cc \
examples/hello_f77.f \
examples/hello_f90.f90 \
examples/hello_mpifh.f \
examples/hello_usempi.f90 \
examples/hello_usempif08.f90 \
examples/ring_c.c \
examples/ring_cxx.cc \
examples/ring_f77.f \
examples/ring_f90.f90 \
examples/ring_mpifh.f \
examples/ring_usempi.f90 \
examples/ring_usempif08.f90 \
examples/connectivity_c.c \
examples/Hello.java \
examples/Ring.java

View File

@ -1,10 +1,12 @@
Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
University Research and Technology
Corporation. All rights reserved.
Copyright (c) 2006-2011 Cisco Systems, Inc. All rights reserved.
Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved.
Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
$COPYRIGHT$
The files in this directory are sample MPI applications provided both
as a trivial primer to MPI as well as simple tests to ensure that your
Open MPI installation is working properly.
@ -17,36 +19,44 @@ not enough. Excellent MPI tutorials are available here:
Get a free account and login; you can then browse to the list of
available courses. Look for the ones with "MPI" in the title.
There are 2 MPI examples in this directory, each in five languages:
There are two MPI examples in this directory, each using one of six
different MPI interfaces:
- Hello world
C: hello_c.c
C++: hello_cxx.cc
F77: hello_f77.f
F90: hello_f90.f90
Java: Hello.java
C: hello_c.c
C++: hello_cxx.cc
Fortran mpif.h: hello_mpifh.f
Fortran use mpi: hello_usempi.f90
Fortran use mpi_f08: hello_usempif08.f90
Java: Hello.java
- Send a trivial message around in a ring
C: ring_c.c
C++: ring_cxx.cc
F77: ring_f77.f
F90: ring_f90.f90
Java: Ring.java
C: ring_c.c
C++: ring_cxx.cc
Fortran mpif.h: ring_mpifh.f
Fortran use mpi: ring_usempi.f90
Fortran use mpi_f08: ring_usempif08.f90
Java: Ring.java
Additionally, there's one further example application, but this one
only uses the MPI C bindings:
- Test the connectivity between all processes
C: connectivity_c.c
The Makefile in this directory will build as many of the examples as
you have language support (e.g., if you do not have F90 bindings
compiled as part of Open MPI, the F90 examples will be skipped).
you have language support (e.g., if you do not have the Fortran "use
mpi" bindings compiled as part of Open MPI, the those examples will be
skipped).
The Makefile assumes that the wrapper compilers mpicc, mpic++, mpif77,
and mpif90 are in your path.
The Makefile assumes that the wrapper compilers mpicc, mpic++, and
mpifort are in your path.
Although the Makefile is tailored for Open MPI (e.g., it checks the
"ompi_info" command to see if you have support for C++, F77, and F90),
all of the example programs are pure MPI, and therefore not specific
to Open MPI. Hence, you can use a different MPI implementation to
compile and run these programs if you wish.
"ompi_info" command to see if you have support for C++, mpif.h, use
mpi, and use mpi_f08 F90), all of the example programs are pure MPI,
and therefore not specific to Open MPI. Hence, you can use a
different MPI implementation to compile and run these programs if you
wish.
Make today an Open MPI day!

View File

@ -2,7 +2,8 @@ C
C Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
C University Research and Technology
C Corporation. All rights reserved.
C Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
C Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
C $COPYRIGHT$
C
C Sample MPI "hello world" application in Fortran 77
C
@ -10,14 +11,16 @@ C
implicit none
include 'mpif.h'
integer ierr, rank, size, len
character*(MPI_MAX_LIBRARY_VERSION_STRING) version
character(len=MPI_MAX_LIBRARY_VERSION_STRING) version
call MPI_INIT(ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierr)
call MPI_GET_LIBRARY_VERSION(version, len, ierr)
print *, "Hello, world, I am ", rank, " of ", size, " (",
& version, ",", len, ")"
write(*, '("Hello, world, I am ", i2, " of ", i2, ": ", a)')
& rank, size, version
call MPI_FINALIZE(ierr)
end

View File

@ -4,7 +4,8 @@
! Corporation. 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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
! $COPYRIGHT$
!
! Sample MPI "hello world" application in Fortran 90
!
@ -12,14 +13,15 @@ program main
use mpi
implicit none
integer :: ierr, rank, size, len
character*(MPI_MAX_LIBRARY_VERSION_STRING) :: version
character*(MPI_MAX_OBJECT_NAME) :: name
character(len=MPI_MAX_LIBRARY_VERSION_STRING) :: version
call MPI_INIT(ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierr)
call MPI_GET_LIBRARY_VERSION(version, len, ierr)
print *, "Hello, world, I am ", rank, " of ", size," (", &
version, ",", len, ")"
write(*, '("Hello, world, I am ", i2, " of ", i2, ": ", a)') &
rank, size, version
call MPI_FINALIZE(ierr)
end

View File

@ -0,0 +1,30 @@
! -*- f90 -*-
!
! Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
! University Research and Technology
! Corporation. 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) 2009-2012 Los Alamos National Security, LLC.
! All rights reserved.
! $COPYRIGHT$
!
! Sample MPI "hello world" application using the MPI-3 mpi_f08 module.
!
program main
use mpi_f08
implicit none
integer :: rank, size, len
character(len=MPI_MAX_LIBRARY_VERSION_STRING) :: version
call MPI_INIT()
call MPI_COMM_RANK(MPI_COMM_WORLD, rank)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size)
call MPI_GET_LIBRARY_VERSION(version, len)
write(*, '("Hello, world, I am ", i2, " of ", i2, ": ", a)') &
rank, size, version
call MPI_FINALIZE()
end

View File

@ -2,7 +2,8 @@ C
C Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
C University Research and Technology
C Corporation. All rights reserved.
C Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
C Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
C $COPYRIGHT$
C
C Simple ring test program
C
@ -31,11 +32,13 @@ C the number of times to go around the ring in the message.
if (rank .eq. 0) then
message = 10
print *, 'Process 0 sending ', message, ' to ', next, ' tag ',
& tag, ' (', size, ' processes in ring)'
write(*, '("Process 0 sending ", i2, " to ", i2, " tag ",
& i3, " (", i2, " processes in ring)")')
& message, next, tag, size
call MPI_SEND(message, 1, MPI_INTEGER, next, tag,
& MPI_COMM_WORLD, ierr)
print *, 'Process 0 sent to ', next
write(*, '("Process 0 sent to ", i2)')
& next
endif
C Pass the message around the ring. The exit mechanism works as
@ -51,14 +54,14 @@ C normally.
if (rank .eq. 0) then
message = message - 1
print *, 'Process 0 decremented value:', message
write(*, '("Process 0 decremented value: ", i2)') message
endif
call MPI_SEND(message, 1, MPI_INTEGER, next, tag,
& MPI_COMM_WORLD, ierr)
if (message .eq. 0) then
print *, 'Process ', rank, ' exiting'
write(*, '("Process ", i2, " exiting")') rank
goto 20
endif
goto 10

View File

@ -2,14 +2,15 @@
! Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
! University Research and Technology
! Corporation. All rights reserved.
! Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
! $COPYRIGHT$
!
! Simple ring test program
!
program ring
use mpi
implicit none
integer :: rank, size, tag, next, from, message, ierr
integer :: rank, size, tag, next, from, ierr, i, message
! Start up MPI
@ -30,9 +31,9 @@ program ring
if (rank .eq. 0) then
message = 10
print *, 'Process 0 sending ', message, ' to ', next, ' tag ', tag, ' (', size, ' processes in ring)'
call MPI_SEND(message, 1, MPI_INTEGER, next, tag, MPI_COMM_WORLD, ierr)
print *, 'Process 0 sent to ', next
write(*, '("Process 0 sending ", i2, " to ", i2, " tag ", i3, " (", i2, " processes in ring)")') message, next, tag, size
call MPI_SEND(message, 1, MPI_INTEGER, next, tag, MPI_COMM_WORLD, ierr)
write(*, '("Process 0 sent to ", i2)') next
endif
! Pass the message around the ring. The exit mechanism works as
@ -42,18 +43,19 @@ program ring
! the next process and then quits. By passing the 0 message first,
! every process gets the 0 message and can quit normally.
10 call MPI_RECV(message, 1, MPI_INTEGER, from, tag, MPI_COMM_WORLD, &
MPI_STATUS_IGNORE, ierr)
i = 1
10 call MPI_Recv(message, i, MPI_INTEGER, from, tag, MPI_COMM_WORLD, &
MPI_STATUS_IGNORE, ierr)
if (rank .eq. 0) then
message = message - 1
print *, 'Process 0 decremented value:', message
write(*, '("Process 0 decremented value: ", i2)') message
endif
call MPI_SEND(message, 1, MPI_INTEGER, next, tag, MPI_COMM_WORLD, ierr)
if (message .eq. 0) then
print *, 'Process ', rank, ' exiting'
write(*, '("Process ", i2, " exiting")') rank
goto 20
endif
goto 10
@ -63,7 +65,7 @@ program ring
20 if (rank .eq. 0) then
call MPI_RECV(message, 1, MPI_INTEGER, from, tag, MPI_COMM_WORLD, &
MPI_STATUS_IGNORE, ierr)
MPI_STATUS_IGNORE, ierr)
endif
! All done

View File

@ -0,0 +1,79 @@
! -*- f90 -*-
!
! Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
! University Research and Technology
! Corporation. All rights reserved.
! Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All rights reserved.
! $COPYRIGHT$
!
! Simple ring test program using the MPI-3 mpi_f08 module.
!
program ring
use mpi_f08
implicit none
integer :: rank, size, tag, next, from, i, message
! Start up MPI
call MPI_INIT()
call MPI_COMM_RANK(MPI_COMM_WORLD, rank)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size)
! Calculate the rank of the next process in the ring. Use the modulus
! operator so that the last process "wraps around" to rank zero.
tag = 201
next = mod((rank + 1), size)
from = mod((rank + size - 1), size)
! If we are the "master" process (i.e., MPI_COMM_WORLD rank 0), put
! the number of times to go around the ring in the message.
if (rank .eq. 0) then
message = 10
write(*, '("Process 0 sending ", i2, " to ", i2, " tag ", i3, " (", i2, " processes in ring)")') message, next, tag, size
call MPI_SEND(message, 1, MPI_INTEGER, next, tag, MPI_COMM_WORLD)
write(*, '("Process 0 sent to ", i2)') next
endif
! Pass the message around the ring. The exit mechanism works as
! follows: the message (a positive integer) is passed around the ring.
! Each time it passes rank 0, it is decremented. When each processes
! receives a message containing a 0 value, it passes the message on to
! the next process and then quits. By passing the 0 message first,
! every process gets the 0 message and can quit normally.
i = 1
10 call MPI_Recv(message, i, MPI_INTEGER, from, tag, MPI_COMM_WORLD, &
MPI_STATUS_IGNORE)
if (rank .eq. 0) then
message = message - 1
write(*, '("Process 0 decremented value: ", i2)') message
endif
call MPI_SEND(message, 1, MPI_INTEGER, next, tag, MPI_COMM_WORLD)
if (message .eq. 0) then
write(*, '("Process ", i2, " exiting")') rank
goto 20
endif
goto 10
! The last process does one extra send to process 0, which needs to be
! received before the program can exit
20 if (rank .eq. 0) then
call MPI_RECV(message, 1, MPI_INTEGER, from, tag, MPI_COMM_WORLD, &
MPI_STATUS_IGNORE)
endif
! All done
call MPI_FINALIZE()
end program

View File

@ -9,7 +9,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2010-2011 Sandia National Laboratories. All rights reserved.
# $COPYRIGHT$
@ -23,101 +23,122 @@ EXTRA_DIST = CMakeLists.txt
# We always have C bindings, but do we have profiling?
if WANT_MPI_BINDINGS_LAYER
if BUILD_MPI_BINDINGS_LAYER
c_mpi_lib = mpi/c/libmpi_c_mpi.la
else
c_mpi_lib =
endif
if WANT_PMPI_BINDINGS_LAYER
if BUILD_PMPI_BINDINGS_LAYER
c_pmpi_lib = mpi/c/profile/libmpi_c_pmpi.la
else
c_pmpi_lib =
endif
# See if we have f77 MPI bindings
# See if we have Fortran mpif.h MPI bindings
if OMPI_WANT_F77_BINDINGS
f77_base_lib = mpi/f77/base/libmpi_f77_base.la
if OMPI_BUILD_FORTRAN_MPIFH_BINDINGS
mpi_fortran_base_lib = mpi/fortran/base/libmpi_fortran_base.la
else
f77_base_lib =
mpi_fortran_base_lib =
endif
# Note that the ordering of "." in SUBDIRS is important: the C++, F77,
# and F90 bindings are all in standalone .la files that depend on
# libmpi.la. So we must fully build libmpi.la first.
# Note that the ordering of "." in SUBDIRS is important: the C++,
# Fortran mpif.h, and use mpi/use mpi_f08 bindings are all in
# standalone .la files that depend on libmpi.la. So we must fully
# build libmpi.la first.
# NOTE: A handful of files in mpi/f77/base must be included in
# NOTE: A handful of files in mpi/fortran/base must be included in
# libmpi.la. But we wanted to keep all the Fortran sources together
# in the same tree, so we moved those sources to a separate
# subdirectory with its own Makefile.include that is included in this
# Makefile.am (NOTE: it did *not* work to put all the files -- base
# and non-base -- into mpi/f77 and have both a regular Makefile.am for
# building the f77 bindings library and a separate Makefile.include
# that was included in this top-level Makefile.am; problems occurred
# with "make distclean" and files in the ompi/mpi/f77/.deps directory
# -- it's not clear whether this is an AM bug or whether this behavior
# is simply not supported). This ompi/mpi/f77/base/Makefile.include
# file makes a convenience LT library that is then sucked into
# libmpi.la (the ompi/mpi/f77/base sources must be compiled with
# special CPPFLAGS; we can't just add the raw sources to
# libmpi_la_SOURCES, unfortunately).
# and non-base -- into mpi/fortran/mpif-h and have both a regular
# Makefile.am for building the mpif.h bindings library and a separate
# Makefile.include that was included in this top-level Makefile.am;
# problems occurred with "make distclean" and files in the
# ompi/mpi/fortran/mpif-h/.deps directory -- it's not clear whether
# this is an AM bug or whether this behavior is simply not supported).
# This ompi/mpi/fortran/base/Makefile.include file makes a convenience
# LT library that is then sucked into libmpi.la (the
# ompi/mpi/fortran/base sources must be compiled with special
# CPPFLAGS; we can't just add the raw sources to libmpi_la_SOURCES,
# unfortunately).
# The end of the result is that libmpi.la -- including a few sources
# from mpi/f77/base -- is fully built before the C++, F77, and F90
# bindings are built. Therefore, the C++, F77 and F90 bindings
# libraries can all link against libmpi.la.
# from mpi/fortran/base -- is fully built before the C++, mpif.h, and
# use mpi/use mpi_f08 bindings are built. Therefore, the C++, mpif.h
# and use mpi/use mpi_f08 bindings libraries can all link against
# libmpi.la.
# NOTE: The ordering of this list is VERY CAREFULLY CRAFTED! Do not
# change the ordering unless you really know what you're doing. :-)
SUBDIRS = \
include \
datatype \
debuggers \
etc \
mpi/c \
$(OMPI_MPIEXT_SUBDIRS) \
$(MCA_ompi_FRAMEWORKS_SUBDIRS) \
$(MCA_ompi_FRAMEWORK_COMPONENT_STATIC_SUBDIRS) \
. \
mpi/cxx \
mpi/f77 \
mpi/f90 \
mpi/java \
$(MCA_ompi_FRAMEWORK_COMPONENT_DSO_SUBDIRS) \
$(OMPI_CONTRIB_SUBDIRS)
include \
datatype \
debuggers \
etc \
mpi/c \
$(OMPI_MPIEXT_C_DIRS) \
mpi/fortran/base/ \
$(MCA_ompi_FRAMEWORKS_SUBDIRS) \
$(MCA_ompi_FRAMEWORK_COMPONENT_STATIC_SUBDIRS) \
. \
mpi/cxx \
$(OMPI_MPIEXT_MPIFH_DIRS) \
mpi/fortran/mpif-h \
$(OMPI_FORTRAN_USEMPI_DIR) \
$(OMPI_MPIEXT_USEMPIF08_DIRS) \
$(OMPI_FORTRAN_USEMPIF08_DIR) \
mpi/fortran/mpiext \
mpi/java \
$(MCA_ompi_FRAMEWORK_COMPONENT_DSO_SUBDIRS) \
$(OMPI_CONTRIB_SUBDIRS)
# The ordering of the DIST_SUBDIRS isn't as important, but note that
# its contents *are* different than SUBDIRS. In particular, the
# MPIEXT subdirs has a different value that is *not* equivalent to the
# union of the various $(OMPI_MPIEXT_*_DIRS) variables from SUBDIRS!
DIST_SUBDIRS = \
include \
datatype \
debuggers \
etc \
mpi/c \
mpi/cxx \
mpi/f77 \
mpi/f90 \
mpi/java \
$(OMPI_MPIEXT_ALL_SUBDIRS) \
$(MCA_ompi_FRAMEWORKS_SUBDIRS) \
$(MCA_ompi_FRAMEWORK_COMPONENT_ALL_SUBDIRS) \
$(OMPI_CONTRIB_DIST_SUBDIRS)
include \
datatype \
debuggers \
etc \
mpi/c \
mpi/cxx \
mpi/fortran/base \
mpi/fortran/mpif-h \
mpi/fortran/use-mpi-tkr \
mpi/fortran/use-mpi-ignore-tkr \
mpi/fortran/use-mpi-f08 \
mpi/fortran/use-mpi-f08-desc \
mpi/fortran/mpiext \
mpi/java \
$(OMPI_MPIEXT_ALL_SUBDIRS) \
$(MCA_ompi_FRAMEWORKS_SUBDIRS) \
$(MCA_ompi_FRAMEWORK_COMPONENT_ALL_SUBDIRS) \
$(OMPI_CONTRIB_DIST_SUBDIRS)
# Build the main MPI library
lib_LTLIBRARIES = libmpi.la
libmpi_la_SOURCES =
libmpi_la_LIBADD = \
datatype/libdatatype.la \
debuggers/libdebuggers.la \
mpi/c/libmpi_c.la \
$(c_mpi_lib) \
$(c_pmpi_lib) \
$(f77_base_lib) \
$(MCA_ompi_FRAMEWORK_LIBS) \
$(OMPI_MPIEXT_LIBS) \
$(OMPI_LIBMPI_EXTRA_LIBS) \
$(top_ompi_builddir)/orte/libopen-rte-lt.la
datatype/libdatatype.la \
debuggers/libdebuggers.la \
mpi/c/libmpi_c.la \
$(c_mpi_lib) \
$(c_pmpi_lib) \
$(mpi_fortran_base_lib) \
$(MCA_ompi_FRAMEWORK_LIBS) \
$(OMPI_MPIEXT_C_LIBS) \
$(OMPI_LIBMPI_EXTRA_LIBS) \
$(top_ompi_builddir)/orte/libopen-rte-lt.la
libmpi_la_DEPENDENCIES = $(libmpi_la_LIBADD)
libmpi_la_LDFLAGS = \
-version-info $(libmpi_so_version) \
$(OMPI_LIBMPI_EXTRA_LDFLAGS)
-version-info $(libmpi_so_version) \
$(OMPI_LIBMPI_EXTRA_LDFLAGS)
# included subdirectory Makefile.am's and appended-to variables
headers =
@ -150,7 +171,6 @@ include runtime/Makefile.am
include win/Makefile.am
include tools/Makefile.am
include mpi/Makefile.am
include mpi/f77/base/Makefile.include
include mpi/man/man3/Makefile.extra
include mpiext/Makefile.am

View File

@ -202,7 +202,7 @@
#include "ompi/datatype/ompi_datatype.h"
#include "ompi/communicator/communicator.h" /* ompi_communicator_t generated in [COPY|DELETE]_ATTR_CALLBACKS */
#include "ompi/win/win.h" /* ompi_win_t generated in [COPY|DELETE]_ATTR_CALLBACKS */
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
/*
* Macros
@ -959,6 +959,7 @@ int ompi_attr_copy_all(ompi_attribute_type_t type, void *old_object,
}
set_value(type, new_object, &newattr_hash, key,
new_attr, true);
} else {
OBJ_RELEASE(new_attr);
}

View File

@ -11,7 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2010 University of Houston. All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
@ -48,6 +48,13 @@ ompi_predefined_communicator_t ompi_mpi_comm_self;
ompi_predefined_communicator_t ompi_mpi_comm_null;
ompi_communicator_t *ompi_mpi_comm_parent;
ompi_predefined_communicator_t *ompi_mpi_comm_world_addr =
&ompi_mpi_comm_world;
ompi_predefined_communicator_t *ompi_mpi_comm_self_addr =
&ompi_mpi_comm_self;
ompi_predefined_communicator_t *ompi_mpi_comm_null_addr =
&ompi_mpi_comm_null;
static void ompi_comm_construct(ompi_communicator_t* comm);
static void ompi_comm_destruct(ompi_communicator_t* comm);

View File

@ -10,7 +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-2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2010 University of Houston. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
@ -239,6 +239,14 @@ OMPI_DECLSPEC extern ompi_predefined_communicator_t ompi_mpi_comm_world;
OMPI_DECLSPEC extern ompi_predefined_communicator_t ompi_mpi_comm_self;
OMPI_DECLSPEC extern ompi_predefined_communicator_t ompi_mpi_comm_null;
/*
* These variables are for the MPI F03 bindings (F03 must bind Fortran
* varaiables to symbols; it cannot bind Fortran variables to the
* address of a C variable).
*/
OMPI_DECLSPEC extern ompi_predefined_communicator_t *ompi_mpi_comm_world_addr;
OMPI_DECLSPEC extern ompi_predefined_communicator_t *ompi_mpi_comm_self_addr;
OMPI_DECLSPEC extern ompi_predefined_communicator_t *ompi_mpi_comm_null_addr;
/**

View File

@ -1,6 +1,6 @@
# -*- shell-script -*-
#
# Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -22,24 +22,29 @@ AC_DEFUN([OMPI_CONFIG_FILES],[
ompi/mpi/c/Makefile
ompi/mpi/c/profile/Makefile
ompi/mpi/cxx/Makefile
ompi/mpi/f77/Makefile
ompi/mpi/f77/profile/Makefile
ompi/mpi/f90/Makefile
ompi/mpi/f90/fortran_kinds.sh
ompi/mpi/f90/fortran_sizes.h
ompi/mpi/f90/scripts/Makefile
ompi/mpi/fortran/base/Makefile
ompi/mpi/fortran/mpif-h/Makefile
ompi/mpi/fortran/mpif-h/profile/Makefile
ompi/mpi/fortran/use-mpi-tkr/Makefile
ompi/mpi/fortran/use-mpi-tkr/fortran_sizes.h
ompi/mpi/fortran/use-mpi-tkr/fortran_kinds.sh
ompi/mpi/fortran/use-mpi-tkr/scripts/Makefile
ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h
ompi/mpi/fortran/use-mpi-f08/Makefile
ompi/mpi/fortran/use-mpi-f08-desc/Makefile
ompi/mpi/fortran/mpiext/Makefile
ompi/tools/ompi_info/Makefile
ompi/tools/wrappers/Makefile
ompi/tools/wrappers/mpicc-wrapper-data.txt
ompi/tools/wrappers/mpic++-wrapper-data.txt
ompi/tools/wrappers/mpif77-wrapper-data.txt
ompi/tools/wrappers/mpif90-wrapper-data.txt
ompi/tools/wrappers/mpifort-wrapper-data.txt
ompi/tools/wrappers/ompi.pc
ompi/tools/wrappers/ompi-c.pc
ompi/tools/wrappers/ompi-cxx.pc
ompi/tools/wrappers/ompi-f77.pc
ompi/tools/wrappers/ompi-f90.pc
ompi/tools/wrappers/ompi-fort.pc
ompi/tools/wrappers/mpijavac.pl
ompi/tools/ortetools/Makefile
ompi/tools/ompi-server/Makefile

View File

@ -1,114 +0,0 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F77_CHECK(Fortran type, c type required,
# types to search, expected size)
#----------------------------------------------------------
# Check Fortran type, including:
# - whether compiler supports or not
# - size of type
# - equal to expected size
# - alignment
# - associated C type
#
# types to search is a comma-seperated list of values
AC_DEFUN([OMPI_F77_CHECK], [
OPAL_VAR_SCOPE_PUSH([ofc_have_type ofc_type_size ofc_type_alignment ofc_c_type ofc_expected_size])
ofc_expected_size=$4
ofc_have_type=0
ofc_type_size=$ac_cv_sizeof_int
ofc_type_alignment=$ac_cv_sizeof_int
ofc_c_type=ompi_fortran_bogus_type_t
# Only check if we actually want the F77 bindings / have a F77
# compiler. This allows us to call this macro, even if there is
# no F77 compiler. If we have no f77 compiler, then just set a
# bunch of defaults.
if test "$OMPI_WANT_F77_BINDINGS" = "1"; then
OMPI_F77_CHECK_TYPE([$1], [ofc_have_type=1], [ofc_have_type=0])
else
AC_MSG_CHECKING([if Fortran 77 compiler supports $1])
AC_MSG_RESULT([skipped])
fi
if test "$ofc_have_type" = "1"; then
# What is the size of this type?
# NOTE: Some Fortran compilers actually will return that a
# type exists even if it doesn't support it -- the compiler
# will automatically convert the unsupported type to a type
# that it *does* support. For example, if you try to use
# INTEGER*16 and the compiler doesn't support it, it may well
# automatically convert it to INTEGER*8 for you (!). So we
# have to check the actual size of the type once we determine
# that the compiler doesn't error if we try to use it
# (i.e,. the compiler *might* support that type). If the size
# doesn't match the expected size, then the compiler doesn't
# really support it.
OMPI_F77_GET_SIZEOF([$1], [ofc_type_size])
if test "$ofc_expected_size" != "-1" -a "$ofc_type_size" != "$ofc_expected_size"; then
AC_MSG_WARN([*** Fortran 77 $1 does not have expected size!])
AC_MSG_WARN([*** Expected $ofc_expected_size, got $ofc_type_size])
AC_MSG_WARN([*** Disabling MPI support for Fortran 77 $1])
ofc_have_type=0
else
# Look for a corresponding C type (will abort by itself if the
# type isn't found and we need it)
ofc_c_type=
m4_ifval([$3], [OMPI_FIND_TYPE([$1], [$3], [$2], [$ofc_type_size], [ofc_c_type])
if test -z "$ofc_c_type" ; then
ofc_have_type=0
fi])
# Get the alignment of the type
if test "$ofc_have_type" = "1"; then
OMPI_F77_GET_ALIGNMENT([$1], [ofc_type_alignment])
fi
fi
fi
# We always need these defines -- even if we don't have a given type,
# there are some places in the code where we have to have *something*.
AC_DEFINE_UNQUOTED([OMPI_HAVE_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]),
[$ofc_have_type],
[Whether we have Fortran 77 $1 or not])
AC_DEFINE_UNQUOTED([OMPI_SIZEOF_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]),
[$ofc_type_size],
[Size of Fortran 77 $1])
AC_DEFINE_UNQUOTED([OMPI_ALIGNMENT_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]),
[$ofc_type_alignment],
[Alignment of Fortran 77 $1])
if test "$3" != ""; then
AC_DEFINE_UNQUOTED([ompi_fortran_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [A-Z], [a-z])[_t],
[$ofc_c_type],
[C type corresponding to Fortran 77 $1])
fi
# Save some in shell variables for later use (e.g., need
# OMPI_SIZEOF_FORTRAN_INTEGER in OMPI_F77_GET_FORTRAN_HANDLE_MAX)
[OMPI_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[_C_TYPE=$ofc_c_type]
[OMPI_HAVE_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[=$ofc_have_type]
[OMPI_SIZEOF_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[=$ofc_type_size]
[OMPI_ALIGNMENT_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[=$ofc_type_alignment]
# Clean up
OPAL_VAR_SCOPE_POP
])dnl

View File

@ -1,44 +0,0 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F77_CHECK_TYPE([type, action if found, action if not found])
# -----------------------------------------------------------------
AC_DEFUN([OMPI_F77_CHECK_TYPE],[
# Use of m4_translit suggested by Eric Blake:
# http://lists.gnu.org/archive/html/bug-autoconf/2010-10/msg00016.html
AS_VAR_PUSHDEF([type_var],
m4_translit([[ompi_cv_f77_have_$1]], [*], [p]))
# Determine Fortran datatype size.
# First arg is type, 2nd arg is config var to define
AC_CACHE_CHECK([if Fortran 77 compiler supports $1], type_var,
[AC_LANG_PUSH([Fortran 77])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[C
program main
$1 bogus_variable
end]])],
[AS_VAR_SET(type_var, "yes")],
[AS_VAR_SET(type_var, "no")])
AC_LANG_POP([Fortran 77])])
AS_VAR_IF(type_var, [yes], [$2], [$3])
AS_VAR_POPDEF([type_var])dnl
])dnl

View File

@ -1,89 +0,0 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F77_GET_SIZEOF(type, variable to set)
# ------------------------------------------
AC_DEFUN([OMPI_F77_GET_SIZEOF],[
# Use of m4_translit suggested by Eric Blake:
# http://lists.gnu.org/archive/html/bug-autoconf/2010-10/msg00016.html
AS_VAR_PUSHDEF([type_var],
m4_translit([[ompi_cv_f77_sizeof_$1]], [*], [p]))
AC_CACHE_CHECK([size of Fortran 77 $1], type_var,
[OMPI_F77_MAKE_C_FUNCTION([ompi_ac_size_fn], [size])
# Fortran module
cat > conftestf.f <<EOF
program fsize
external size
$1 x(2)
call size(x(1),x(2))
end
EOF
# C module
if test -f conftest.h; then
ompi_conftest_h="#include \"conftest.h\""
else
ompi_conftest_h=""
fi
cat > conftest.c <<EOF
#include <stdio.h>
#include <stdlib.h>
$ompi_conftest_h
#ifdef __cplusplus
extern "C" {
#endif
void $ompi_ac_size_fn(char *a, char *b)
{
int diff = (int) (b - a);
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf(f, "%d\n", diff);
fclose(f);
}
#ifdef __cplusplus
}
#endif
EOF
OPAL_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
[OPAL_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
[happy="yes"], [happy="no"])], [happy="no"])
if test "$happy" = "no" ; then
AC_MSG_ERROR([Could not determine size of $1])
fi
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine size of $1 when cross-compiling])],
[OPAL_LOG_COMMAND([./conftest],
[AS_IF([test -f conftestval],
[AS_VAR_SET(type_var, [`cat conftestval`])],
[OPAL_LOG_MSG([conftestval not found.], 1)
AC_MSG_ERROR([Could not determine size of $1])])],
[AC_MSG_ERROR([Could not determine size of $1])])])
unset happy ompi_conftest_h
rm -rf conftest*])
AS_VAR_COPY([$2], [type_var])
AS_VAR_POPDEF([type_var])dnl
])dnl

View File

@ -1,36 +0,0 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_F77_PURGE_UNSUPPORTED_KIND],[
# Purge F77 types (such as INTEGER*16) that don't match exptected datatype size.
# First arg is type, 2nd arg is config var to define.
AC_MSG_CHECKING([whether Fortran $1 has expected size])
val=`echo $1 | cut -f2 -d'*'`
type=`echo $1 | cut -f1 -d'*'`
if test "x$((OMPI_SIZEOF_FORTRAN_$type$val))" != "x$val" ; then
eval "OMPI_SIZEOF_FORTRAN_$type$val=0"
# eval "OMPI_ALIGNMENT_FORTRAN_$type$val=0"
eval "OMPI_HAVE_FORTRAN_$type$val=0"
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
fi
unset val type
])dnl

View File

@ -1,179 +0,0 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006 Cisco Systems, Inc.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F90_CHECK(Fortran type, expected size)
#----------------------------------------------------------------------------
# Check Fortran type/kind combinations, including:
# - whether compiler supports or not
# - size of type
# - equal to expected size
# - range (optional)
# - precision (optional)
# Note that we do *not* check for the alignment here. This is a long,
# sordid tale.
# We have been unable to devise a F90 test that will result in a
# consistent answer. Specifically, our prior tests have been similar
# to the f77 test -- have a small chunk of f90 code compiled with the
# C code to actually compute the offsets. The f90 code was a
# struct-like entity (a "type") with multiple members -- on a
# character and the other of the target type. The C code measured the
# distance between them. But even if you use the keyword to ensure
# that the F90 compiler does not re-order this struct, you may still
# get a different alignment answer than the F77 test (!). This is
# apparently because F90 allows compilers to align types differently
# according to use (in common blocks, as standalone variables, and as
# a member of a struct). Hence, the alignment can be different
# depending on how to measure (and use) it. This was confirmed by
# various members of the Fortran committee and several Fortran
# compiler vendors.
# We check the F77 alignment based on common block usage, but this is
# only one of the available types for F90. Hence, we may actually get
# a different answer between f77 and f90 in the same compiler series
# (and some compilers do! E.g., g95 gives different answers even when
# "g95" itself is used as both the f77 and f90 compiler).
# So we gave up.
# Additionally, this was really only a sanity check anyway, because
# the way out F90 MPI layer is organized, there is no translation
# between the data and datatypes performed -- we simply invoke the F77
# layer from the F90 layer. Hence, we make no distinction between
# them, and therefore the OMPI DDT engine uses only the F77 sizes and
# alignments. So rather than display a warning to the user for a test
# that was questionable at best, we just eliminated the F90 alignment
# test, corresponding F77 comparison, and ensuring warning -- because
# it really didn't mean anything anyway.
# types to search is a comma-seperated list of values
AC_DEFUN([OMPI_F90_CHECK], [
ofc_fortran_type="$1"
ofc_expected_size="$2"
ofc_have_type=0
ofc_type_size=$ac_cv_sizeof_int
# Only check if we actually want the F90 bindings / have a F90
# compiler. This allows us to call this macro even if there is
# no F90 compiler. If we have no f90 compiler, then just set a
# bunch of defaults.
if test "$OMPI_WANT_F90_BINDINGS" = "1"; then
OMPI_F90_CHECK_TYPE([$1], [ofc_have_type=1], [ofc_have_type=0])
else
AC_MSG_CHECKING([if Fortran 90 compiler supports $ofc_fortran_type])
AC_MSG_RESULT([skipped])
fi
if test "$ofc_have_type" = "1"; then
# What is the size of this type?
# NOTE: Some Fortran compilers actually will return that a
# type exists even if it doesn't support it -- the compiler
# will automatically convert the unsupported type to a type
# that it *does* support. For example, if you try to use
# INTEGER*16 and the compiler doesn't support it, it may well
# automatically convert it to INTEGER*8 for you (!). So we
# have to check the actual size of the type once we determine
# that the compiler doesn't error if we try to use it
# (i.e,. the compiler *might* support that type). If the size
# doesn't match the expected size, then the compiler doesn't
# really support it.
OMPI_F90_GET_SIZEOF([$1], [ofc_type_size])
if test "$ofc_expected_size" != "" -a "$ofc_type_size" != "$ofc_expected_size"; then
AC_MSG_WARN([*** Fortran 90 $ofc_fortran_type does not have expected size!])
AC_MSG_WARN([*** Expected $ofc_expected_size, got $ofc_type_size])
AC_MSG_WARN([*** Disabling MPI support for Fortran $ofc_fortran_type])
ofc_have_type=0
else
# If this type has an F77 counterpart, see if it's
# supported.
[ofc_f77_have_type=$OMPI_HAVE_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])
if test "$ofc_f77_have_type" = "0"; then
AC_MSG_WARN([*** Corresponding Fortran 77 type ($1) not supported])
AC_MSG_WARN([*** Skipping Fortran 90 type ($1)])
else
# Check the size of this type against its F77 counterpart
[ofc_f77_sizeof=$OMPI_SIZEOF_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])
if test "$ofc_f77_sizeof" != ""; then
AC_MSG_CHECKING([if Fortran 77 and 90 type sizes match])
if test "$ofc_f77_sizeof" != "$ofc_type_size"; then
AC_MSG_RESULT([no])
AC_MSG_WARN([*** Fortran 77 size for $1 ($ofc_f77_sizeof) does not match])
AC_MSG_WARN([*** Fortran 90 size for $1 ($ofc_type_size)])
AC_MSG_ERROR([*** Cannot continue])
else
AC_MSG_RESULT([yes])
fi
fi
# If we passed in the expected size, then also add the
# type to the relevant list of types found.
if test "$ofc_expected_size" != ""; then
ofc_letter=m4_translit(m4_bpatsubst($1, [^\(.\).+], [[\1]]), [a-z], [A-Z])
ofc_str="OMPI_F90_${ofc_letter}KINDS=\"\$OMPI_F90_${ofc_letter}KINDS $ofc_type_size \""
eval $ofc_str
fi
fi
fi
fi
# We always need these defines -- even if we don't have a given
# type, there are some places in the code where we have to have
# *something*. Note that the bpatsubst's are the same as used
# above (see comment above), but we added a translit to make them
# uppercase.
# If we got a pretty name, use that as the basis. If not, use the
# first part of the provided fortran type (e.g.,
# "logical(selected_int_kind(2))" -> logical1")
# Note that there is no need to AC_DEFINE the size of the F90
# datatype. We have ensured (above) that they are the same as the
# corresponding F77 datatypes, and that's good enough (i.e., the
# DDT engine only looks at the F77 sizes).
# Finally, note that it is necessary to use the Big Long Ugly m4
# expressions in the AC_DEFINE_UNQUOTEDs. If you don't (e.g., put
# the result of the BLUm4E in a shell variable and use that in
# AC_DEFINE_UNQUOTED), autoheader won't put them in the
# AC_CONFIG_HEADER (or AM_CONFIG_HEADER, in our case).
AC_DEFINE_UNQUOTED([OMPI_HAVE_F90_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [a-z], [A-Z]),
[$ofc_have_type],
[Whether we have Fortran 90 $ofc_fortran_type or not])
# Save some in shell variables for later use. Have to use m4
# functions here (vs. $ompi_upper_var_name, defined above) because
# these need to be set at autoconf time, not configure time.
[OMPI_SIZEOF_F90_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [a-z], [A-Z])[=$ofc_type_size]
AC_DEFINE_UNQUOTED([OMPI_SIZEOF_F90_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [a-z], [A-Z]),
[$ofc_type_size],
[Size of Fortran 77 $ofc_fortran_type])
AC_SUBST([OMPI_SIZEOF_F90_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [a-z], [A-Z]))
# Clean up
unset ofc_fortran_type ofc_expected_size ofc_want_range ofc_pretty_name
unset ofc_have_type ofc_type_size ofc_letter ofc_str
unset ofc_type_range ofc_type_precision
unset ofc_f77_sizeof
])dnl

View File

@ -1,85 +0,0 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_F90_FIND_MODULE_INCLUDE_FLAG],[
AS_VAR_PUSHDEF([f90_inc_var], [ompi_cv_f90_module_include_flag])
if test "$OMPI_WANT_F90_BINDINGS" -eq 1 ; then
AC_CACHE_CHECK([for Fortran 90 compiler module include flag],
f90_inc_var,
[ofi_possible_flags="-I -p -M"
mkdir conftest.$$
cd conftest.$$
# Try to compile an F90 module
mkdir subdir
cd subdir
cat > conftest-module.f90 <<EOF
module OMPI_MOD_FLAG
type OMPI_MOD_FLAG_TYPE
integer :: i
end type OMPI_MOD_FLAG_TYPE
end module OMPI_MOD_FLAG
EOF
OPAL_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -c conftest-module.f90 $LDFLAGS $LIBS], ,
[cd ..
rm -rf conftest.$$
AC_MSG_RESULT([Whoops!])
AC_MSG_WARN([*** Cannot seem to compile an f90 module])
AC_MSG_ERROR([Cannot continue])])
cd ..
#
# Now try to compile a simple program usinng that module, iterating
# through the possible flags that the compiler might use
#
cat > conftest.f90 <<EOF
program f90usemodule
use OMPI_MOD_FLAG
end program f90usemodule
EOF
ofi_module_flag=
for flag in $ofi_possible_flags; do
if test "$ofi_module_flag" = ""; then
OPAL_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 conftest.f90 ${flag}subdir $LDFLAGS $LIBS],
[AS_VAR_SET(f90_inc_var, [$flag])
ofi_module_flag="$flag"])
fi
done
cd ..
rm -rf conftest.$$
])
AS_VAR_COPY([OMPI_FC_MODULE_FLAG], [f90_inc_var])
if test "$OMPI_FC_MODULE_FLAG" = ""; then
AC_MSG_WARN([*** Could not determine the f90 compiler flag to indicate where modules reside])
AC_MSG_ERROR([*** Cannot continue])
fi
else
OMPI_FC_MODULE_FLAG=
fi
AC_SUBST(OMPI_FC_MODULE_FLAG)
AS_VAR_POPDEF([f90_inc_var])
])dnl

View File

@ -1,63 +0,0 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_F90_GET_INT_KIND(MPI name, decimal range, variable to set)
# ---------------------------------------------------------------
AC_DEFUN([OMPI_F90_GET_INT_KIND],[
AS_VAR_PUSHDEF([type_var], [ompi_cv_f90_int_kind_$2])
if test "$OMPI_WANT_F90_BINDINGS" -eq 1 ; then
AC_CACHE_CHECK([Fortran 90 kind of $1 (selected_int_kind($2))],
type_var,
[cat > conftestf.f90 <<EOF
program f90findintkind
open(8, file="conftestval")
write(8, fmt="(I5)") selected_int_kind($2)
close(8)
end program
EOF
# Try to compile
OPAL_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -o conftest conftestf.f90 $LDFLAGS $LIBS],
[happy="yes"], [happy="no"])
if test "$happy" = "no"; then
OPAL_LOG_MSG([here is the fortran 90 program:], 1)
OPAL_LOG_FILE([conftestf.f90])
AC_MSG_WARN([Could not kind of selected_int_kind($1)])
AC_MSG_WARN([See config.log for details])
AC_MSG_ERROR([Cannot continue])
fi
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine kind of selected_int_kind($1) when cross-compiling])],
[OPAL_LOG_COMMAND([./conftest],
[AS_VAR_SET(type_var, [`sed 's/ *//' conftestval`])],
[AC_MSG_ERROR([Could not determine kind of selected_int_kind($1)])])])
unset happy ompi_conftest_h
rm -rf conftest*])
AS_VAR_COPY([$3], [type_var])
else
$3=0
fi
AS_VAR_POPDEF([type_var])dnl
])

View File

@ -0,0 +1,199 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_FORTRAN_CHECK(Fortran type, c type required, types to search,
# expected size, define ompi_fortran_<foo>_t or not))
#----------------------------------------------------------
# Check Fortran type, including:
# - whether compiler supports or not
# - size of type
# - equal to expected size
# - alignment
# - associated C type
#
# types to search is a comma-seperated list of values
AC_DEFUN([OMPI_FORTRAN_CHECK], [
OPAL_VAR_SCOPE_PUSH([ofc_have_type ofc_type_size ofc_type_alignment ofc_c_type ofc_expected_size])
ofc_expected_size=$4
ofc_define_type=$5
ofc_have_type=0
ofc_type_size=$ac_cv_sizeof_int
ofc_type_alignment=$ac_cv_sizeof_int
ofc_c_type=ompi_fortran_bogus_type_t
ofc_type_kind=0
# Only check if we actually want the Fortran bindings / have a
# Fortran compiler. This allows us to call this macro, even if
# there is no Fortran compiler. If we have no Fortran compiler,
# then just set a bunch of defaults.
if test $OMPI_WANT_FORTRAN_BINDINGS -eq 1; then
OMPI_FORTRAN_CHECK_TYPE([$1], [ofc_have_type=1], [ofc_have_type=0])
else
AC_MSG_CHECKING([if Fortran compiler supports $1])
AC_MSG_RESULT([skipped])
fi
if test "$ofc_have_type" = "1"; then
# What is the size of this type?
# NOTE: Some Fortran compilers actually will return that a
# type exists even if it doesn't support it -- the compiler
# will automatically convert the unsupported type to a type
# that it *does* support. For example, if you try to use
# INTEGER*16 and the compiler doesn't support it, it may well
# automatically convert it to INTEGER*8 for you (!). So we
# have to check the actual size of the type once we determine
# that the compiler doesn't error if we try to use it
# (i.e,. the compiler *might* support that type). If the size
# doesn't match the expected size, then the compiler doesn't
# really support it.
OMPI_FORTRAN_GET_SIZEOF([], [$1], [ofc_type_size])
if test "$ofc_expected_size" != "-1" -a "$ofc_type_size" != "$ofc_expected_size"; then
AC_MSG_WARN([*** Fortran $1 does not have expected size!])
AC_MSG_WARN([*** Expected $ofc_expected_size, got $ofc_type_size])
AC_MSG_WARN([*** Disabling MPI support for Fortran $1])
ofc_have_type=0
else
# Look for a corresponding C type (will abort by itself if the
# type isn't found and we need it)
ofc_c_type=
m4_ifval([$3], [OMPI_FIND_TYPE([$1], [$3], [$2], [$ofc_type_size], [ofc_c_type])
if test -z "$ofc_c_type" ; then
ofc_have_type=0
fi])
# Get the alignment of the type
if test "$ofc_have_type" = "1"; then
OMPI_FORTRAN_GET_ALIGNMENT([$1], [ofc_type_alignment])
# Add it to the relevant list of types found
if test "$ofc_expected_size" != "-1"; then
ofc_letter=m4_translit(m4_bpatsubst($1, [^\(.\).+], [[\1]]), [a-z], [A-Z])
ofc_str="OMPI_FORTRAN_${ofc_letter}KINDS=\"\$OMPI_FORTRAN_${ofc_letter}KINDS $ofc_type_size \""
eval $ofc_str
fi
fi
# Get the kind of the type. We do this by looking at the
# Fortran type's corresponding C type (which we figured
# out above). Then we look a the official BIND(C) KIND
# type for that type. The official BIND(C) types were
# taken from table 15.2 of the Fortran 2008 standard,
# published on 6 October as ISO/IEC 1539-1:2010 (this is
# not a free document). A copy of this table is in the
# file ompi/mpi/fortran/c_to_integer_kind_mapping.pdf.
# NOTE: Some of the values of these C_* constants *may be
# negative* if the compiler doesn't support them. We have
# already verified that both the Fortran and the C types
# both exist. However, the compiler may still have -1 for
# the C_<foo> constants if the C type is not the same
# format as its corresponding Fortran type (e.g., Absoft's
# "REAL*16" and "long double" are the same size, but not
# the same format -- so the compiler is allowed to define
# C_LONG_DOUBLE to -1).
AC_MSG_CHECKING([for corresponding KIND value of $1])
case "$ofc_c_type" in
char) ofc_type_kind=C_SIGNED_CHAR ;;
double) ofc_type_kind=C_DOUBLE ;;
float) ofc_type_kind=C_FLOAT ;;
int) ofc_type_kind=C_INT ;;
int16_t) ofc_type_kind=C_INT16_T ;;
int32_t) ofc_type_kind=C_INT32_T ;;
int64_t) ofc_type_kind=C_INT64_T ;;
int8_t) ofc_type_kind=C_INT8_T ;;
long) ofc_type_kind=C_LONG ;;
long*double) ofc_type_kind=C_LONG_DOUBLE ;;
long*long) ofc_type_kind=C_LONG_LONG ;;
short) ofc_type_kind=C_SHORT ;;
float*_Complex) ofc_type_kind=C_FLOAT_COMPLEX ;;
double*_Complex) ofc_type_kind=C_DOUBLE_COMPLEX ;;
long*double*_Complex) ofc_type_kind=C_LONG_DOUBLE_COMPLEX ;;
*)
# Skip types like "DOUBLE PRECISION"
;;
esac
AS_IF([test "$ofc_type_kind" != ""],
[AC_MSG_RESULT([$ofc_type_kind])],
[AC_MSG_RESULT([<skipped>])])
# See if the value is -1. If so, then just say we don't
# have a match.
OMPI_FORTRAN_GET_KIND_VALUE([$ofc_type_kind], [ofc_type_kind_value])
AS_IF([test $ofc_type_kind_value -le 0],
[ofc_have_type=0
AC_MSG_WARN([Compiler $1 and $ofc_c_type mismatch; MPI datatype unsupported])])
fi
fi
# We always need these defines -- even if we don't have a given
# type, there are some places in the code where we have to have
# *something*. Note that the bpatsubst's are the same as used
# above (see comment above), but we added a translit to make them
# uppercase.
# If we got a pretty name, use that as the basis. If not, use the
# first part of the provided fortran type (e.g.,
# "logical(selected_int_kind(2))" -> logical1")
# Finally, note that it is necessary to use the Big Long Ugly m4
# expressions in the AC_DEFINE_UNQUOTEDs. If you don't (e.g., put
# the result of the BLUm4E in a shell variable and use that in
# AC_DEFINE_UNQUOTED), autoheader won't put them in the
# AC_CONFIG_HEADER (or AM_CONFIG_HEADER, in our case).
AC_DEFINE_UNQUOTED([OMPI_HAVE_FORTRAN_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [a-z], [A-Z]),
[$ofc_have_type],
[Whether we have Fortran $1 or not])
AC_DEFINE_UNQUOTED([OMPI_SIZEOF_FORTRAN_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [a-z], [A-Z]),
[$ofc_type_size],
[Size of Fortran $1])
AC_DEFINE_UNQUOTED([OMPI_ALIGNMENT_FORTRAN_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [a-z], [A-Z]),
[$ofc_type_alignment],
[Alignment of Fortran $1])
AC_DEFINE_UNQUOTED([OMPI_KIND_FORTRAN_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [a-z], [A-Z]),
[$ofc_type_kind],
[Fortrn KIND number for $1])
if test "$3" != "" -a "$ofc_define_type" = "yes"; then
AC_DEFINE_UNQUOTED([ompi_fortran_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [A-Z], [a-z])[_t],
[$ofc_c_type],
[C type corresponding to Fortran $1])
fi
# Save some in shell variables for later use (e.g., need
# OMPI_SIZEOF_FORTRAN_INTEGER in OMPI_FORTRAN_GET_HANDLE_MAX)
[OMPI_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[_C_TYPE=$ofc_c_type]
[OMPI_KIND_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[=$ofc_type_kind]
[OMPI_HAVE_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[=$ofc_have_type]
[OMPI_SIZEOF_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[=$ofc_type_size]
[OMPI_ALIGNMENT_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_])[=$ofc_type_alignment]
# Wow, this is sick. But it works! :-)
AC_SUBST([OMPI_HAVE_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]))
AC_SUBST([OMPI_KIND_FORTRAN_]m4_translit(m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]), [a-z], [A-Z]))
AC_SUBST([OMPI_SIZEOF_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]))
AC_SUBST([OMPI_SIZEOF_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]))
AC_SUBST([OMPI_ALIGNMENT_FORTRAN_]m4_bpatsubst(m4_bpatsubst([$1], [*], []), [[^a-zA-Z0-9_]], [_]))
# Clean up
OPAL_VAR_SCOPE_POP
])dnl

View File

@ -0,0 +1,47 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# Check whether or not the Fortran compiler supports the "abstract"
# keyword in derived types or not.
# OMPI_FORTRAN_CHECK_ABSTRACT([action if found],
# [action if not found])
# ----------------------------------------------------
AC_DEFUN([OMPI_FORTRAN_CHECK_ABSTRACT],[
AS_VAR_PUSHDEF([abstract_var], [ompi_cv_fortran_abstract])
AC_CACHE_CHECK([if Fortran compiler supports abstract], abstract_var,
[AC_LANG_PUSH([Fortran])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[MODULE abstract_mod
ABSTRACT INTERFACE
SUBROUTINE binky
END SUBROUTINE
END INTERFACE
END MODULE abstract_mod]])],
[AS_VAR_SET(abstract_var, yes)],
[AS_VAR_SET(abstract_var, no)])
touch conftest_foo.mod
rm -rf *.mod 2>/dev/null
AC_LANG_POP([Fortran])
])
AS_VAR_IF(abstract_var, [yes], [$1], [$2])
AS_VAR_POPDEF([abstract_var])dnl
])

View File

@ -0,0 +1,48 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# Check whether or not the Fortran compiler supports the "asynchronous"
# keyword in derived types or not.
# OMPI_FORTRAN_CHECK_ASYNCHRONOUS([action if found],
# [action if not found])
# ----------------------------------------------------
AC_DEFUN([OMPI_FORTRAN_CHECK_ASYNCHRONOUS],[
AS_VAR_PUSHDEF([asynchronous_var], [ompi_cv_fortran_asynchronous])
AC_CACHE_CHECK([if Fortran compiler supports asynchronous], asynchronous_var,
[AC_LANG_PUSH([Fortran])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[MODULE asynch_mod
INTERFACE
SUBROUTINE binky(buf)
REAL, DIMENSION(*), ASYNCHRONOUS :: buf
END SUBROUTINE
END INTERFACE
END MODULE asynch_mod]])],
[AS_VAR_SET(asynchronous_var, yes)],
[AS_VAR_SET(asynchronous_var, no)])
touch conftest_foo.mod
rm -rf *.mod 2>/dev/null
AC_LANG_POP([Fortran])
])
AS_VAR_IF(asynchronous_var, [yes], [$1], [$2])
AS_VAR_POPDEF([asynchronous_var])dnl
])

View File

@ -0,0 +1,43 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# Check whether or not the Fortran compiler supports BIND(C) or not
# OMPI_FORTRAN_CHECK_BIND_C([action if found], [action if not found])
# ----------------------------------------------------
AC_DEFUN([OMPI_FORTRAN_CHECK_BIND_C],[
AS_VAR_PUSHDEF([bind_c_var], [ompi_cv_fortran_have_bind_c])
AC_CACHE_CHECK([if Fortran compiler supports BIND(C)], bind_c_var,
[AC_LANG_PUSH([Fortran])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[program check_for_bind_c
use, intrinsic :: iso_c_binding
type CType
integer(C_INT) :: i
end type
end program]])],
[AS_VAR_SET(bind_c_var, yes)],
[AS_VAR_SET(bind_c_var, no)])
AC_LANG_POP([Fortran])
])
AS_VAR_IF(bind_c_var, [yes], [$1], [$2])
AS_VAR_POPDEF([bind_c_var])dnl
])

View File

@ -0,0 +1,61 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
# Does this compiler support the Fortran 2008 assumed shape syntax?
# OMPI_FORTRAN_CHECK_F08_ASSUMED_SHAPE([action if found],
# [action if not found])
# ----------------------------------------------------------------
AC_DEFUN([OMPI_FORTRAN_CHECK_F08_ASSUMED_SHAPE], [
AS_VAR_PUSHDEF([fortran_f08_assumed_shape],
[ompi_cv_fortran_f08_assumed_shape])
AC_CACHE_CHECK([Fortran compiler F08 assumed shaped syntax],
fortran_f08_assumed_shape,
[_OMPI_FORTRAN_CHECK_F08_ASSUMED_SHAPE])
AS_VAR_IF(fortran_f08_assumed_shape, [yes], [$1], [$2])
])
###################################
AC_DEFUN([_OMPI_FORTRAN_CHECK_F08_ASSUMED_SHAPE], [
OPAL_VAR_SCOPE_PUSH([happy])
# If we were called here, it means that the value was not cached,
# so we need to check several different things. Since CACHE_CHECK
# puts up a MSG_CHECKING, we need to terminate it with a bogus
# answer before doing the individual checks.
AC_MSG_RESULT([not cached; checking])
# Check for the F08 type(*),dimension(..) syntax
OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB([!], [TYPE(*), DIMENSION(..)],
[TYPE(*), DIMENSION(..)],
[happy=yes], [happy=no])
AS_VAR_SET(fortran_f08_assumed_shape, [$happy]);
# Now put the orignal CACHE_CHECK MSG_CHECKING back so that it can
# output the MSG_RESULT.
AC_MSG_CHECKING([Fortran compiler F08 assumed shaped syntax])
OPAL_VAR_SCOPE_POP
])

View File

@ -0,0 +1,193 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
# Does this compiler support (void*)-like functionality for MPI choice
# buffers? If so, which flavor?
AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR], [
OPAL_VAR_SCOPE_PUSH([result happy type predecl])
OMPI_FORTRAN_IGNORE_TKR_PREDECL=
OMPI_FORTRAN_IGNORE_TKR_TYPE=
AS_VAR_PUSHDEF([fortran_ignore_tkr_data],
[ompi_cv_fortran_ignore_tkr_data])
# Note that we can only cache 1 value at a time, but this test
# needs to check for 2 things: the ignore TKR predecl and the
# type. So we encode them into a string of the form
# <1|0>:<type>:<predecl>. Ugh.
AC_CACHE_CHECK([Fortran compiler ignore TKR syntax],
fortran_ignore_tkr_data,
[_OMPI_FORTRAN_CHECK_IGNORE_TKR])
AS_VAR_COPY([result], [fortran_ignore_tkr_data])
# Parse the result
happy=`echo $result | cut -d: -f1`
type=`echo $result | cut -d: -f2`
predecl=`echo $result | cut -d: -f3-`
AS_IF([test $happy -eq 1],
[OMPI_FORTRAN_IGNORE_TKR_PREDECL=$predecl
OMPI_FORTRAN_IGNORE_TKR_TYPE=$type
$1],
[$2])
AS_VAR_POPDEF([fortran_ignore_tkr_data])
OPAL_VAR_SCOPE_POP
])
################
AC_DEFUN([_OMPI_FORTRAN_CHECK_IGNORE_TKR], [
OPAL_VAR_SCOPE_PUSH([happy ompi_fortran_ignore_tkr_predecl ompi_fortran_ignore_tkr_type])
# If we were called here, it means that the value was not cached,
# so we need to check several different things. Since CACHE_CHECK
# puts up a MSG_CHECKING, we need to terminate it with a bogus
# answer before doing the individual checks.
AC_MSG_RESULT([not cached; checking variants])
# Default values
ompi_fortran_ignore_tkr_predecl=!
ompi_fortran_ignore_tkr_type=real
# Vendor-neutral, TYPE(*) syntax
OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB(
[!], [type(*)],
[TYPE(*), DIMENSION(*)],
[happy=1], [happy=0])
# Intel compilers
AS_IF([test $happy -eq 0],
[OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB(
[!DEC\$ ATTRIBUTES NO_ARG_CHECK ::], [real, dimension(*)],
[!DEC\$ ATTRIBUTES NO_ARG_CHECK],
[happy=1], [happy=0])])
# Solaris Studio compilers
# Note that due to a compiler bug, we have been advised by Oracle to
# use the "character(*)" type
AS_IF([test $happy -eq 0],
[OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB(
[!\$PRAGMA IGNORE_TKR], [character(*)],
[!\$PRAGMA IGNORE_TKR],
[happy=1], [happy=0])])
# Cray compilers
AS_IF([test $happy -eq 0],
[OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB(
[!DIR\$ IGNORE_TKR], [real, dimension(*)],
[!DIR\$ IGNORE_TKR],
[happy=1], [happy=0])])
# IBM compilers
AS_IF([test $happy -eq 0],
[OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB(
[!IBM* IGNORE_TKR], [real, dimension(*)],
[!IBM* IGNORE_TKR],
[happy=1], [happy=0])])
AS_VAR_SET(fortran_ignore_tkr_data,
[${happy}:${ompi_fortran_ignore_tkr_type}:${ompi_fortran_ignore_tkr_predecl}])
# Now put the orignal CACHE_CHECK MSG_CHECKING back so that it can
# output the MSG_RESULT.
AC_MSG_CHECKING([Fortran compiler ignore TKR syntax])
OPAL_VAR_SCOPE_POP
])dnl
###################################
# Generic check to see if Fortran compiler supports (void*)-like
# functionality
# $1: pre-decl qualifier line -- likely a compiler directive
# $2: parameter type
# $3: message for AC-MSG-CHECKING
# $4: action to take if the test passes
# $5: action to take if the test fails
AC_DEFUN([OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB], [
OPAL_VAR_SCOPE_PUSH(msg)
AC_LANG_PUSH([Fortran])
AC_MSG_CHECKING([for Fortran compiler support of $3])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[[!
! Autoconf puts "program main" at the top
interface
subroutine force_assumed_shape(a, count)
integer :: count
complex, dimension(:,:) :: a
end subroutine force_assumed_shape
end interface
interface
subroutine foo(buffer, count)
$1 buffer
$2, intent(in) :: buffer
integer, intent(in) :: count
end subroutine foo
end interface
! Simple interface with an un-typed first argument (e.g., a choice buffer)
integer :: count
real :: buffer1(3)
character :: buffer2
complex :: buffer3(4,4)
complex, pointer, dimension(:,:) :: ptr
target :: buffer3
ptr => buffer3
! Set some known values (somewhat irrelevant for this test, but just be
! sure that the values are initialized)
a = 17
buffer1(1) = 4.5
buffer1(2) = 6.7
buffer1(3) = 8.9
buffer2 = 'a'
! Call with one type for the first argument
call foo(buffer1, count)
! Call with a different type for the first argument
call foo(buffer2, count)
! Force us through an assumed shape
call force_assumed_shape(buffer3, count)
! Force a pointer call through an assumed shape (!)
ptr => buffer3
end program
subroutine force_assumed_shape(a, count)
integer :: count
real, dimension(:,:) :: a
call foo(a, count)
end subroutine force_assumed_shape
! Autoconf puts "end" after the last line
subroutine bogus
]]),
[msg=yes
ompi_fortran_ignore_tkr_predecl="$1"
ompi_fortran_ignore_tkr_type="$2"
$4],
[msg=no
$5])
AC_MSG_RESULT($msg)
AC_LANG_POP([Fortran])
OPAL_VAR_SCOPE_POP
])

View File

@ -8,6 +8,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -15,13 +16,16 @@ dnl
dnl $HEADER$
dnl
AC_DEFUN([OMPI_F77_CHECK_LOGICAL_ARRAY],[
AC_DEFUN([OMPI_FORTRAN_CHECK_LOGICAL_ARRAY],[
AS_VAR_PUSHDEF([logical_array_var],
[ompi_cv_fortran_logical_array_correct])
AC_CACHE_CHECK([for correct handling of Fortran logical arrays],
[ompi_cv_f77_logical_array_correct],
[if test "$1" = "none" -o "$OMPI_WANT_F77_BINDINGS" = "0"; then
ompi_cv_f77_logical_array_correct=yes
logical_array_var,
[if test "$1" = "none" -o $OMPI_WANT_FORTRAN_BINDINGS -eq 0; then
value=skipped
else
OMPI_F77_MAKE_C_FUNCTION([ompi_check_logical_fn], [check])
OMPI_FORTRAN_MAKE_C_FUNCTION([ompi_check_logical_fn], [check])
# Fortran module
cat > conftestf.f <<EOF
@ -61,7 +65,7 @@ void $ompi_check_logical_fn(ompi_fortran_logical_t * logical)
if (!f) exit(1);
if (logical[[0]] == 0 &&
logical[[1]] == $ompi_cv_f77_true_value)
logical[[1]] == $ompi_cv_fortran_true_value)
result = 1;
fprintf(f, "%d\n", result);
}
@ -73,7 +77,7 @@ EOF
# Try the compilation and run. Can't use AC_TRY_RUN
# because it's two module files.
OPAL_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
[OPAL_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
[OPAL_LOG_COMMAND([$FC $FCFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
[happy=1], [happy=0])],
[happy=0])
if test "$happy" = "0" ; then
@ -82,19 +86,23 @@ EOF
AS_IF([test "$cross_compiling" = "yes"],
[ # assume we're ok
ompi_cv_f77_logical_array_correct=yes],
value=yes],
[OPAL_LOG_COMMAND([./conftest],
[if test "`cat conftestval`" = "1" ; then
ompi_cv_f77_logical_array_correct=yes
value=yes
else
ompi_cv_f77_logical_array_correct=no
value=no
fi],
[ompi_cv_f77_logical_array_correct=no])])
fi])
[value=no])])
fi
AS_VAR_SET(logical_array_var, [$value])
])
if test "$ompi_cv_f77_logical_array_correct" = "no" ; then
AS_VAR_COPY([ompi_fortran_logical_array_correct], [logical_array_var])
if test "$ompi_fortran_logical_array_correct" = "no" ; then
AC_MSG_ERROR([Error determining if arrays of logical values work properly.])
fi
AS_VAR_POPDEF([logical_array_var])
unset happy ompi_check_logical_fn
rm -rf conftest*

View File

@ -0,0 +1,106 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# Check whether or not the Fortran compiler supports optional
# arguments or not, and we (generally) don't need wrapper subroutines.
# OMPI_FORTRAN_CHECK_OPTIONAL_ARGS([action if found],
# [action if not found])
# ----------------------------------------------------
AC_DEFUN([OMPI_FORTRAN_CHECK_OPTIONAL_ARGS],[
unset happy
OPAL_VAR_SCOPE_PUSH([happy ompi_conftest_h])
AC_CACHE_CHECK([if Fortran compiler supports optional arguments],
[ompi_cv_fortran_optional_args],
[ompi_cv_fortran_optional_args=no
OMPI_FORTRAN_MAKE_C_FUNCTION([ompi_ac_check_op_fn], [check_op])
cat > conftestf.f90 <<EOF
program check_for_optional
use, intrinsic :: iso_c_binding
interface
subroutine check_op(i, ierror)
integer, intent(in), value :: i
integer, intent(out), optional :: ierror
end subroutine check_op
end interface
integer :: ierror
call check_op(0)
call check_op(1, ierror)
end program
EOF
# C module
if test -f conftest.h; then
ompi_conftest_h="#include \"conftest.h\""
else
ompi_conftest_h=""
fi
cat > conftest.c <<EOF
#include <stdio.h>
#include <stdlib.h>
$ompi_conftest_h
#ifdef __cplusplus
extern "C" {
#endif
void $ompi_ac_check_op_fn(int has_op, int *ierror)
{
/* Force a segv if the conditions are wrong */
char *bogus = 0;
if (0 == has_op) {
/* won't have optional argument */
if (NULL != ierror) *bogus= 13;
} else {
/* will have optional argument */
if (NULL == ierror) *bogus= 13;
*ierror = 33;
}
}
#ifdef __cplusplus
}
#endif
EOF
OPAL_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
[OPAL_LOG_COMMAND([$FC $FCFLAGS conftestf.f90 conftest.o -o conftest $LDFLAGS $LIBS],
[happy="yes"], [happy="no"])], [happy="no"])
if test "$happy" = "no" ; then
AC_MSG_RESULT([Error!])
AC_MSG_ERROR([Could not determine if Fortran compiler supports optional arguments])
fi
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_RESULT([Error!])
AC_MSG_ERROR([Can not determine if Fortran compiler supports optional arguments when cross-compiling])],
[OPAL_LOG_COMMAND([./conftest],
[ompi_cv_fortran_optional_args=yes])
])
rm -f conftest*
])dnl
AS_VAR_COPY([happy], [ompi_cv_fortran_optional_args])
AS_IF([test "$happy" = "yes"], [$1], [$2])
OPAL_VAR_SCOPE_POP
])

View File

@ -0,0 +1,47 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# Check whether or not the Fortran compiler supports the "private"
# keyword in derived types or not.
# OMPI_FORTRAN_CHECK_PRIVATE([action if found],
# [action if not found])
# ----------------------------------------------------
AC_DEFUN([OMPI_FORTRAN_CHECK_PRIVATE],[
AS_VAR_PUSHDEF([private_var], [ompi_cv_fortran_private])
AC_CACHE_CHECK([if Fortran compiler supports private], private_var,
[AC_LANG_PUSH([Fortran])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[module test_for_private
type :: derived_with_private
integer :: this_is_a_public_integer
integer, private :: this_is_a_private_integer
end type derived_with_private
end module test_for_private]])],
[AS_VAR_SET(private_var, yes)],
[AS_VAR_SET(private_var, no)])
touch conftest_foo.mod
rm -rf *.mod 2>/dev/null
AC_LANG_POP([Fortran])
])
AS_VAR_IF(private_var, [yes], [$1], [$2])
AS_VAR_POPDEF([private_var])dnl
])

View File

@ -0,0 +1,56 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# Check whether or not the Fortran compiler supports the "procedure"
# keyword in derived types or not.
# OMPI_FORTRAN_CHECK_PROCEDURE([action if found],
# [action if not found])
# ----------------------------------------------------
AC_DEFUN([OMPI_FORTRAN_CHECK_PROCEDURE],[
AS_VAR_PUSHDEF([procedure_var], [ompi_cv_fortran_procedure])
AC_CACHE_CHECK([if Fortran compiler supports procedure], procedure_var,
[AC_LANG_PUSH([Fortran])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[MODULE proc_mod
INTERFACE
SUBROUTINE MPI_User_function
END SUBROUTINE
END INTERFACE
END MODULE proc_mod
PROGRAM test_proc
INTERFACE
SUBROUTINE binky(user_fn)
USE proc_mod
PROCEDURE(MPI_User_function) :: user_fn
END SUBROUTINE
END INTERFACE
END PROGRAM]])],
[AS_VAR_SET(procedure_var, yes)],
[AS_VAR_SET(procedure_var, no)])
touch conftest_foo.mod
rm -rf *.mod 2>/dev/null
AC_LANG_POP([Fortran])
])
AS_VAR_IF(procedure_var, [yes], [$1], [$2])
AS_VAR_POPDEF([procedure_var])dnl
])

View File

@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -18,9 +18,9 @@ dnl
dnl $HEADER$
dnl
# OMPI_F77_CHECK_REAL16_C_EQUIV
# OMPI_FORTRAN_CHECK_REAL16_C_EQUIV
# ----------------------------------------------------
AC_DEFUN([OMPI_F77_CHECK_REAL16_C_EQUIV],[
AC_DEFUN([OMPI_FORTRAN_CHECK_REAL16_C_EQUIV],[
unset happy
unset CFLAGS_save
OPAL_VAR_SCOPE_PUSH([happy define_value msg CFLAGS_save])
@ -28,14 +28,14 @@ AC_DEFUN([OMPI_F77_CHECK_REAL16_C_EQUIV],[
# We have to do this as a cache check for cross-compilation platforms
AC_CACHE_CHECK([for C type matching bit representation of REAL*16],
[real16_matches_c_var],
[AS_IF([test "$OMPI_WANT_F77_BINDINGS" = "1" -a "$OMPI_HAVE_FORTRAN_REAL16" = "1"],[
real16_matches_c_var,
[AS_IF([test "$OMPI_WANT_FORTRAN_BINDINGS" = "1" -a "$OMPI_HAVE_FORTRAN_REAL16" = "1"],[
# AC_CACHE_CHECK automatically does its own AC_MSG_CHECKING, so close it out
AC_MSG_RESULT([pending])
# First check the type that we found was the same length in C
AC_MSG_CHECKING([if $OMPI_FORTRAN_REAL16_C_TYPE == REAL*16])
OMPI_F77_CHECK_REAL16_EQUIV_TYPE([$OMPI_FORTRAN_REAL16_C_TYPE], [L])
OMPI_FORTRAN_CHECK_REAL16_EQUIV_TYPE([$OMPI_FORTRAN_REAL16_C_TYPE], [L])
# If that didn't work, see if we have a compiler-specific
# time that might work
AS_IF([test "$happy" = "no"],
@ -46,7 +46,7 @@ AC_DEFUN([OMPI_F77_CHECK_REAL16_C_EQUIV],[
CFLAGS_save="$CFLAGS"
CFLAGS="$CFLAGS -Qoption,cpp,--extended_float_types"
OPAL_UNIQ([CFLAGS])
OMPI_F77_CHECK_REAL16_EQUIV_TYPE([_Quad], [q])
OMPI_FORTRAN_CHECK_REAL16_EQUIV_TYPE([_Quad], [q])
AS_IF([test "$happy" = "yes"],
[OMPI_FORTRAN_REAL16_C_TYPE="_Quad"
AC_MSG_RESULT([works!])],
@ -56,7 +56,7 @@ AC_DEFUN([OMPI_F77_CHECK_REAL16_C_EQUIV],[
AS_IF([test "$ompi_cv_c_compiler_vendor" = "gnu" -a "$ac_cv_type___float128" = "yes"],
[AC_MSG_CHECKING([if gnu compiler __float128 == REAL*16])
OPAL_UNIQ([CFLAGS])
OMPI_F77_CHECK_REAL16_EQUIV_TYPE([__float128], [q])
OMPI_FORTRAN_CHECK_REAL16_EQUIV_TYPE([__float128], [q])
AS_IF([test "$happy" = "yes"],
[OMPI_FORTRAN_REAL16_C_TYPE="__float128"
AC_MSG_RESULT([works!])],
@ -69,7 +69,7 @@ AC_DEFUN([OMPI_F77_CHECK_REAL16_C_EQUIV],[
AS_VAR_SET(real16_matches_c_var, [$happy])
],[
# No fortran bindings or no REAL*16
AS_IF([test "$OMPI_WANT_F77_BINDINGS" = "0"],
AS_IF([test "$OMPI_WANT_FORTRAN_BINDINGS" = "0"],
[msg="skipped (no Fortran MPI bindings)"],
[msg="skipped (no REAL*16)"])
AS_VAR_SET(real16_matches_c_var, [$msg])
@ -89,9 +89,9 @@ AC_DEFUN([OMPI_F77_CHECK_REAL16_C_EQUIV],[
])
# OMPI_F77_CHECK_REAL16_C_EQUIV_TYPE(type, suffix)
# OMPI_FORTRAN_CHECK_REAL16_C_EQUIV_TYPE(type, suffix)
# ----------------------------------------------------
AC_DEFUN([OMPI_F77_CHECK_REAL16_EQUIV_TYPE],[
AC_DEFUN([OMPI_FORTRAN_CHECK_REAL16_EQUIV_TYPE],[
# C module
cat > conftest_c.c <<EOF
#include <stdio.h>
@ -129,9 +129,8 @@ EOF
rm -f conftestval
# Compile and link
OPAL_LOG_COMMAND([$CC $CFLAGS -I. -c conftest_c.c],
[OPAL_LOG_COMMAND([$F77 $FFLAGS conftest_f.f conftest_c.o -o conftest $LDFLAGS $LIBS],
[OPAL_LOG_COMMAND([$FC $FCFLAGS conftest_f.f conftest_c.o -o conftest $LDFLAGS $LIBS],
[happy="yes"], [happy="no"])], [happy="no"])
AS_IF([test "$happy" = "no"],
[AC_MSG_RESULT([Could not determine if REAL*16 bit-matches C type])],
# If it worked so far, try running to see what we get

View File

@ -10,6 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -17,26 +18,26 @@ dnl
dnl $HEADER$
dnl
# OMPI_F90_CHECK_TYPE([type, action if found, action if not found])
# OMPI_FORTRAN_CHECK_TYPE([type, action if found, action if not found])
# -----------------------------------------------------------------
AC_DEFUN([OMPI_F90_CHECK_TYPE],[
AC_DEFUN([OMPI_FORTRAN_CHECK_TYPE],[
# Use of m4_translit suggested by Eric Blake:
# http://lists.gnu.org/archive/html/bug-autoconf/2010-10/msg00016.html
AS_VAR_PUSHDEF([type_var],
m4_translit([[ompi_cv_f90_have_$1]], [*], [p]))
m4_translit([[ompi_cv_fortran_have_$1]], [*], [p]))
# Determine Fortran datatype size.
# First arg is type, 2nd arg is config var to define
AC_CACHE_CHECK([if Fortran 90 compiler supports $1], type_var,
AC_CACHE_CHECK([if Fortran compiler supports $1], type_var,
[AC_LANG_PUSH([Fortran])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[program main
$1 :: x
end]])],
[AS_VAR_SET(type_var, "yes")],
[AS_VAR_SET(type_var, "no")])
$1 :: bogus_variable
end program]])],
[AS_VAR_SET(type_var, yes)],
[AS_VAR_SET(type_var, no)])
AC_LANG_POP([Fortran])])
AS_VAR_IF(type_var, [yes], [$2], [$3])
AS_VAR_POPDEF([type_var])dnl
])dnl

View File

@ -11,7 +11,7 @@ dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
dnl Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -20,20 +20,20 @@ dnl $HEADER$
dnl
AC_DEFUN([OMPI_F77_FIND_EXT_SYMBOL_CONVENTION], [
AC_DEFUN([OMPI_FORTRAN_FIND_EXT_SYMBOL_CONVENTION], [
AC_REQUIRE([AC_PROG_NM])
AC_REQUIRE([AC_PROG_GREP])
OPAL_VAR_SCOPE_PUSH([FFLAGS_NEW LDFLAGS_NEW FLAG])
OPAL_VAR_SCOPE_PUSH([FCFLAGS_NEW LDFLAGS_NEW FLAG])
# invalidate cache if result came from a run where F77 was disabled
if test "$ompi_cv_f77_external_symbol" = "skipped" ; then
unset ompi_cv_f77_external_symbol
# invalidate cache if result came from a run where FORTRAN was disabled
if test "$ompi_cv_fortran_external_symbol" = "skipped" ; then
unset ompi_cv_fortran_external_symbol
fi
AC_CACHE_CHECK([$F77 external symbol convention],
[ompi_cv_f77_external_symbol],
[if test "$F77" = "none" -o "$OMPI_WANT_F77_BINDINGS" = "0"; then
ompi_cv_f77_external_symbol="skipped"
AC_CACHE_CHECK([$FORTRAN external symbol convention],
[ompi_cv_fortran_external_symbol],
[if test "$FC" = "none" -o "$OMPI_WANT_FORTRAN_BINDINGS" = "0"; then
ompi_cv_fortran_external_symbol="skipped"
else
cat >conftest.f <<EOF
subroutine FOO_bar(a)
@ -45,15 +45,15 @@ EOF
# Try without certain optimization flags, which produce object
# files without the required external symbols;
# e.g. option -fast turns on -ipo on Intel Compilers 11.0
FFLAGS_NEW=""
FCFLAGS_NEW=""
LDFLAGS_NEW=""
case $F77 in
case $FC in
ifort)
for FLAG in $FFLAGS ; do
for FLAG in $FCFLAGS ; do
case $FLAG in
-fast) ;;
-ipo*) ;;
*) FFLAGS_NEW="$FFLAGS_NEW $FLAG" ;;
*) FCFLAGS_NEW="$FCFLAGS_NEW $FLAG" ;;
esac
done
for FLAG in $LDFLAGS ; do
@ -63,26 +63,26 @@ EOF
*) LDFLAGS_NEW="$LDFLAGS_NEW $FLAG" ;;
esac
done
OPAL_LOG_MSG([Try with new FFLAGS: $FFLAGS_NEW and new LDFLAGS:$LDFLAGS_NEW])
OPAL_LOG_MSG([Try with new FCFLAGS: $FCFLAGS_NEW and new LDFLAGS:$LDFLAGS_NEW])
;;
*)
FFLAGS_NEW="$FFLAGS"
FCFLAGS_NEW="$FCFLAGS"
LDFLAGS_NEW="$LDFLAGS"
;;
esac
happy=1
OPAL_LOG_COMMAND([$F77 $FFLAGS_NEW -c conftest.f $LDFLAGS_NEW $LIBS],
OPAL_LOG_COMMAND([$FC $FCFLAGS_NEW -c conftest.f $LDFLAGS_NEW $LIBS],
[if $NM conftest.o | $GREP foo_bar__ >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="double underscore"
ompi_cv_fortran_external_symbol="double underscore"
elif $NM conftest.o | $GREP foo_bar_ >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="single underscore"
ompi_cv_fortran_external_symbol="single underscore"
elif $NM conftest.o | $GREP FOO_bar >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="mixed case"
ompi_cv_fortran_external_symbol="mixed case"
elif $NM conftest.o | $GREP foo_bar >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="no underscore"
ompi_cv_fortran_external_symbol="no underscore"
elif $NM conftest.o | $GREP FOO_BAR >/dev/null 2>&1 ; then
ompi_cv_f77_external_symbol="upper case"
ompi_cv_fortran_external_symbol="upper case"
else
$NM conftest.o >conftest.out 2>&1
OPAL_LOG_MSG([Could not determine Fortran naming convention. Output from $NM:])
@ -92,45 +92,31 @@ EOF
[AC_MSG_ERROR([Fortran compiler did not produce object file])])
fi])
ompi_fortran_double_underscore=0
ompi_fortran_single_underscore=0
ompi_fortran_caps=0
ompi_fortran_plain=0
if test "$ompi_cv_f77_external_symbol" = "double underscore" ; then
# These values were all already set to 0 back up in
# ompi_setup_mpi_fortran.m4, because this whole macro is
# conditionally executed (i.e., it is not executed in the
# --disable-mpi-fortran case).
if test "$ompi_cv_fortran_external_symbol" = "double underscore" ; then
ompi_fortran_double_underscore=1
elif test "$ompi_cv_f77_external_symbol" = "single underscore" ; then
elif test "$ompi_cv_fortran_external_symbol" = "single underscore" ; then
ompi_fortran_single_underscore=1
elif test "$ompi_cv_f77_external_symbol" = "mixed case" ; then
elif test "$ompi_cv_fortran_external_symbol" = "mixed case" ; then
ompi_fortran_caps=1
elif test "$ompi_cv_f77_external_symbol" = "no underscore" ; then
elif test "$ompi_cv_fortran_external_symbol" = "no underscore" ; then
ompi_fortran_plain=1
elif test "$ompi_cv_f77_external_symbol" = "upper case" ; then
elif test "$ompi_cv_fortran_external_symbol" = "upper case" ; then
ompi_fortran_caps=1
elif test "$ompi_cv_f77_external_symbol" != "skipped" ; then
AC_MSG_ERROR([unknown naming convention: $ompi_cv_f77_external_symbol])
elif test "$ompi_cv_fortran_external_symbol" != "skipped" ; then
AC_MSG_ERROR([unknown naming convention: $ompi_cv_fortran_external_symbol])
fi
AC_DEFINE_UNQUOTED([OMPI_F77_DOUBLE_UNDERSCORE],
[$ompi_fortran_double_underscore],
[Whether fortran symbols have a trailing double underscore or not])
AC_DEFINE_UNQUOTED([OMPI_F77_SINGLE_UNDERSCORE],
[$ompi_fortran_single_underscore],
[Whether fortran symbols have a trailing underscore or not])
AC_DEFINE_UNQUOTED([OMPI_F77_CAPS],
[$ompi_fortran_caps],
[Whether fortran symbols are all caps or not])
AC_DEFINE_UNQUOTED([OMPI_F77_PLAIN],
[$ompi_fortran_plain],
[Whether fortran symbols have no trailing underscore or not])
OPAL_VAR_SCOPE_POP
rm -rf conftest.*
])dnl
AC_DEFUN([OMPI_F77_MAKE_C_FUNCTION], [
if test "$ompi_cv_f77_external_symbol" = "double underscore" ; then
AC_DEFUN([OMPI_FORTRAN_MAKE_C_FUNCTION], [
if test "$ompi_cv_fortran_external_symbol" = "double underscore" ; then
# so the general rule is that if there is an _ in the function
# name, then there are two trailing underscores. Otherwise,
# there is only one trailing underscore. Any idea how to do
@ -140,15 +126,15 @@ AC_DEFUN([OMPI_F77_MAKE_C_FUNCTION], [
else
$1[=]m4_translit([$2], [A-Z], [a-z])[_]
fi
elif test "$ompi_cv_f77_external_symbol" = "single underscore" ; then
elif test "$ompi_cv_fortran_external_symbol" = "single underscore" ; then
$1[=]m4_translit([$2], [A-Z], [a-z])[_]
elif test "$ompi_cv_f77_external_symbol" = "mixed case" ; then
elif test "$ompi_cv_fortran_external_symbol" = "mixed case" ; then
$1[=]$2
elif test "$ompi_cv_f77_external_symbol" = "no underscore" ; then
elif test "$ompi_cv_fortran_external_symbol" = "no underscore" ; then
$1[=]m4_translit([$2], [A-Z], [a-z])
elif test "$ompi_cv_f77_external_symbol" = "upper case" ; then
elif test "$ompi_cv_fortran_external_symbol" = "upper case" ; then
$1[=]m4_translit([$2], [a-z], [A-Z])
else
AC_MSG_ERROR([unknown naming convention: $ompi_cv_f77_external_symbol])
AC_MSG_ERROR([unknown naming convention: $ompi_cv_fortran_external_symbol])
fi
])

View File

@ -0,0 +1,83 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
#
# Sets and AC_SUBST's OMPI_FC_MODULE_FLAG.
#
# OMPI_FORTRAN_FIND_MODULE_INCLUDE_FLAG([action if found], [action if not found]
AC_DEFUN([OMPI_FORTRAN_FIND_MODULE_INCLUDE_FLAG],[
AS_VAR_PUSHDEF([fortran_inc_var], [ompi_cv_fortran_module_include_flag])
OMPI_FC_MODULE_FLAG=
AC_CACHE_CHECK([for Fortran compiler module include flag],
fortran_inc_var,
[ofi_possible_flags="-I -p -M"
mkdir conftest.$$
cd conftest.$$
# Try to compile a Fortran module
mkdir subdir
cd subdir
cat > conftest-module.f90 <<EOF
module OMPI_MOD_FLAG
type OMPI_MOD_FLAG_TYPE
integer :: i
end type OMPI_MOD_FLAG_TYPE
end module OMPI_MOD_FLAG
EOF
OPAL_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 -c conftest-module.f90 $LDFLAGS $LIBS], ,
[cd ..
rm -rf conftest.$$
AC_MSG_RESULT([Whoops!])
AC_MSG_WARN([*** Cannot seem to compile a Fortran module])
AC_MSG_ERROR([Cannot continue])])
cd ..
#
# Now try to compile a simple program usinng that module, iterating
# through the possible flags that the compiler might use
#
cat > conftest.f90 <<EOF
program fortranusemodule
use OMPI_MOD_FLAG
end program fortranusemodule
EOF
ofi_module_flag=
for flag in $ofi_possible_flags; do
if test "$ofi_module_flag" = ""; then
OPAL_LOG_COMMAND([$FC $FCFLAGS $FCFLAGS_f90 conftest.f90 ${flag}subdir $LDFLAGS $LIBS],
[AS_VAR_SET(fortran_inc_var, [$flag])
ofi_module_flag="$flag"])
fi
done
cd ..
rm -rf conftest.$$
])
AS_VAR_COPY([OMPI_FC_MODULE_FLAG], [fortran_inc_var])
AC_SUBST(OMPI_FC_MODULE_FLAG)
AS_VAR_POPDEF([fortran_inc_var])
AS_IF([test "$OMPI_FC_MODULE_FLAG" != ""],
[$1], [$2])
])dnl

View File

@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -18,19 +18,53 @@ dnl
dnl $HEADER$
dnl
# OMPI_F77_GET_ALIGNMENT(type, shell variable to set)
# This is a long, sordid tale.
# We have been unable to devise a F90 test that will result in a
# consistent alignment answer. Specifically, our prior tests have
# been similar to the prior f77 test -- have a small chunk of f90 code
# compiled with the C code to actually compute the offsets. The f90
# code was a struct-like entity (a "type") with multiple members -- on
# a character and the other of the target type. The C code measured
# the distance between them. But even if you use the keyword to
# ensure that the F90 compiler does not re-order this struct, you may
# still get a different alignment answer than the F77 test (!). This
# is apparently because F90 allows compilers to align types
# differently according to use (in common blocks, as standalone
# variables, and as a member of a struct). Hence, the alignment can
# be different depending on how to measure (and use) it. This was
# confirmed by various members of the Fortran committee and several
# Fortran compiler vendors.
# We use to check the F77 alignment based on common block usage, but
# this is only one of the available types for F90. Hence, we may
# actually get a different answer between f77 and f90 in the same
# compiler series (and some compilers do! E.g., g95 gives different
# answers even when "g95" itself is used as both the f77 and f90
# compiler).
# So we gave up -- the only thing we can do (and has worked for years)
# is to check Fortran alignment in common blocks when compiled with .f
# files (not .f90).
# Indeed, just because data is coming from the mpif.h bindings doesn't
# mean it wasn't compiled with the f90 (or later) compiler. So
# there's no way to tell -- just hope that common block alignment is
# good enough. :-(
# OMPI_FORTRAN_GET_ALIGNMENT(type, shell variable to set)
# ----------------------------------------------------
AC_DEFUN([OMPI_F77_GET_ALIGNMENT],[
AC_DEFUN([OMPI_FORTRAN_GET_ALIGNMENT],[
unset happy
OPAL_VAR_SCOPE_PUSH([happy ompi_conftest_h])
# Use of m4_translit suggested by Eric Blake:
# http://lists.gnu.org/archive/html/bug-autoconf/2010-10/msg00016.html
AS_VAR_PUSHDEF([type_var],
m4_translit([[ompi_cv_f77_alignment_$1]], [*], [p]))
m4_translit([[ompi_cv_fortran_alignment_$1]], [*], [p]))
AC_CACHE_CHECK([alignment of Fortran $1], type_var,
[OMPI_F77_MAKE_C_FUNCTION([ompi_ac_align_fn], [align])
# Fortran module
[OMPI_FORTRAN_MAKE_C_FUNCTION([ompi_ac_align_fn], [align])
# Fortran module. Make sure it's .f, not .f90.
cat > conftestf.f <<EOF
program falign
external align
@ -77,7 +111,7 @@ void $ompi_ac_align_fn(char *w, char *x, char *y, char *z)
EOF
OPAL_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
[OPAL_LOG_COMMAND([$F77 $FFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
[OPAL_LOG_COMMAND([$FC $FCFLAGS conftestf.f conftest.o -o conftest $LDFLAGS $LIBS],
[happy="yes"], [happy="no"])], [happy="no"])
if test "$happy" = "no" ; then

View File

@ -10,6 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -17,26 +18,29 @@ dnl
dnl $HEADER$
dnl
# OMPI_F77_GET_FORTRAN_HANDLE_MAX()
# OMPI_FORTRAN_GET_HANDLE_MAX()
# ---------------------------------------------------------------
# Find the maximum value of fortran integers, then calculate
# min(INT_MAX, max fortran INTEGER). This represents the maximum
# number of fortran MPI handle index.
AC_DEFUN([OMPI_F77_GET_FORTRAN_HANDLE_MAX],[
AC_DEFUN([OMPI_FORTRAN_GET_HANDLE_MAX],[
AS_VAR_PUSHDEF([fortran_handle_max_var],
[ompi_cv_fortran_handle_max])
AC_CACHE_CHECK([for max Fortran MPI handle index],
[ompi_cv_f77_fortran_handle_max],
fortran_handle_max_var,
[ # Find max fortran INTEGER value. Set to sentinel value if we don't
# have a Fortran compiler (e.g., if --disable-f77 was given).
if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then
# have a Fortran compiler (e.g., if --disable-fortran was given).
if test $OMPI_WANT_FORTRAN_BINDINGS -eq 0; then
ompi_fint_max=0
else
# Calculate the number of f's that we need to append to the hex
# value. Do one less than we really need becaue we assume the
# top nybble is 0x7 to avoid sign issues.
ompi_numf=`expr $OMPI_SIZEOF_FORTRAN_INTEGER \* 2 - 1`
ompi_fint_max=0x7
while test "$ompi_numf" -gt "0"; do
ompi_fint_max=${ompi_fint_max}f
ompi_numf=`expr $OMPI_SIZEOF_FORTRAN_INTEGER \* 8 - 1`
ompi_fint_max=1
while test $ompi_numf -gt 0; do
ompi_fint_max=`expr $ompi_fint_max \* 2`
ompi_numf=`expr $ompi_numf - 1`
done
fi
@ -54,29 +58,35 @@ fclose(fp);]])],
[ompi_cint_max=`cat conftest.out`],
[ompi_cint_max=0],
[ #cross compiling is fun. compute INT_MAX same as INTEGER max
ompi_numf=`expr $ac_cv_sizeof_int \* 2 - 1`
ompi_cint_max=0x7
while test "$ompi_numf" -gt "0" ; do
ompi_cint_max=${ompi_cint_max}f
ompi_numf=`expr $ac_cv_sizeof_int \* 8 - 1`
ompi_cint_max=1
while test $ompi_numf -gt 0 ; do
ompi_cint_max=`expr $ompi_cint_max \* 2`
ompi_numf=`expr $ompi_numf - 1`
done])
if test "$ompi_cint_max" = "0" ; then
if test $ompi_cint_max -eq 0 ; then
# wow - something went really wrong. Be conservative
ompi_cv_f77_fortran_handle_max=32767
elif test "$ompi_fint_max" = "0" ; then
value=32767
elif test $ompi_fint_max -eq 0 ; then
# we aren't compiling Fortran - just set it to C INT_MAX
ompi_cv_f77_fortran_handle_max=$ompi_cint_max
value=$ompi_cint_max
else
# take the lesser of C INT_MAX and Fortran INTEGER
# max. The resulting value will then be storable in
# either type. There's no easy way to do this in
# the shell, so make the preprocessor do it.
ompi_cv_f77_fortran_handle_max="( $ompi_fint_max < $ompi_cint_max ? $ompi_fint_max : $ompi_cint_max )"
# either type.
value=$ompi_fint_max
if test $ompi_cint_max -lt $value; then
value=$ompi_cint_max
fi
fi
rm -f conftest.out > /dev/null 2>&1 ])
AS_VAR_SET(fortran_handle_max_var, [$value])
rm -f conftest.out > /dev/null 2>&1
unset value])
AS_VAR_COPY([ompi_fortran_handle_max], [fortran_handle_max_var])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_HANDLE_MAX],
[$ompi_cv_f77_fortran_handle_max],
[$ompi_fortran_handle_max],
[Max handle value for fortran MPI handles, effectively min(INT_MAX, max fortran INTEGER value)])
AS_VAR_POPDEF([fortran_handle_max_var])
])dnl

View File

@ -0,0 +1,58 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OMPI_FORTRAN_GET_KIND_VALUE(kind, variable to set)
# --------------------------------------------------------
AC_DEFUN([OMPI_FORTRAN_GET_KIND_VALUE],[
# Use of m4_translit suggested by Eric Blake:
# http://lists.gnu.org/archive/html/bug-autoconf/2010-10/msg00016.html
AS_VAR_PUSHDEF([kind_value_var],
m4_translit([[ompi_cv_fortran_kind_value_$1]], [*], [p]))
rm -f conftest.out
AC_CACHE_CHECK([KIND value of Fortran $1], kind_value_var,
[if test $OMPI_WANT_FORTRAN_BINDINGS -eq 0 ; then
value=skipped
else
AC_LANG_PUSH([Fortran])
value=
AC_RUN_IFELSE(AC_LANG_PROGRAM(, [[
use, intrinsic :: ISO_C_BINDING
open(unit = 7, file = "conftest.out")
write(7, *) $1
close(7)
]]), [value=`cat conftest.out | awk '{print [$]1}'`], [value=no], [value=cross])
fi
AS_IF([test "$value" = "no"],
[AC_MSG_WARN([Could not determine KIND value of $1])
AC_MSG_WARN([See config.log for more details])
AC_MSG_ERROR([Cannot continue])])
AS_IF([test "$value" = "cross"],
[AC_MSG_ERROR([Can not determine KIND value of $1 when cross-compiling])])
AS_VAR_SET(kind_value_var, [$value])
AC_LANG_POP([Fortran])
unset value
])
AS_VAR_COPY([$2], [kind_value_var])
AS_VAR_POPDEF([kind_value_var])
])dnl

View File

@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -18,21 +18,22 @@ dnl
dnl $HEADER$
dnl
# OMPI_F90_GET_SIZEOF(type, variable to set)
# OMPI_FORTRAN_GET_SIZEOF(prologue, type, variable to set)
# ------------------------------------------
AC_DEFUN([OMPI_F90_GET_SIZEOF],[
AC_DEFUN([OMPI_FORTRAN_GET_SIZEOF],[
# Use of m4_translit suggested by Eric Blake:
# http://lists.gnu.org/archive/html/bug-autoconf/2010-10/msg00016.html
AS_VAR_PUSHDEF([type_var],
m4_translit([[ompi_cv_f90_sizeof_$1]], [*], [p]))
m4_translit([[ompi_cv_fortran_sizeof_$2]], [*], [p]))
AC_CACHE_CHECK([size of Fortran 90 $1], type_var,
[OMPI_F77_MAKE_C_FUNCTION([ompi_ac_size_fn], [size])
AC_CACHE_CHECK([size of Fortran $2], type_var,
[OMPI_FORTRAN_MAKE_C_FUNCTION([ompi_ac_size_fn], [size])
# Fortran module
cat > conftestf.f90 <<EOF
program fsize
$1
external size
$1 :: x(2)
$2 :: x(2)
call size(x(1),x(2))
end program
EOF
@ -68,22 +69,22 @@ EOF
[happy="yes"], [happy="no"])], [happy="no"])
if test "$happy" = "no" ; then
OPAL_LOG_MSG([here is the fortran 90 program:], 1)
OPAL_LOG_MSG([here is the Fortran program:], 1)
OPAL_LOG_FILE([conftestf.f90])
AC_MSG_WARN([Could not determine size of $1])
AC_MSG_WARN([Could not determine size of $2])
AC_MSG_WARN([See config.log for details])
AC_MSG_ERROR([Cannot continue])
fi
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine size of $1 when cross-compiling])],
[AC_MSG_ERROR([Can not determine size of $2 when cross-compiling])],
[OPAL_LOG_COMMAND([./conftest],
[AS_VAR_SET(type_var, [`cat conftestval`])],
[AC_MSG_ERROR([Could not determine size of $1])])])
[AC_MSG_ERROR([Could not determine size of $2])])])
unset happy ompi_conftest_h
rm -rf conftest*])
AS_VAR_COPY([$2], [type_var])
AS_VAR_COPY([$3], [type_var])
AS_VAR_POPDEF([type_var])dnl
])dnl

View File

@ -8,6 +8,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -16,21 +17,24 @@ dnl $HEADER$
dnl
# OMPI_F77_GET_VALUE_TRUE()
# OMPI_FORTRAN_GET_VALUE_TRUE()
# -------------------------------------------------------
# Determine the value of .TRUE. of this Fortran compiler.
AC_DEFUN([OMPI_F77_GET_VALUE_TRUE],[
# invalidate cache if result came from a run where F77 was disabled
if test "$ompi_cv_f77_true_value" = "0" ; then
unset ompi_cv_f77_true_value
AC_DEFUN([OMPI_FORTRAN_GET_VALUE_TRUE],[
# invalidate cache if result came from a run where FORTRAN was disabled
if test "$ompi_cv_fortran_true_value" = "0" ; then
unset ompi_cv_fortran_true_value
fi
AS_VAR_PUSHDEF([fortran_true_var],
[ompi_cv_fortran_true_value])
AC_CACHE_CHECK([Fortran value for .TRUE. logical type],
[ompi_cv_f77_true_value],
[if test "$1" = "none" -o "$OMPI_WANT_F77_BINDINGS" = "0" ; then
ompi_cv_f77_true_value=0
fortran_true_var,
[if test "$1" = "none" -o $OMPI_WANT_FORTRAN_BINDINGS -eq 0 ; then
value=77
else
OMPI_F77_MAKE_C_FUNCTION([ompi_print_logical_fn], [print])
OMPI_FORTRAN_MAKE_C_FUNCTION([ompi_print_logical_fn], [print])
#
# C module
@ -90,7 +94,7 @@ EOF
# Try the compilation and run.
#
OPAL_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
[OPAL_LOG_COMMAND([$F77 $FFLAGS -o conftest conftest.o conftestf.f $LDFLAGS $LIBS],
[OPAL_LOG_COMMAND([$FC $FCFLAGS -o conftest conftest.o conftestf.f $LDFLAGS $LIBS],
[happy=1], [happy=0])],
[happy=0])
@ -101,13 +105,18 @@ EOF
AS_IF([test "$cross_compiling" = "yes"],
[AC_MSG_ERROR([Can not determine value of .TRUE. when cross-compiling])],
[OPAL_LOG_COMMAND([./conftest],
[ompi_cv_f77_true_value=`sed 's/ *//' conftestval`],
[value=`sed 's/ *//' conftestval`],
[AC_MSG_ERROR([Could not determine value of Fotran .TRUE.. Aborting.])])])
fi])
fi
AS_VAR_SET(fortran_true_var, [$value])
unset value
])
AS_VAR_COPY([ompi_fortran_true_value], [fortran_true_var])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_VALUE_TRUE],
[$ompi_cv_f77_true_value],
[$ompi_fortran_true_value],
[Fortran value for LOGICAL .TRUE. value])
AS_VAR_POPDEF([fortran_true_var])
unset happy ompi_print_logical_fn
rm -rf conftest*

View File

@ -89,81 +89,31 @@ AC_DEFINE_UNQUOTED([OMPI_WANT_PERUSE],
AM_CONDITIONAL(WANT_PERUSE, test "$WANT_PERUSE" = "1")
#
# Fortran 77
# Fortran MPI bindings
#
AC_MSG_CHECKING([if want Fortran 77 bindings])
AC_ARG_ENABLE(mpi-f77,
AC_HELP_STRING([--enable-mpi-f77],
[enable f77 MPI bindings (default: enabled)]))
if test "$enable_mpi_f77" != "no"; then
# JMS Add more here for granulatiry of specifically which bindings to build
#
AC_MSG_CHECKING([if want Fortran MPI bindings])
AC_ARG_ENABLE(mpi-fortran,
AC_HELP_STRING([--enable-mpi-fortran],
[enable Fortran MPI bindings (default: enabled if Fortran compiler found)]))
if test "$enable_mpi_fortran" != "no"; then
AC_MSG_RESULT([yes])
OMPI_WANT_F77_BINDINGS=1
OMPI_WANT_FORTRAN_MPIFH_BINDINGS=1
OMPI_WANT_FORTRAN_USEMPI_BINDINGS=1
OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS=1
else
AC_MSG_RESULT([no])
OMPI_WANT_F77_BINDINGS=0
OMPI_WANT_FORTRAN_MPIFH_BINDINGS=0
OMPI_WANT_FORTRAN_USEMPI_BINDINGS=0
OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS=0
fi
AS_IF([test $OMPI_WANT_FORTRAN_MPIFH_BINDINGS -eq 1 -o \
$OMPI_WANT_FORTRAN_USEMPI_BINDINGS -eq 1 -o \
$OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1],
[OMPI_WANT_FORTRAN_BINDINGS=1],
[OMPI_WANT_FORTRAN_BINDINGS=0])
#
# Fortran 90
#
AC_MSG_CHECKING([if want Fortran 90 bindings])
AC_ARG_ENABLE(mpi-f90,
AC_HELP_STRING([--enable-mpi-f90],
[enable f90 MPI bindings (default: enabled)]))
if test "$enable_mpi_f90" != "no"; then
AC_MSG_RESULT([yes])
OMPI_WANT_F90_BINDINGS=1
else
AC_MSG_RESULT([no])
OMPI_WANT_F90_BINDINGS=0
fi
AC_MSG_CHECKING([Fortran 90 bindings "size"])
AC_ARG_WITH(mpi-f90-size,
AC_HELP_STRING([--with-mpi-f90-size=SIZE],
[specify the types of functions in the Fortran 90 MPI module, where SIZE is one of: trivial (MPI-2 F90-specific functions only), small (trivial + all MPI functions without choice buffers), medium (small + all MPI functions with one choice buffer), large (medium + all MPI functions with 2 choice buffers, but only when both buffers are the same type). Default SIZE is "small".]))
if test "$OMPI_WANT_F90_BINDINGS" = "0"; then
AC_MSG_RESULT([disabled (Fortran 90 bindings disabled)])
elif test "$with_mpi_f90_size" = "no"; then
OMPI_WANT_F90_BINDINGS=0
AC_MSG_RESULT([disabling F90 MPI module (used specified)])
else
# Default value
if test "$with_mpi_f90_size" = ""; then
with_mpi_f90_size=small
fi
# Check for each of the sizes
if test "$with_mpi_f90_size" = "trivial"; then
OMPI_F90_BUILD_SIZE=trivial
elif test "$with_mpi_f90_size" = "small"; then
OMPI_F90_BUILD_SIZE=small
elif test "$with_mpi_f90_size" = "medium"; then
OMPI_F90_BUILD_SIZE=medium
elif test "$with_mpi_f90_size" = "large"; then
OMPI_F90_BUILD_SIZE=large
else
AC_MSG_RESULT([Unrecognized size: $with_mpi_f90_size])
AC_MSG_ERROR([Cannot continue])
fi
fi
AM_CONDITIONAL([OMPI_WANT_BUILD_F90_TRIVIAL],
[test "$OMPI_F90_BUILD_SIZE" = "trivial"])
AM_CONDITIONAL([OMPI_WANT_BUILD_F90_SMALL],
[test "$OMPI_F90_BUILD_SIZE" = "small"])
AM_CONDITIONAL([OMPI_WANT_BUILD_F90_MEDIUM],
[test "$OMPI_F90_BUILD_SIZE" = "medium"])
AM_CONDITIONAL([OMPI_WANT_BUILD_F90_LARGE],
[test "$OMPI_F90_BUILD_SIZE" = "large"])
AC_SUBST(OMPI_F90_BUILD_SIZE)
if test "$OMPI_WANT_F90_BINDINGS" != "0"; then
AC_MSG_RESULT([$OMPI_F90_BUILD_SIZE])
fi
#
# MPI profiling
@ -247,14 +197,39 @@ AC_DEFINE_UNQUOTED(MPI_PARAM_CHECK, $mpi_param_check,
#
# What is the max array rank that we want to support in the f90 bindings?
# Do we want the prototype "use mpi_f08" implementation that uses
# Fortran descriptors?
#
AC_MSG_CHECKING([which 'use mpi_f08' implementation to use])
AC_ARG_ENABLE(mpi-f08-subarray-prototype,
AC_HELP_STRING([--enable-mpi-f08-subarray-prototype],
[Use the PROTOTYPE and SEVERLY FUNCTIONALITY-LIMITED Fortran 08 'use mpi_f08' implementation that supports subarrrays (via Fortran descriptors). This option will disable the normal 'use mpi_f08' implementation and *only* build the prototype implementation.]))
OMPI_BUILD_FORTRAN_F08_SUBARRAYS=0
AS_IF([test $OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 0],
[AC_MSG_RESULT([none (use mpi_f08 disabled)])],
[AS_IF([test "$enable_mpi_f08_subarray_prototype" = "yes"],
[OMPI_BUILD_FORTRAN_F08_SUBARRAYS=1
AC_MSG_RESULT([extra crispy (subarray prototype)])],
[AC_MSG_RESULT([regular (no subarray support)])])
])
AC_DEFINE_UNQUOTED([OMPI_BUILD_FORTRAN_F08_SUBARRAYS],
[$OMPI_BUILD_FORTRAN_F08_SUBARRAYS],
[Whether we built the 'use mpi_f08' prototype subarray-based implementation or not (i.e., whether to build the use-mpi-f08-desc prototype or the regular use-mpi-f08 implementation)])
#
# What is the max array rank that we want to support in the f90
# bindings? Now only relevant for the ompi/mpi/fortran/use-mpi dir,
# which is now gfortran-only (because all other Fortran compilers will
# compile ompi/mpi/fortran/use-mpi-ignore-tkr).
#
OMPI_FORTRAN_MAX_ARRAY_RANK=4
AC_MSG_CHECKING([max supported array dimension in F90 MPI bindings])
AC_ARG_WITH(f90-max-array-dim,
AC_HELP_STRING([--with-f90-max-array-dim=<DIM>],
[The maximum array dimension supported in the F90 MPI bindings (default: $OMPI_FORTRAN_MAX_ARRAY_RANK).]))
AC_MSG_CHECKING([max supported gfortran array dimension in the "use mpi" Fortran module])
AC_ARG_WITH(gfortran-max-array-dim,
AC_HELP_STRING([--with-gfortran-max-array-dim=<DIM>],
[The maximum array dimension supported in the gfortran-only "use mpi" module (default: $OMPI_FORTRAN_MAX_ARRAY_RANK). This option is ignored when using other Fortran compilers]))
with_f90_max_array_dim=$gfortran_max_array_dim
if test ! -z "$with_f90_max_array_dim" -a "$with_f90_max_array_dim" != "no"; then
# Ensure it's a number (hopefully an integer!), and >=1 and <=7
happy=1

View File

@ -13,7 +13,7 @@ dnl All rights reserved.
dnl Copyright (c) 2006 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -57,8 +57,8 @@ AC_DEFUN([OMPI_SETUP_CXX],[
_OMPI_CXX_CHECK_2D_CONST_CAST
AM_CONDITIONAL(WANT_MPI_CXX_BINDINGS, [test "$WANT_MPI_CXX_SUPPORT" = 1])
AC_DEFINE_UNQUOTED(OMPI_WANT_CXX_BINDINGS, $WANT_MPI_CXX_SUPPORT,
AM_CONDITIONAL(BUILD_MPI_CXX_BINDINGS, [test "$WANT_MPI_CXX_SUPPORT" = 1])
AC_DEFINE_UNQUOTED(OMPI_BUILD_CXX_BINDINGS, $WANT_MPI_CXX_SUPPORT,
[Whether we want MPI C++ support or not])
])
@ -345,7 +345,6 @@ AC_DEFUN([_OMPI_CXX_CHECK_EXCEPTIONS_BACKEND],[
LDFLAGS="$LDFLAGS $OMPI_CXX_EXCEPTIONS_LDFLAGS"
WRAPPER_EXTRA_CFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_CFLAGS}"
WRAPPER_EXTRA_FFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_FFLAGS}"
WRAPPER_EXTRA_FCFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_FCFLAGS}"
WRAPPER_EXTRA_CXXFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_CXXFLAGS}"
fi

View File

@ -1,182 +0,0 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
dnl sets:
dnl F77 : full pathname to compiler
dnl BASEF77 : compiler name (no path)
dnl OMPI_WANT_F77_BINDINGS : (actually set by ompi_configure_options, may be
dnl redefined here)
dnl FC : Same as F77. Side effect of AC_PROG_FC. Should
dnl not be used
dnl defines:
dnl OMPI_F77 : same as F77
dnl OMPI_WANT_F77_BINDINGS :
dnl am_conditional:
dnl OMPI_WANT_F77_BINDINGS :
# This macro is necessary to get the title to be displayed first. :-)
AC_DEFUN([OMPI_SETUP_F77_BANNER],[
ompi_show_subtitle "Fortran 77 compiler"
])
# This macro is necessary because PROG_FC is REQUIREd by multiple
# places in SETUP_F90.
AC_DEFUN([OMPI_PROG_F77],[
OPAL_VAR_SCOPE_PUSH([ompi_fflags_save])
ompi_fflags_save="$FFLAGS"
AC_PROG_F77([gfortran g77 f77 xlf frt ifort pgf77 fort77 fl32 af77])
FFLAGS="$ompi_fflags_save"
OPAL_VAR_SCOPE_POP
])
AC_DEFUN([OMPI_SETUP_F77],[
AC_REQUIRE([OMPI_SETUP_F77_BANNER])
#
# Check for the compiler
#
# Note that we don't actually *use* the fortran compiler to build
# anything in OMPI; it's only used here in configure to find out
# symbol conventions, type sizes, etc. We also pass it down to
# the wrapper compiler mpif77.
#
# Always run this test, even if fortran isn't wanted so that F77 has
# value for the Fint tests
#
# Must REQUIRE the PROG_F77 macro and not call it directly here for
# reasons well-described in the AC2.64 (and beyond) docs.
AC_REQUIRE([OMPI_PROG_F77])
if test -z "$F77"; then
AC_MSG_WARN([*** Fortran 77 bindings disabled (could not find compiler)])
OMPI_WANT_F77_BINDINGS=0
OMPI_F77="none"
BASEF77="none"
OMPI_F77_ABSOLUTE="none"
else
OMPI_F77="$F77"
set dummy $OMPI_F77
OMPI_F77_ARGV0=[$]2
BASEF77="`basename $OMPI_F77_ARGV0`"
OPAL_WHICH([$OMPI_F77_ARGV0], [OMPI_F77_ABSOLUTE])
if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then
AC_MSG_WARN([*** Fortran 77 bindings disabled by user])
OMPI_WANT_F77_BINDINGS=0
else
OMPI_WANT_F77_BINDINGS=1
fi
fi
# make sure the compiler actually works, if not cross-compiling
# Don't just use the AC macro so that we can have a pretty
# message.
AS_IF([test $OMPI_WANT_F77_BINDINGS -eq 1],
[OMPI_CHECK_COMPILER_WORKS([Fortran 77], [], [], [],
[AC_MSG_ERROR([Could not run a simple Fortran 77 program. Aborting.])])])
# now make sure we know our linking convention...
OMPI_F77_FIND_EXT_SYMBOL_CONVENTION
# Make sure we can link with C code...
AS_IF([test $OMPI_WANT_F77_BINDINGS -eq 1],
[OMPI_LANG_LINK_WITH_C([Fortran 77], [],
[cat <<EOF
**********************************************************************
It appears that your Fortran 77 compiler is unable to link against
object files created by your C compiler. This typically indicates
one of a few possibilities:
- A conflict between CFLAGS and FFLAGS
- A problem with your compiler installation(s)
- Different default build options between compilers (e.g., C
building for 32 bit and Fortran building for 64 bit)
- Incompatible compilers
Such problems can usually be solved by picking compatible compilers
and/or CFLAGS and FFLAGS. More information (including exactly what
command was given to the compilers and what error resulted when the
commands were executed) is available in the config.log file in this
directory.
**********************************************************************
EOF
AC_MSG_ERROR([C and Fortran 77 compilers are not link compatible. Can not continue.])])])
# Test to see if the F77 compilers likes the C++ exceptions flags. If
# it doesn't, just abort. We *could* handle this scenario (e.g.,
# probe the F77 compiler for what flags would be necessary), but we're
# kinda assuming that no one will care. If they do, they'll e-mail us.
AC_MSG_CHECKING([to see if F77 compiler likes the C++ exception flags])
if test $OMPI_WANT_F77_BINDINGS -eq 0; then
AC_MSG_RESULT([skipped (no F77 bindings)])
elif test "$OMPI_CXX_EXCEPTIONS_CXXFLAGS" = ""; then
AC_MSG_RESULT([skipped (no C++ exceptions flags)])
else
FFLAGS="$FFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
AC_LANG_PUSH(Fortran 77)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ INTEGER I
I = 3]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_WARN([C++ exception flags are different between the C and C++ compilers; this configure script cannot currently handle this scenario. Either disable C++ exception support or send mail to the Open MPI users list.])
AC_MSG_ERROR([*** Cannot continue])])
AC_LANG_POP
fi
# Per #1982, on OS X, we may need some esoteric linker flags in the
# wrapper compilers. Assume that we need it for both F77 and FC flags
# (note that in an upcoming update where there will only be one
# Fortran compiler, anyway).
AC_MSG_CHECKING([to see if mpif77/mpif90 compilers need additional linker flags])
if test $OMPI_WANT_F77_BINDINGS -eq 0; then
AC_MSG_RESULT([none (no F77 bindings)])
else
case "$host" in
*apple-darwin*)
# Test whether -Wl,-commons,use_dylibs works; if it does, use it.
LDFLAGS_save=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-commons,use_dylibs"
AC_LANG_PUSH(Fortran 77)
AC_LINK_IFELSE([AC_LANG_SOURCE([[ program test
integer :: i
end program]])],
[OMPI_FORTRAN_WRAPPER_FLAGS="-Wl,-commons,use_dylibs"
WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $OMPI_FORTRAN_WRAPPER_FLAGS"
WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $OMPI_FORTRAN_WRAPPER_FLAGS"],
[OMPI_FORTRAN_WRAPPER_FLAGS=none])
AC_LANG_POP
LDFLAGS=$LDFLAGS_save
AC_MSG_RESULT([$OMPI_FORTRAN_WRAPPER_FLAGS])
;;
*)
AC_MSG_RESULT([none])
;;
esac
fi
AC_DEFINE_UNQUOTED(OMPI_WANT_F77_BINDINGS, $OMPI_WANT_F77_BINDINGS,
[Whether we want the MPI f77 bindings or not])
AC_DEFINE_UNQUOTED(OMPI_F77, "$OMPI_F77", [OMPI underlying F77 compiler])
AM_CONDITIONAL(OMPI_WANT_F77_BINDINGS, test "$OMPI_WANT_F77_BINDINGS" = "1")
AC_SUBST(OMPI_F77_ABSOLUTE)
])

View File

@ -1,260 +0,0 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
dnl OMPI_SETUP_F90
dnl
dnl sets:
dnl F90 : full pathname to compiler
dnl BASEF90 : compiler name (no path)
dnl OMPI_WANT_F90_BINDINGS : (actually set by ompi_configure_options, may be
dnl redefined here)
dnl FC : Same as F90. Side effect of AC_PROG_FC. Should
dnl not be used
dnl defines:
dnl OMPI_F90 : same as F90
dnl OMPI_WANT_F90_BINDINGS :
dnl am_conditional:
dnl OMPI_WANT_F90_BINDINGS :
# This macro is necessary to get the title to be displayed first. :-)
AC_DEFUN([OMPI_SETUP_F90_BANNER],[
ompi_show_subtitle "Fortran 90/95 compiler"
])
# This macro is necessary because PROG_FC is REQUIREd by multiple
# places in SETUP_F90.
AC_DEFUN([OMPI_PROG_FC],[
OPAL_VAR_SCOPE_PUSH([ompi_fcflags_save])
ompi_fcflags_save="$FCFLAGS"
AC_PROG_FC([gfortran f95 fort xlf95 ifort ifc efc pgf95 lf95 f90 xlf90 pgf90 epcf90])
FCFLAGS="$ompi_fcflags_save"
OPAL_VAR_SCOPE_POP
])dnl
AC_DEFUN([OMPI_SETUP_F90],[
AC_REQUIRE([OMPI_SETUP_F90_BANNER])
AC_REQUIRE([AC_PROG_GREP])
if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then
AC_MSG_WARN([*** Fortran 90/95 bindings implicitly disabled (because])
AC_MSG_WARN([*** Fortran 77 bindings were disabled)])
OMPI_WANT_F90_BINDINGS=0
OMPI_F90="none"
BASEF90="none"
OMPI_F90_ABSOLUTE="none"
if test "$enable_f90" = "yes"; then
AC_MSG_WARN([*** but --enable-f90 was explicitly specified])
AC_MSG_ERROR([Cannot continue])
fi
elif test "$OMPI_WANT_F90_BINDINGS" = "0" ; then
AC_MSG_WARN([*** Fortran 90/95 bindings disabled by user])
OMPI_WANT_F90_BINDINGS=0
OMPI_F90="none"
BASEF90="none"
OMPI_F90_ABSOLUTE="none"
else
#
# Check for the compiler
#
# Note that we don't actually *use* the fortran compiler to build
# anything in OMPI; it's only used here in configure to find out
# symbol conventions, type sizes, etc. We also pass it down to
# the wrapper compiler mpif90.
#
# Note that AC_PROG_FC will look for *any* fortran compiler, and
# we don't want it to find an F77 compiler. The AC docs don't
# recommend using the "dialect" feature of AC_PROG_FC (and you can
# only look for one of Fortran 90 or 95 -- not both), so instead
# use the optional first parameter and steal the list of Fortran
# compilers (excluding the f77 compiler names) from AC's default
# list of 95 and 90 compilers and use it here.
#
# Must REQUIRE the PROG_FC macro and not call it directly here for
# reasons well-described in the AC2.64 (and beyond) docs.
AC_REQUIRE([OMPI_PROG_FC])
if test -z "$FC"; then
AC_MSG_WARN([*** Fortran 90/95 bindings disabled (could not find compiler)])
OMPI_WANT_F90_BINDINGS=0
OMPI_F90="none"
BASEF90="none"
OMPI_F90_ABSOLUTE="none"
else
OMPI_WANT_F90_BINDINGS=1
OMPI_F90="$FC"
set dummy $OMPI_F90
OMPI_F90_ARGV0=[$]2
BASEF90="`basename $OMPI_F90_ARGV0`"
OPAL_WHICH([$OMPI_F90_ARGV0], [OMPI_F90_ABSOLUTE])
fi
fi
# make sure the compiler actually works, if not cross-compiling
# Don't just use the AC macro so that we can have a pretty
# message.
AS_IF([test $OMPI_WANT_F90_BINDINGS -eq 1],
[OMPI_CHECK_COMPILER_WORKS([Fortran], [], [], [],
[AC_MSG_ERROR([Could not run a simple Fortran program. Aborting.])])])
# check to see if the F77 and F90 compilers are compatible
AS_IF([test $OMPI_WANT_F90_BINDINGS -eq 1],
[AC_MSG_CHECKING([whether $OMPI_F77 and $OMPI_F90 compilers are compatible])
OMPI_INTL_F90_F77_INTERACTION([fortran_goodness=1], [fortran_goodness=0])
if test "$fortran_goodness" = "0" ; then
AC_MSG_RESULT([no])
AC_MSG_WARN([*** Fortran 77 and Fortran 90 compilers are not link compatible])
AC_MSG_WARN([*** Disabling MPI Fortran 90/95 bindings])
OMPI_WANT_F90_BINDINGS=0
else
AC_MSG_RESULT([yes])
fi
])
# BWB - FIX ME - remove once everyone updates to LT 2.0.
#
AS_IF([test $OMPI_WANT_F90_BINDINGS -eq 1],
[if test $BASEF77 != $BASEF90; then
lt_ver=`$GREP '^VERSION' $srcdir/config/ltmain.sh | cut -f2 -d= | cut -f1 -d'.'`
if test $lt_ver -lt 2 ; then
AC_MSG_ERROR([You appear to be trying to build the Fortran 90
layer with Libtool 1.5.x or earlier and a Fortran 77 / Fortran 90 compiler
combination that will not work with this configuration. You must either
use a different Fortran 77 / Fortran 90 compiler (one where it is the same
compiler for both languages), upgrade to Libtool 2.x, or disable the
Fortran 90 bindings.])
fi
fi
])
# OS X before 10.3 (deployment target) does not allow undefined common
# symbols in shared libraries. Because we can't figure out how to
# implement MPI_STATUSES_IGNORE and friends wihtout common symbols, on
# OS X we can't build the F90 bindings as a shared library.
AC_MSG_CHECKING([for extra arguments to build a shared library])
case "$host" in
*apple-darwin*)
if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
AC_MSG_RESULT([impossible -- -static])
OMPI_F90_EXTRA_SHARED_LIBRARY_FLAGS="-static"
else
case ${MACOSX_DEPLOYMENT_TARGET} in
10.[012])
AC_MSG_RESULT([impossible -- -static])
OMPI_F90_EXTRA_SHARED_LIBRARY_FLAGS="-static"
;;
10.*)
AC_MSG_RESULT([-Wl,-single_module])
OMPI_F90_EXTRA_SHARED_LIBRARY_FLAGS="-Wl,-single_module"
esac
fi
;;
*)
AC_MSG_RESULT([none needed])
OMPI_F90_EXTRA_SHARED_LIBRARY_FLAGS=""
;;
esac
AC_SUBST(OMPI_F90_EXTRA_SHARED_LIBRARY_FLAGS)
# if we're still good, then save the extra file types. Do this last
# because it implies tests that should be invoked by the above tests
# (e.g., running the fortran compiler).
AS_IF([test $OMPI_WANT_F90_BINDINGS -eq 1],
[AC_LANG_PUSH(Fortran)
AC_FC_SRCEXT(f)
AC_FC_SRCEXT(f90)
AC_LANG_POP(Fortran)])
# Test to see if the F90 compilers likes the C++ exceptions flags. If
# it doesn't, just abort. We *could* handle this scenario (e.g.,
# probe the F90 compiler for what flags would be necessary), but we're
# kinda assuming that no one will care. If they do, they'll e-mail us.
AC_MSG_CHECKING([to see if F90 compiler likes the C++ exception flags])
if test "$OMPI_WANT_F90_BINDINGS" = "0"; then
AC_MSG_RESULT([skipped (no F90 bindings)])
elif test "$OMPI_CXX_EXCEPTIONS_CXXFLAGS" = ""; then
AC_MSG_RESULT([skipped (no C++ exceptions flags)])
else
FCFLAGS="$FFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
AC_LANG_PUSH(Fortran)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ INTEGER I
I = 3]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_WARN([C++ exception flags are different between the C and C++ compilers; this configure script cannot currently handle this scenario. Either disable C++ exception support or send mail to the Open MPI users list.])
AC_MSG_ERROR([*** Cannot continue])])
AC_LANG_POP
fi
# All done -- save values
AC_DEFINE_UNQUOTED(OMPI_WANT_F90_BINDINGS, $OMPI_WANT_F90_BINDINGS,
[Whether we want the MPI f90 bindings or not])
AC_DEFINE_UNQUOTED(OMPI_F90, "$OMPI_F90", [OMPI underlying F90 compiler])
AM_CONDITIONAL(OMPI_WANT_F90_BINDINGS, test "$OMPI_WANT_F90_BINDINGS" = "1")
AC_SUBST(OMPI_F90_ABSOLUTE)
unset fortran_goodness
])
#############################################################################
AC_DEFUN([OMPI_INTL_F90_F77_INTERACTION], [
# make sure that we can combine F90 and F77 code
AC_LANG_PUSH(Fortran)
# Fortran module
cat > conftestf77.f <<EOF
subroutine Conf1_test()
end
EOF
cat > conftestf90.f <<EOF
program main
call Conf1_test()
end
EOF
# Try the compile
OPAL_LOG_COMMAND(
[$OMPI_F90 $FCFLAGS $FCFLAGS_f -c conftestf90.f],
OPAL_LOG_COMMAND(
[$OMPI_F77 $FFLAGS -c conftestf77.f],
OPAL_LOG_COMMAND(
[$OMPI_F90 $FCFLAGS -o conftest conftestf90.o conftestf77.o $LDFLAGS $LIBS],
[HAPPY=1],
[HAPPY=0]),
[HAPPY=0]),
[HAPPY=0])
if test "$HAPPY" = "1"; then
$1
else
OPAL_LOG_MSG([here is the F77 program:], 1)
OPAL_LOG_FILE([conftestf77.f])
OPAL_LOG_MSG([here is the F90 program:], 1)
OPAL_LOG_FILE([conftestf90.f])
$2
fi
unset HAPPY ompi_conftest_h
rm -rf conftest*
AC_LANG_POP(Fortran)
])dnl

View File

@ -0,0 +1,217 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
dnl University Research and Technology
dnl Corporation. All rights reserved.
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
dnl of Tennessee Research Foundation. All rights
dnl reserved.
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
dnl OMPI_SETUP_FC
dnl
# This is REQUIREd, below.
AC_DEFUN_ONCE([_OMPI_SETUP_FC_BANNER],[
ompi_show_subtitle "Fortran compiler"
])
#############################################################################
# This is REQUIREd, below.
AC_DEFUN_ONCE([_OMPI_SETUP_FC_COMPILER],[
ompi_fcflags_save="$FCFLAGS"
# Note that AC_PROG_FC will look for *any* fortran compiler, and
# we don't want it to find an F77-only compiler. The AC docs
# don't recommend using the "dialect" feature of AC_PROG_FC, so
# instead use the optional first parameter and steal the list of
# Fortran compilers (excluding the f77 compiler names) from AC's
# default list of compilers and use it here. This is the main
# reason we have an OMPI-ized version of the PROG_FC macro.
AC_PROG_FC([gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90])
FCFLAGS="$ompi_fcflags_save"
])
#############################################################################
# General Fortran compiler setup
AC_DEFUN([OMPI_SETUP_FC],[
OPAL_VAR_SCOPE_PUSH([ompi_fcflags_save ompi_fc_happy])
# Force the intro banner to be displayed first
AC_REQUIRE([_OMPI_SETUP_FC_BANNER])
# Unfortunately, we must REQUIRE this for the reasons cited in the
# Autoconf (version >= 2.64) docs.
AC_REQUIRE([_OMPI_SETUP_FC_COMPILER])
AS_IF([test -z "$FC"],
[AC_MSG_WARN([*** All Fortran MPI bindings disabled (could not find compiler)])
ompi_fc_happy=0],
[ompi_fc_happy=1])
# Make sure the compiler actually works, if not cross-compiling.
# Don't just use the AC macro so that we can have a pretty
# message.
AS_IF([test $ompi_fc_happy -eq 1],
[OMPI_CHECK_COMPILER_WORKS([Fortran], [], [], [],
[AC_MSG_ERROR([Could not run a simple Fortran program. Aborting.])])])
# OS X before 10.3 (deployment target) does not allow undefined common
# symbols in shared libraries. Because we can't figure out how to
# implement MPI_STATUSES_IGNORE and friends wihtout common symbols, on
# OS X we can't build the F90 bindings as a shared library.
OMPI_FORTRAN_EXTRA_SHARED_LIBRARY_FLAGS=
AS_IF([test $ompi_fc_happy -eq 1],
[AC_MSG_CHECKING([for extra arguments to build a shared library])
case "$host" in
*apple-darwin*)
if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
AC_MSG_RESULT([impossible -- -static])
OMPI_FORTRAN_EXTRA_SHARED_LIBRARY_FLAGS="-static"
else
case ${MACOSX_DEPLOYMENT_TARGET} in
10.[012])
AC_MSG_RESULT([impossible -- -static])
OMPI_FORTRAN_EXTRA_SHARED_LIBRARY_FLAGS="-static"
;;
10.*)
AC_MSG_RESULT([-Wl,-single_module])
OMPI_FORTRAN_EXTRA_SHARED_LIBRARY_FLAGS="-Wl,-single_module"
esac
fi
;;
*)
AC_MSG_RESULT([none needed])
OMPI_FORTRAN_EXTRA_SHARED_LIBRARY_FLAGS=""
;;
esac])
AC_SUBST(OMPI_FORTRAN_EXTRA_SHARED_LIBRARY_FLAGS)
# If we're still good, then save the extra file types. Do this last
# because it implies tests that should be invoked by the above tests
# (e.g., running the fortran compiler).
AS_IF([test $ompi_fc_happy -eq 1],
[AC_FC_SRCEXT(f)
AC_FC_SRCEXT(f90)])
# Per #1982, on OS X, we may need some esoteric linker flags in
# the wrapper compilers. Assume that we need it for both F77 and
# FC flags (note that in an upcoming update where there will only
# be one Fortran compiler, anyway).
AS_IF([test $ompi_fc_happy -eq 1],
[AC_MSG_CHECKING([to see if Fortran compilers need additional linker flags])
case "$host" in
*apple-darwin*)
# Test whether -Wl,-commons,use_dylibs works; if it
# does, use it.
LDFLAGS_save=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-commons,use_dylibs"
AC_LANG_PUSH([Fortran])
AC_LINK_IFELSE([AC_LANG_SOURCE([[program test
integer :: i
end program]])],
[OMPI_FORTRAN_WRAPPER_FLAGS="-Wl,-commons,use_dylibs"
WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $OMPI_FORTRAN_WRAPPER_FLAGS"
WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $OMPI_FORTRAN_WRAPPER_FLAGS"],
[OMPI_FORTRAN_WRAPPER_FLAGS=none])
AC_LANG_POP([Fortran])
LDFLAGS=$LDFLAGS_save
AC_MSG_RESULT([$OMPI_FORTRAN_WRAPPER_FLAGS])
;;
*)
AC_MSG_RESULT([none])
;;
esac
])
# Get our Fortran symbol mangling scheme
AS_IF([test $ompi_fc_happy -eq 1],
[OMPI_FORTRAN_FIND_EXT_SYMBOL_CONVENTION])
# Make sure we can link with C code.
AS_IF([test $ompi_fc_happy -eq 1],
[OMPI_LANG_LINK_WITH_C([Fortran], [],
[cat <<EOF
**********************************************************************
It appears that your Fortran compiler is unable to link against
object files created by your C compiler. This typically indicates
one of a few possibilities:
- A conflict between CFLAGS and FCFLAGS
- A problem with your compiler installation(s)
- Different default build options between compilers (e.g., C
building for 32 bit and Fortran building for 64 bit)
- Incompatible compilers
Such problems can usually be solved by picking compatible compilers
and/or CFLAGS and FCFLAGS. More information (including exactly what
command was given to the compilers and what error resulted when the
commands were executed) is available in the config.log file in this
directory.
**********************************************************************
EOF
AC_MSG_ERROR([C and Fortran compilers are not link compatible. Can not continue.])])])
# Test to see if the Fortran compilers likes the C++ exceptions
# flags. If it doesn't, just abort. We *could* handle this
# scenario (e.g., probe the Fortran compiler for what flags would
# be necessary), but we're kinda assuming that no one will care.
# If they do, they'll e-mail us.
AS_IF([test $ompi_fc_happy -eq 1],
[AC_MSG_CHECKING([to see if Fortran compiler likes the C++ exception flags])
AS_IF([test "$OMPI_CXX_EXCEPTIONS_CXXFLAGS" = ""],
[AC_MSG_RESULT([skipped (no C++ exceptions flags)])],
[FCFLAGS="$FFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
INTEGER I
I = 3]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_WARN([C++ exception flags are different between the C and Fortran compilers; this configure script cannot currently handle this scenario. Either disable C++ exception support or send mail to the Open MPI users list.])
AC_MSG_ERROR([*** Cannot continue])])
])
])
# Per #1982, on OS X, we may need some esoteric linker flags in the
# Fortran wrapper compiler.
AC_MSG_CHECKING([to see if mpifort compiler needs additional linker flags])
case "$host" in
*apple-darwin*)
# Test whether -Wl,-commons,use_dylibs works; if it does, use it.
LDFLAGS_save=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,-commons,use_dylibs"
AC_LANG_PUSH([Fortran])
AC_LINK_IFELSE([AC_LANG_SOURCE([[program test
integer :: i
end program]])],
[OMPI_FORTRAN_WRAPPER_FLAGS="-Wl,-commons,use_dylibs"
WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $OMPI_FORTRAN_WRAPPER_FLAGS"],
[OMPI_FORTRAN_WRAPPER_FLAGS=none])
AC_LANG_POP([Fortran])
LDFLAGS=$LDFLAGS_save
AC_MSG_RESULT([$OMPI_FORTRAN_WRAPPER_FLAGS])
;;
*)
AC_MSG_RESULT([none])
;;
esac
# All done
AS_IF([test $ompi_fc_happy -eq 1],
[$1], [$2])
OPAL_VAR_SCOPE_POP
])dnl

View File

@ -10,7 +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-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
# reserved.
@ -23,72 +23,143 @@
#
AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
#-----------
# Fortran 77
#-----------
OMPI_SETUP_F77
OPAL_VAR_SCOPE_PUSH([ompi_fortran_happy])
# Default to building nothing
OMPI_BUILD_FORTRAN_MPIFH_BINDINGS=0
OMPI_BUILD_FORTRAN_USEMPI_BINDINGS=0
OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS=0
OMPI_FORTRAN_USEMPI_DIR=
OMPI_FORTRAN_USEMPI_LIB=
OMPI_FORTRAN_USEMPIF08_DIR=
OMPI_FORTRAN_USEMPIF08_LIB=
OMPI_FORTRAN_HAVE_IGNORE_TKR=0
OMPI_FORTRAN_HAVE_OPTIONAL_ARGS=0
OMPI_FORTRAN_HAVE_BIND_C=0
OMPI_FORTRAN_HAVE_F08_ASSUMED_SHAPE=0
OMPI_FORTRAN_HAVE_PRIVATE=0
# These macros control symbol names for Fortran/C interoperability
#
OMPI_F08_SUFFIX="_f08"
OMPI_F_SUFFIX="_f"
OMPI_MPI_PREFIX="MPI_"
OMPI_MPI_BIND_PREFIX="mpi_"
# Open MPI now treats $F77 and $FC the same, meaning that we
# expect them to be the same back-end compiler. If they're not,
# results are undefined. We do a cursory check to see that FC and
# F77 are the same string value (if they're defined). If they're
# not, we'll issue a warning, but keep going on the assumption
# that they're the same back-end compiler (e.g., pgf77 and pgf90).
# Open MPI only uses $FC and $FCFLAGS -- $F77 and $FFLAGS are now
# ignored.
AS_IF([test "$F77" != "" -o "$FFLAGS" != ""],
[AC_MSG_WARN([Open MPI now ignores the F77 and FFLAGS environment variables; only the FC and FCFLAGS environment variables are used.])
sleep 5])
#-----------------------------------------------------------------------
# If we want any of the Fortran MPI bindings, setup the Fortran compiler
#-----------------------------------------------------------------------
ompi_fortran_happy=0
# $LN_S is used below
AC_PROG_LN_S
ompi_fortran_double_underscore=0
ompi_fortran_single_underscore=0
ompi_fortran_caps=0
ompi_fortran_plain=0
AS_IF([test $OMPI_WANT_FORTRAN_BINDINGS -eq 1],
[OMPI_SETUP_FC([ompi_fortran_happy=1])])
# These values will be determined by SETUP_FC. We must always
# AC_DEFINE these results, even in the --disable-mpi-fortran case,
# for ompi_info.
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_DOUBLE_UNDERSCORE],
[$ompi_fortran_double_underscore],
[Whether fortran symbols have a trailing double underscore or not])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_SINGLE_UNDERSCORE],
[$ompi_fortran_single_underscore],
[Whether fortran symbols have a trailing underscore or not])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_CAPS],
[$ompi_fortran_caps],
[Whether fortran symbols are all caps or not])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_PLAIN],
[$ompi_fortran_plain],
[Whether fortran symbols have no trailing underscore or not])
# Check to see if any of the MPI Fortran bindings were
# specifically requested. If so, and we weren't able to setup the
# Fortran compiler properly, it's an error.
AS_IF([test $ompi_fortran_happy -eq 0 -a "$enable_mpi_fortran" = "yes"],
[AC_MSG_WARN([MPI Fortran bindings requested, but no suitable Fortran compiler found])
AC_MSG_ERROR([Cannot continue])])
# This allows us to mark bogus types, but still have them be a valid
# [sentinel] value
AC_DEFINE([ompi_fortran_bogus_type_t], [int],
[A bogus type that allows us to have sentinel type values that are still valid])
# These get filled in as we check for each type
OMPI_FORTRAN_IKINDS=
OMPI_FORTRAN_RKINDS=
OMPI_FORTRAN_CKINDS=
# We want to set the #define's for all of these, so invoke the macros
# regardless of whether we have F77 support or not.
OMPI_F77_CHECK([CHARACTER], [yes],
[char, int32_t, int, int64_t, long long, long], [-1])
OMPI_FORTRAN_CHECK([CHARACTER], [yes],
[char, int32_t, int, int64_t, long long, long], [-1], [yes])
OMPI_F77_CHECK([LOGICAL], [yes],
[char, int32_t, int, int64_t, long long, long], [-1])
OMPI_F77_CHECK([LOGICAL*1], [yes],
[char, int8_t, short, int32_t, int, int64_t, long long, long], [1])
OMPI_F77_CHECK([LOGICAL*2], [yes],
[short, int16_t, int32_t, int, int64_t, long long, long], [2])
OMPI_F77_CHECK([LOGICAL*4], [yes],
[int32_t, int, int64_t, long long, long], [4])
OMPI_F77_CHECK([LOGICAL*8], [yes],
[int, int64_t, long long, long], [8])
OMPI_FORTRAN_CHECK([LOGICAL], [yes],
[char, int32_t, int, int64_t, long long, long], [-1], [yes])
OMPI_FORTRAN_CHECK([LOGICAL*1], [yes],
[char, int8_t, short, int32_t, int, int64_t, long long, long], [1], [yes])
OMPI_FORTRAN_CHECK([LOGICAL*2], [yes],
[short, int16_t, int32_t, int, int64_t, long long, long], [2], [yes])
OMPI_FORTRAN_CHECK([LOGICAL*4], [yes],
[int32_t, int, int64_t, long long, long], [4], [yes])
OMPI_FORTRAN_CHECK([LOGICAL*8], [yes],
[int, int64_t, long long, long], [8], [yes])
OMPI_F77_CHECK([INTEGER], [yes],
[int32_t, int, int64_t, long long, long], [-1])
OMPI_F77_CHECK([INTEGER*1], [no],
[char, int8_t, short, int, int64_t, long long, long], [1])
OMPI_F77_CHECK([INTEGER*2], [no],
[short, int16_t, int32_t, int, int64_t, long long, long], [2])
OMPI_F77_CHECK([INTEGER*4], [no],
[int32_t, int, int64_t, long long, long], [4])
OMPI_F77_CHECK([INTEGER*8], [no],
[int, int64_t, long long, long], [8])
OMPI_F77_CHECK([INTEGER*16], [no],
[int, int64_t, long long, long], [16])
OMPI_FORTRAN_CHECK([INTEGER], [yes],
[int32_t, int, int64_t, long long, long], [-1], [yes])
OMPI_FORTRAN_CHECK([INTEGER*1], [no],
[char, int8_t, short, int, int64_t, long long, long], [1], [yes])
OMPI_FORTRAN_CHECK([INTEGER*2], [no],
[short, int16_t, int32_t, int, int64_t, long long, long], [2], [yes])
OMPI_FORTRAN_CHECK([INTEGER*4], [no],
[int32_t, int, int64_t, long long, long], [4], [yes])
OMPI_FORTRAN_CHECK([INTEGER*8], [no],
[int, int64_t, long long, long], [8], [yes])
OMPI_FORTRAN_CHECK([INTEGER*16], [no],
[int, int64_t, long long, long], [16], [yes])
OMPI_F77_CHECK([REAL], [yes],
[float, double, long double], [-1])
OMPI_F77_CHECK([REAL*2], [no],
[float, double, long double], [2])
OMPI_F77_CHECK([REAL*4], [no],
[float, double, long double], [4])
OMPI_F77_CHECK([REAL*8], [no],
[float, double, long double], [8])
OMPI_F77_CHECK([REAL*16], [no],
[float, double, long double], [16])
OMPI_FORTRAN_CHECK([REAL], [yes],
[float, double, long double], [-1], [yes])
OMPI_FORTRAN_CHECK([REAL*2], [no],
[float, double, long double], [2], [yes])
OMPI_FORTRAN_CHECK([REAL*4], [no],
[float, double, long double], [4], [yes])
OMPI_FORTRAN_CHECK([REAL*8], [no],
[float, double, long double], [8], [yes])
OMPI_FORTRAN_CHECK([REAL*16], [no],
[float, double, long double], [16], [yes])
# In some compilers, the bit representation of REAL*16 is not the same
# as the C counterpart that we found. If this is the case, then we
# want to disable reduction support for MPI_REAL16 (per ticket #1603).
OMPI_F77_CHECK_REAL16_C_EQUIV
OMPI_FORTRAN_CHECK_REAL16_C_EQUIV
OMPI_F77_CHECK([DOUBLE PRECISION], [yes],
[float, double, long double], [-1])
OMPI_F77_CHECK([COMPLEX], [yes], [], [-1])
# Double precision complex types are not standard, but many compilers support it.
# Code should be wrapped with #ifdef OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX
OMPI_F77_CHECK([DOUBLE COMPLEX], [yes], [], [-1])
OMPI_FORTRAN_CHECK([DOUBLE PRECISION], [yes],
[float, double, long double], [-1], [yes])
OMPI_FORTRAN_CHECK([COMPLEX], [yes], [float _Complex], [-1], [no])
# The complex*N tests are a bit different (note: the complex tests are
# the same as all the rest, because complex is a composite of two
# reals, which we *have* to have. It's only the complex*N tests that
@ -100,154 +171,465 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
# have a back-end C type for it)
# b) compiler supports complex*N
OMPI_F77_CHECK([COMPLEX*8], [no], [], [8])
OMPI_F77_CHECK([COMPLEX*16], [no], [], [16])
OMPI_F77_CHECK([COMPLEX*32], [no], [], [32])
OMPI_FORTRAN_CHECK([COMPLEX*4], [no], [float _Complex], [4], [no])
OMPI_FORTRAN_CHECK([COMPLEX*8], [no],
[float _Complex, double _Complex, long double _Complex],
[8], [no])
OMPI_FORTRAN_CHECK([COMPLEX*16], [no],
[float _Complex, double _Complex, long double _Complex],
[16], [no])
OMPI_FORTRAN_CHECK([COMPLEX*32], [no],
[float _Complex, double _Complex, long double _Complex],
[32], [no])
# Double precision complex types are not standard, but many
# compilers support it. Code should be wrapped with #ifdef
# OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX
OMPI_FORTRAN_CHECK([DOUBLE COMPLEX], [no],
[float _Complex, double _Complex, long double _Complex],
[-1], [no])
# Regardless of whether we have fortran bindings, or even a fortran
# compiler, get the max value for a fortran MPI handle (this macro
# handles the case where we don't have a fortran compiler).
OMPI_F77_GET_FORTRAN_HANDLE_MAX
#
# Check for Fortran compilers value of TRUE and for the correct assumption
# on LOGICAL for conversion into what C considers to be a true value
#
OMPI_F77_GET_VALUE_TRUE
OMPI_F77_CHECK_LOGICAL_ARRAY
# Regardless of whether we have fortran bindings, or even a
# fortran compiler, get the max value for a fortran MPI handle
# (this macro handles the case where we don't have a fortran
# compiler).
OMPI_FORTRAN_GET_HANDLE_MAX
# Check for Fortran compilers value of TRUE and for the correct
# assumption on LOGICAL for conversion into what C considers to be
# a true value.
OMPI_FORTRAN_GET_VALUE_TRUE
OMPI_FORTRAN_CHECK_LOGICAL_ARRAY
# How big should MPI_STATUS_SIZE be? (i.e., the size of
# MPI_STATUS, expressed in units of Fortran INTEGERs). The C
# equivalent of MPI_Status contains 4 C ints and a size_t.
AC_MSG_CHECKING([for the value of MPI_STATUS_SIZE])
OMPI_FORTRAN_STATUS_SIZE=0
if test $OMPI_WANT_F77_BINDINGS -eq 0; then
AC_MSG_RESULT([skipped (no Fortran bindings)])
else
bytes=`expr 4 \* $ac_cv_sizeof_int + $ac_cv_sizeof_size_t`
num_integers=`expr $bytes / $OMPI_SIZEOF_FORTRAN_INTEGER`
sanity=`expr $num_integers \* $OMPI_SIZEOF_FORTRAN_INTEGER`
AS_IF([test "$sanity" != "$bytes"],
[AC_MSG_RESULT([unknown!])
AC_MSG_WARN([WARNING: Size of C int: $ac_cv_sizeof_int])
AC_MSG_WARN([WARNING: Size of C size_t: $ac_cv_sizeof_size_t])
AC_MSG_WARN([WARNING: Size of Fortran INTEGER: $OMPI_SIZEOF_FORTRAN_INTEGER])
AC_MSG_WARN([Could not make this work out evenly...!])
AC_MSG_ERROR([Cannot continue])])
OMPI_FORTRAN_STATUS_SIZE=$num_integers
AC_MSG_RESULT([$OMPI_FORTRAN_STATUS_SIZE Fortran INTEGERs])
fi
AC_MSG_CHECKING([for the value of MPI_STATUS_SIZE])
bytes=`expr 4 \* $ac_cv_sizeof_int + $ac_cv_sizeof_size_t`
num_integers=`expr $bytes / $OMPI_SIZEOF_FORTRAN_INTEGER`
sanity=`expr $num_integers \* $OMPI_SIZEOF_FORTRAN_INTEGER`
AS_IF([test "$sanity" != "$bytes"],
[AC_MSG_RESULT([unknown!])
AC_MSG_WARN([WARNING: Size of C int: $ac_cv_sizeof_int])
AC_MSG_WARN([WARNING: Size of C size_t: $ac_cv_sizeof_size_t])
AC_MSG_WARN([WARNING: Size of Fortran INTEGER: $OMPI_SIZEOF_FORTRAN_INTEGER])
AC_MSG_WARN([Could not make this work out evenly...!])
AC_MSG_ERROR([Cannot continue])])
OMPI_FORTRAN_STATUS_SIZE=$num_integers
AC_MSG_RESULT([$OMPI_FORTRAN_STATUS_SIZE Fortran INTEGERs])
AC_SUBST(OMPI_FORTRAN_STATUS_SIZE)
# Setup for the compilers that don't support ignore TKR functionality
OPAL_UNIQ(OMPI_FORTRAN_IKINDS)
AC_SUBST(OMPI_FORTRAN_IKINDS)
OPAL_UNIQ(OMPI_FORTRAN_RKINDS)
AC_SUBST(OMPI_FORTRAN_RKINDS)
OPAL_UNIQ(OMPI_FORTRAN_CKINDS)
AC_SUBST(OMPI_FORTRAN_CKINDS)
# We can't use C_INTxx_T KIND values in mpif.h because many
# existing MPI Fortran applications are of the form:
#
# There are 2 layers to the MPI f77 layer. The only extra thing that
# determine f77 bindings is that fortran can be disabled by user. In
# such cases, we need to not build the target at all. One layer
# generates MPI_f77* bindings. The other layer generates PMPI_f77*
# bindings. The following conditions determine whether each (or both)
# these layers are built.
# program main
# implicit none
# include 'mpif.h'
#
# Superceeding clause:
# - fortran77 bindings should be enabled, else everything is
# disabled
# 1. MPI_f77* bindings are needed if:
# - Profiling is not required
# - Profiling is required but weak symbols are not
# supported
# 2. PMPI_* bindings are needed if profiling is required. Hence we
# define 2 conditionals which tell us whether each of these layers
# need to be built or NOT
#
AM_CONDITIONAL(WANT_MPI_F77_BINDINGS_LAYER,
test \( "$WANT_MPI_PROFILING" = 0 -o "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1 \) -a "$OMPI_WANT_F77_BINDINGS" = 1)
AM_CONDITIONAL(WANT_PMPI_F77_BINDINGS_LAYER,
test "$OMPI_WANT_F77_BINDINGS" = 1 -a "$WANT_MPI_PROFILING" = 1)
#-----------
# Fortran 90
#-----------
OMPI_SETUP_F90
# Look for the fortran module compiler flag
OMPI_F90_FIND_MODULE_INCLUDE_FLAG
# Look for all the types
OMPI_F90_IKINDS=""
OMPI_F90_RKINDS=""
OMPI_F90_CKINDS=""
OMPI_F90_CHECK([CHARACTER])
# LOGICAL and friends
OMPI_F90_CHECK([LOGICAL])
OMPI_F90_CHECK([LOGICAL*1], [1])
OMPI_F90_CHECK([LOGICAL*2], [2])
OMPI_F90_CHECK([LOGICAL*4], [4])
OMPI_F90_CHECK([LOGICAL*8], [8])
# INTEGER and friends
OMPI_F90_CHECK([INTEGER])
OMPI_F90_CHECK([INTEGER*1], [1])
OMPI_F90_CHECK([INTEGER*2], [2])
OMPI_F90_CHECK([INTEGER*4], [4])
OMPI_F90_CHECK([INTEGER*8], [8])
OMPI_F90_CHECK([INTEGER*16], [16])
# REAL, DOUBLE PRECISION, REAL*4, *8, *16
OMPI_F90_CHECK([REAL])
OMPI_F90_CHECK([REAL*2], [2])
OMPI_F90_CHECK([REAL*4], [4])
OMPI_F90_CHECK([REAL*8], [8])
OMPI_F90_CHECK([REAL*16], [16])
OMPI_F90_CHECK([DOUBLE PRECISION])
# COMPLEX, DOUBLE COMPLEX, COMPLEX*8, *16, *32
OMPI_F90_CHECK([COMPLEX])
OMPI_F90_CHECK([COMPLEX*8], [8])
OMPI_F90_CHECK([COMPLEX*16], [16])
OMPI_F90_CHECK([COMPLEX*32], [32])
OMPI_F90_CHECK([DOUBLE COMPLEX])
AC_SUBST(OMPI_F90_IKINDS)
AC_SUBST(OMPI_F90_RKINDS)
AC_SUBST(OMPI_F90_CKINDS)
# get kind value for Fortran MPI_INTEGER_KIND (corresponding to
# whatever is the same size as a F77 INTEGER -- for the
# most-likely-will-never-occur case where F77 INTEGER is smaller than
# an F90 INTEGER; see MPI-2 4.12.6.5
if test "$OMPI_SIZEOF_FORTRAN_INTEGER" = "2"; then
OMPI_F90_GET_INT_KIND(MPI_INTEGER_KIND, 4, OMPI_MPI_INTEGER_KIND)
elif test "$OMPI_SIZEOF_FORTRAN_INTEGER" = "4"; then
OMPI_F90_GET_INT_KIND(MPI_INTEGER_KIND, 9, OMPI_MPI_INTEGER_KIND)
elif test "$OMPI_SIZEOF_FORTRAN_INTEGER" = "8"; then
OMPI_F90_GET_INT_KIND(MPI_INTEGER_KIND, 18, OMPI_MPI_INTEGER_KIND)
elif test "$OMPI_SIZEOF_FORTRAN_INTEGER" = "16"; then
OMPI_F90_GET_INT_KIND(MPI_INTEGER_KIND, 19, OMPI_MPI_INTEGER_KIND)
# ...and you can't have a "use..." statement before that (to get
# the Fortran/C interop C_INTxx_T KIND values). So figure out
# those KIND values here and just substitue them in via
# AC_DEFINE's. Kinda gross, but there you are. :-\
OMPI_FORTRAN_GET_KIND_VALUE([C_INT16_T], [OMPI_FORTRAN_C_INT16_T_KIND])
OMPI_FORTRAN_GET_KIND_VALUE([C_INT32_T], [OMPI_FORTRAN_C_INT32_T_KIND])
OMPI_FORTRAN_GET_KIND_VALUE([C_INT64_T], [OMPI_FORTRAN_C_INT64_T_KIND])
# Get the kind value for Fortran MPI_INTEGER_KIND (corresponding
# to whatever is the same size as a F77 INTEGER -- for the
# most-likely-will-never-occur case where F77 INTEGER is smaller
# than an F90 INTEGER; see MPI-2 4.12.6.5. As with OMPI
# FORTRAN_CHECK, use the official BIND(C) KIND names (see comment
# in fortran_check.m4).
if test $OMPI_SIZEOF_FORTRAN_INTEGER -eq 2; then
OMPI_MPI_INTEGER_KIND=$OMPI_FORTRAN_C_INT16_T_KIND
elif test $OMPI_SIZEOF_FORTRAN_INTEGER -eq 4; then
OMPI_MPI_INTEGER_KIND=$OMPI_FORTRAN_C_INT32_T_KIND
elif test $OMPI_SIZEOF_FORTRAN_INTEGER -eq 8; then
OMPI_MPI_INTEGER_KIND=$OMPI_FORTRAN_C_INT64_T_KIND
elif test $OMPI_SIZEOF_FORTRAN_INTEGER -eq 16; then
AC_MSG_ERROR([Cannot support Fortran MPI_INTEGER_KIND!])
fi
AC_SUBST(OMPI_MPI_INTEGER_KIND)
# get kind value for Fortran MPI_ADDRESS_KIND (corresponding to
# whatever is big enough to hold (void*))
# Get the kind value for Fortran MPI_ADDRESS_KIND (corresponding
# to whatever is big enough to hold (void*)).
if test $ac_cv_sizeof_void_p = 2 ; then
OMPI_F90_GET_INT_KIND(MPI_ADDRESS_KIND, 4, OMPI_MPI_ADDRESS_KIND)
OMPI_MPI_ADDRESS_KIND=$OMPI_FORTRAN_C_INT16_T_KIND
elif test $ac_cv_sizeof_void_p = 4 ; then
OMPI_F90_GET_INT_KIND(MPI_ADDRESS_KIND, 9, OMPI_MPI_ADDRESS_KIND)
OMPI_MPI_ADDRESS_KIND=$OMPI_FORTRAN_C_INT32_T_KIND
elif test $ac_cv_sizeof_void_p = 8 ; then
OMPI_F90_GET_INT_KIND(MPI_ADDRESS_KIND, 18, OMPI_MPI_ADDRESS_KIND)
OMPI_MPI_ADDRESS_KIND=$OMPI_FORTRAN_C_INT64_T_KIND
elif test $ac_cv_sizeof_void_p = 16 ; then
OMPI_F90_GET_INT_KIND(MPI_ADDRESS_KIND, 19, OMPI_MPI_ADDRESS_KIND)
else
AC_MSG_ERROR([Cannot support Fortran MPI_ADDRESS_KIND!])
fi
AC_SUBST(OMPI_MPI_ADDRESS_KIND)
# get kind value for Fortran MPI_OFFSET_KIND (corresponding to INTEGER*8)
OMPI_F90_GET_INT_KIND(MPI_OFFSET_KIND, 18, OMPI_MPI_OFFSET_KIND)
# Get the kind value for Fortran MPI_OFFSET_KIND (corresponding to
# INTEGER*8).
OMPI_MPI_OFFSET_KIND=$OMPI_FORTRAN_C_INT64_T_KIND
AC_SUBST(OMPI_MPI_OFFSET_KIND)
#--------------------------------------------------------
# This is all we need for the Fortran mpif.h MPI bindings
#--------------------------------------------------------
AC_MSG_CHECKING([if building Fortran mpif.h bindings])
AS_IF([test $ompi_fortran_happy -eq 1],
[AC_MSG_RESULT([yes])
OMPI_BUILD_FORTRAN_MPIFH_BINDINGS=1],
[AC_MSG_RESULT([no])])
#--------------------------------------------
# Fortran use mpi or use mpi_f08 MPI bindings
#--------------------------------------------
AS_IF([test $ompi_fortran_happy -eq 1 -a \
\( $OMPI_WANT_FORTRAN_USEMPI_BINDINGS -eq 1 -o \
$OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1 \)],
[ # Look for the fortran module compiler flag
OMPI_FORTRAN_FIND_MODULE_INCLUDE_FLAG([],
[AC_MSG_WARN([*** Could not determine the fortran compiler flag to indicate where modules reside])
AC_MSG_ERROR([*** Cannot continue])])
# This is all we need to build the "use mpi" module. It's
# an extra bonus if we have ignore TKR functionality (i.e.,
# we'll build the "use mpi" module *better* if we have
# ignore TKR, but we can build it with the legacy
# implementation if we don't).
OMPI_BUILD_FORTRAN_USEMPI_BINDINGS=1
OMPI_FORTRAN_USEMPI_DIR=mpi/fortran/use-mpi-tkr
OMPI_FORTRAN_USEMPI_LIB=-lmpi_usempi
# Look for ignore TKR syntax
OMPI_FORTRAN_CHECK_IGNORE_TKR(
[OMPI_FORTRAN_HAVE_IGNORE_TKR=1
OMPI_FORTRAN_USEMPI_DIR=mpi/fortran/use-mpi-ignore-tkr
OMPI_FORTRAN_USEMPI_LIB=-lmpi_usempi_ignore_tkr
# We now know that we can now build the mpi module
# with at least ignore TKR functionality
OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS=1
OMPI_FORTRAN_USEMPIF08_LIB=-lmpi_usempif08
OMPI_FORTRAN_F08_PREDECL=$OMPI_FORTRAN_IGNORE_TKR_PREDECL
OMPI_FORTRAN_F08_TYPE=$OMPI_FORTRAN_IGNORE_TKR_TYPE])
])
AC_MSG_CHECKING([if building Fortran 'use mpi' bindings])
AS_IF([test $OMPI_BUILD_FORTRAN_USEMPI_BINDINGS -eq 1],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
#---------------------------------
# Fortran use mpi_f08 MPI bindings
#---------------------------------
# If we got all the stuff from above, then also look for the new
# F08 syntax that we can use for the use_mpif08 module.
OMPI_FORTRAN_HAVE_BIND_C=0
AS_IF([test $OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1 -a \
$OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],
[ # If we don't have BIND(C), we won't build mpi_f08 at all
OMPI_FORTRAN_CHECK_BIND_C(
[OMPI_FORTRAN_HAVE_BIND_C=1],
[OMPI_FORTRAN_HAVE_BIND_C=0
OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS=0])])
OMPI_FORTRAN_HAVE_OPTIONAL_ARGS=0
AS_IF([test $OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1 -a \
$OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],
[ # Does the compiler have optional arguments?
OMPI_FORTRAN_CHECK_OPTIONAL_ARGS(
[OMPI_FORTRAN_HAVE_OPTIONAL_ARGS=1],
[OMPI_FORTRAN_HAVE_OPTIONAL_ARGS=0])])
OMPI_FORTRAN_HAVE_PRIVATE=0
AS_IF([test $OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1 -a \
$OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],
[ # Does the compiler support the "private"
OMPI_FORTRAN_CHECK_PRIVATE(
[OMPI_FORTRAN_HAVE_PRIVATE=1],
[OMPI_FORTRAN_HAVE_PRIVATE=0])])
OMPI_FORTRAN_HAVE_ABSTRACT=0
AS_IF([test $OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1 -a \
$OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],
[ # Does the compiler support the "abstract"
OMPI_FORTRAN_CHECK_ABSTRACT(
[OMPI_FORTRAN_HAVE_ABSTRACT=1],
[OMPI_FORTRAN_HAVE_ABSTRACT=0])])
OMPI_FORTRAN_HAVE_ASYNCHRONOUS=0
AS_IF([test $OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1 -a \
$OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],
[ # Does the compiler support the "asynchronous"
OMPI_FORTRAN_CHECK_ASYNCHRONOUS(
[OMPI_FORTRAN_HAVE_ASYNCHRONOUS=1],
[OMPI_FORTRAN_HAVE_ASYNCHRONOUS=0])])
OMPI_FORTRAN_HAVE_PROCEDURE=0
AS_IF([test $OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1 -a \
$OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],
[ # Does the compiler support the "procedure"
OMPI_FORTRAN_CHECK_PROCEDURE(
[OMPI_FORTRAN_HAVE_PROCEDURE=1],
[OMPI_FORTRAN_HAVE_PROCEDURE=0])])
OMPI_FORTRAN_F08_HANDLE_SIZE=4
AS_IF([test $OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1 -a \
$OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],
[ # How big are derived types with a single INTEGER?
OMPI_FORTRAN_GET_SIZEOF([type, BIND(C) :: test_mpi_handle
integer :: MPI_VAL
end type test_mpi_handle],
[type(test_mpi_handle)],
[OMPI_FORTRAN_F08_HANDLE_SIZE])
])
OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=1
OMPI_FORTRAN_F08_PREDECL='!'
OMPI_FORTRAN_F08_TYPE=real
OMPI_FORTRAN_HAVE_F08_ASSUMED_SHAPE=0
AS_IF([test $OMPI_WANT_FORTRAN_USEMPIF08_BINDINGS -eq 1 -a \
$OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],
[ # Look for Fortran 2008 assumed shape syntax
OMPI_FORTRAN_CHECK_F08_ASSUMED_SHAPE(
[ # If we have assumed shape, we can build the use
# mpi_f08 module "better"
OMPI_FORTRAN_F08_PREDECL='!'
OMPI_FORTRAN_F08_TYPE='type(*), dimension(..)'
OMPI_FORTRAN_HAVE_F08_ASSUMED_SHAPE=1])
# Which mpi_f08 implementation are we using?
# a) partial, proof-of-concept that supports array
# subsections (Intel compiler only)
# b) compiler supports BIND(C) and optional arguments
# ("good" compilers)
# c) compiler that does not support the items listed
# in b) ("bad" compilers)
AC_MSG_CHECKING([which mpi_f08 implementation to build])
AS_IF([test $OMPI_BUILD_FORTRAN_F08_SUBARRAYS -eq 1],
[ # Case a) partial/prototype implementation
OMPI_FORTRAN_USEMPIF08_DIR=mpi/fortran/use-mpi-f08-desc
OMPI_FORTRAN_SUBARRAYS_SUPPORTED=.TRUE.
OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=0
AC_MSG_RESULT([array subsections (partial/experimental)])
],
[ # Both cases b) and c)
OMPI_FORTRAN_USEMPIF08_DIR=mpi/fortran/use-mpi-f08
OMPI_FORTRAN_SUBARRAYS_SUPPORTED=.FALSE.
AS_IF([test $OMPI_FORTRAN_HAVE_OPTIONAL_ARGS -eq 1],
[ # Case b) "good compiler"
OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=0
AC_MSG_RESULT(["good" compiler, no array subsections])
],
[ # Case c) "bad compiler"
OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=1
AC_MSG_RESULT(["bad" compiler, no array subsections])
])
# Override for the moment: we're using wrappers
# for everything right now. We'll optimize this
# later to avoid the use of wrappers for "good"
# compilers where possible (e.g., for functions
# without character/string parameters).
AC_MSG_WARN([Temporary development override: forcing the use of F08 wrappers])
OMPI_FORTRAN_NEED_WRAPPER_ROUTINES=1
])
])
AC_MSG_CHECKING([if building Fortran 'use mpi_f08' bindings])
AS_IF([test $OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
# -------------------
# mpif.h final setup
# -------------------
# A preprocessor header file just for Fortran. We cannot use AC
# CONFIG_HEADER because it adds a /* */-style comment at the top,
# and this header file must be usable in .F90 files. :-(
AC_CONFIG_FILES([ompi/mpi/fortran/configure-fortran-output.h])
# Values for wrapper compilers
OMPI_FC="$FC"
set dummy $OMPI_FC
OMPI_FC_ARGV0=[$]2
BASEFC="`basename $OMPI_FC_ARGV0`"
OPAL_WHICH([$OMPI_FC_ARGV0], [OMPI_FC_ABSOLUTE])
AC_SUBST(OMPI_FC)
AC_SUBST(OMPI_FC_ABSOLUTE)
AC_DEFINE_UNQUOTED(OMPI_FC, ["$OMPI_FC"], [Underlying Fortran compiler])
AC_DEFINE_UNQUOTED(OMPI_FC_ABSOLUTE, ["$OMPI_FC_ABSOLUTE"],
[Absolutey path to the underlying Fortran compiler found by configure])
# There are 2 layers to the MPI mpif.h layer. The only extra thing
# that determine mpif.h bindings is that fortran can be disabled
# by user. In such cases, we need to not build the target at all.
# One layer generates MPI_<foo> bindings. The other layer
# generates PMPI_<foo> bindings. The following conditions
# determine whether each (or both) these layers are built.
#
# Superceeding clause:
# - Fortran bindings should be enabled, else everything is
# disabled
# 1. MPI_<foo> bindings are needed if:
# - Profiling is not required
# - Profiling is required but weak symbols are not supported
# 2. PMPI_<foo> bindings are needed if profiling is required.
#
# Hence we define 2 conditionals which tell us whether each of
# these layers need to be built or NOT
AM_CONDITIONAL(BUILD_MPI_FORTRAN_MPIFH_BINDINGS_LAYER,
[test \( $WANT_MPI_PROFILING -eq 0 -o $OMPI_PROFILING_COMPILE_SEPARATELY -eq 1 \) -a $OMPI_BUILD_FORTRAN_MPIFH_BINDINGS -eq 1])
AM_CONDITIONAL(BUILD_PMPI_FORTRAN_MPIFH_BINDINGS_LAYER,
[test $OMPI_BUILD_FORTRAN_MPIFH_BINDINGS -eq 1 -a $WANT_MPI_PROFILING -eq 1])
AC_DEFINE_UNQUOTED(OMPI_BUILD_FORTRAN_MPIFH_BINDINGS,
$OMPI_BUILD_FORTRAN_MPIFH_BINDINGS,
[Whether we will build the MPI Fortran mpif.h bindings or not])
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_MPIFH_BINDINGS,
[test $OMPI_BUILD_FORTRAN_MPIFH_BINDINGS -eq 1])
# -------------------
# use mpi final setup
# -------------------
# This goes into ompi/Makefile.am
AC_SUBST(OMPI_FORTRAN_USEMPI_DIR)
# This goes into mpifort-wrapper-data.txt
AC_SUBST(OMPI_FORTRAN_USEMPI_LIB)
# These go into mpi-ignore-tkr-interfaces.h / mpi-ignore-tkr-file-interfaces.h
AC_SUBST(OMPI_FORTRAN_IGNORE_TKR_PREDECL)
AC_SUBST(OMPI_FORTRAN_IGNORE_TKR_TYPE)
# These go into ompi/info/param.c
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_IGNORE_TKR_PREDECL],
["$OMPI_FORTRAN_IGNORE_TKR_PREDECL"],
[Pre declaration for FORTRAN ignore parameter TKR behavior])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_IGNORE_TKR_TYPE],
[$type],
[Type declaration for FORTRAN ignore parameter TKR behavior])
AC_DEFINE_UNQUOTED(OMPI_BUILD_FORTRAN_USEMPI_BINDINGS,
$OMPI_BUILD_FORTRAN_USEMPI_BINDINGS,
[Whether we will build the MPI Fortran "use mpi" bindings or not])
AC_DEFINE_UNQUOTED(OMPI_FORTRAN_MODULE_SIZE,
["$OMPI_FORTRAN_MODULE_SIZE"],
[Only relevant for Fortran compilers that do not support ignore TKR functionality: size of the "use mpi" and "use mpi_f08" modules])
AC_DEFINE_UNQUOTED(OMPI_FORTRAN_HAVE_IGNORE_TKR,
[$OMPI_FORTRAN_HAVE_IGNORE_TKR],
[Whether the Fortran compiler supports ignore TKR functionality or not])
# Somewhat redundant because ompi/Makefile.am won't traverse into
# the unused "use mpi" directory, but we might as well have the
# ompi/mpi/fortran/use-mpi*/Makefile.ams be safe, too.
# True if we're building either "use mpi" bindings
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_USEMPI_BINDINGS,
[test $OMPI_BUILD_FORTRAN_USEMPI_BINDINGS -eq 1 -o \
$OMPI_FORTRAN_HAVE_IGNORE_TKR -eq 1])
# True if we're building the old TKR-style bindings
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_USEMPI_TKR_BINDINGS,
[test $OMPI_BUILD_FORTRAN_USEMPI_BINDINGS -eq 1 -a \
$OMPI_FORTRAN_HAVE_IGNORE_TKR -eq 0])
# True if we're building the new ignore-TKR-style bindings
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_USEMPI_IGNORE_TKR_BINDINGS,
[test $OMPI_BUILD_FORTRAN_USEMPI_BINDINGS -eq 1 -a \
$OMPI_FORTRAN_HAVE_IGNORE_TKR -eq 1])
# -------------------
# use mpi_f08 final setup
# -------------------
# This goes into ompi/Makefile.am
AC_SUBST(OMPI_FORTRAN_USEMPIF08_DIR)
# This goes into mpifort-wrapper-data.txt
AC_SUBST(OMPI_FORTRAN_USEMPIF08_LIB)
# These go into interfaces/mpi-f08-interfaces-[no]bind.h (and
# mpi-f*-interfaces*.h files)
AC_SUBST(OMPI_FORTRAN_F08_PREDECL)
AC_SUBST(OMPI_FORTRAN_F08_TYPE)
AC_SUBST(OMPI_MPI_PREFIX)
AC_SUBST(OMPI_MPI_BIND_PREFIX)
AC_SUBST(OMPI_F08_SUFFIX)
AC_SUBST(OMPI_F_SUFFIX)
# This goes into ompi/mpi/fortran/configure-fortran-output.h
AC_SUBST(OMPI_FORTRAN_SUBARRAYS_SUPPORTED)
AC_DEFINE_UNQUOTED(OMPI_FORTRAN_SUBARRAYS_SUPPORTED,
[$OMPI_FORTRAN_SUBARRAYS_SUPPORTED],
[Value to load to the MPI_SUBARRAYS_SUPPORTED compile-time constant])
# This is used to generate weak symbols (or not) in
# ompi/mpi/fortran/mpif-h/<foo>_f.c, and
# ompi/mpi/fortran/configure-fortran-output.h.
AC_SUBST(OMPI_FORTRAN_NEED_WRAPPER_ROUTINES)
AC_DEFINE_UNQUOTED(OMPI_FORTRAN_NEED_WRAPPER_ROUTINES,
[$OMPI_FORTRAN_NEED_WRAPPER_ROUTINES],
[Whether the mpi_f08 implementation is using wrapper routines ("bad" Fortran compiler) or weak symbols ("good" Fortran compiler) for the F08 interface definition implementations])
AC_DEFINE_UNQUOTED(OMPI_FORTRAN_F08_HANDLE_SIZE,
$OMPI_FORTRAN_F08_HANDLE_SIZE,
[How many bytes the mpi_f08 TYPE(MPI_<foo>) handles will be])
# These go into ompi/info/param.c
AC_DEFINE_UNQUOTED(OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS,
$OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS,
[For ompi_info: Whether we will build the MPI Fortran "use mpi_f08" bindings or not])
AC_DEFINE_UNQUOTED(OMPI_FORTRAN_HAVE_F08_ASSUMED_SHAPE,
[$OMPI_FORTRAN_HAVE_F08_ASSUMED_SHAPE],
[For ompi_info: Whether the Fortran compiler supports the Fortran 2008 "assumed shape" syntax or not])
AC_DEFINE_UNQUOTED(OMPI_FORTRAN_HAVE_BIND_C,
[$OMPI_FORTRAN_HAVE_BIND_C],
[For ompi_info: Whether we want to use BIND(C) in the mpi_f08 module or not (based on "good" or "bad" compiler determination, i.e., whether we are using fortran wrapper functions for choice buffers or not)])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_HAVE_OPTIONAL_ARGS],
[$OMPI_FORTRAN_HAVE_OPTIONAL_ARGS],
[For ompi_info: whether the Fortran compiler supports optional arguments or not])
# For configure-fortran-output.h, mpi-f08-types.F90 (and ompi_info)
AC_SUBST([OMPI_FORTRAN_HAVE_PRIVATE])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_HAVE_PRIVATE],
[$OMPI_FORTRAN_HAVE_PRIVATE],
[For mpi-f08-types.f90 and ompi_info: whether the compiler supports the "private" keyword or not (used in MPI_Status)])
# For configure-fortran-output.h, mpi-f08-interfaces-callbacks.F90
# (and ompi_info)
AC_SUBST([OMPI_FORTRAN_HAVE_ABSTRACT])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_HAVE_ABSTRACT],
[$OMPI_FORTRAN_HAVE_ABSTRACT],
[For mpi-f08-interfaces-callbacks.f90 and ompi_info: whether the compiler supports the "abstract" keyword or not])
# For configure-fortran-output.h, various files in
# ompi/mpi/fortran/use-mpi-f08/*.F90 and *.h files (and ompi_info)
AC_SUBST([OMPI_FORTRAN_HAVE_ASYNCHRONOUS])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_HAVE_ASYNCHRONOUS],
[$OMPI_FORTRAN_HAVE_ASYNCHRONOUS],
[For ompi/mpi/fortran/use-mpi-f08/blah.F90 and blah.h and ompi_info: whether the compiler supports the "asynchronous" keyword or not])
# For configure-fortran-output.h, various files in
# ompi/mpi/fortran/use-mpi-f08/*.F90 and *.h files (and ompi_info)
AC_SUBST([OMPI_FORTRAN_HAVE_PROCEDURE])
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_HAVE_PROCEDURE],
[$OMPI_FORTRAN_HAVE_PROCEDURE],
[For ompi/mpi/fortran/use-mpi-f08/blah.F90 and blah.h and ompi_info: whether the compiler supports the "procedure" keyword or not])
# For configure-fortran-output.h
AC_SUBST(OMPI_FORTRAN_HAVE_BIND_C)
# Somewhat redundant because ompi/Makefile.am won't traverse into
# ompi/mpi/fortran/use-mpi-f08 if it's not to be built, but we
# might as well have ompi/mpi/fortran/use-mpi-f08/Makefile.am be
# safe, too.
AM_CONDITIONAL(OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS,
[test $OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS -eq 1])
])

View File

@ -10,7 +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-2009 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
# reserved.
@ -38,10 +38,10 @@ AC_DEFUN([OMPI_SETUP_MPI_PROFILING],[
# need to be built or NOT
#
AM_CONDITIONAL(WANT_MPI_BINDINGS_LAYER,
AM_CONDITIONAL(BUILD_MPI_BINDINGS_LAYER,
test "$WANT_MPI_PROFILING" = 0 -o "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1)
AM_CONDITIONAL(WANT_PMPI_BINDINGS_LAYER,
AM_CONDITIONAL(BUILD_PMPI_BINDINGS_LAYER,
test "$WANT_MPI_PROFILING" = 1)
AM_CONDITIONAL(COMPILE_PROFILING_SEPARATELY,
test "$OMPI_PROFILING_COMPILE_SEPARATELY" = 1)

View File

@ -11,7 +11,7 @@ dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006-2010 Oracle and/or its affiliates. All rights reserved.
dnl Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -29,36 +29,14 @@ dnl
# don't want them to go through OPAL_UNIQ because that has resulted in
# unexpected behavior for the user in the past.
AC_DEFUN([OMPI_SETUP_WRAPPER_INIT],[
WRAPPER_EXTRA_FFLAGS=
WRAPPER_EXTRA_FFLAGS_PREFIX=
WRAPPER_EXTRA_FCFLAGS=
WRAPPER_EXTRA_FCFLAGS_PREFIX=
USER_WRAPPER_EXTRA_FFLAGS=
USER_WRAPPER_EXTRA_FFLAGS_PREFIX=
USER_WRAPPER_EXTRA_FCFLAGS=
USER_WRAPPER_EXTRA_FCLAGS_PREFIX=
AC_ARG_WITH([wrapper-fflags],
[AC_HELP_STRING([--with-wrapper-fflags],
[Extra flags to add to FFLAGS when using mpif77])])
if test "$with_wrapper_fflags" = "yes" -o "$with_wrapper_fflags" = "no"; then
AC_MSG_ERROR([--with-wrapper-fflags must have an argument. Aborting])
elif test ! -z "$with_wrapper_fflags" ; then
USER_WRAPPER_EXTRA_FFLAGS="$with_wrapper_fflags"
fi
AC_ARG_WITH([wrapper-fflags-prefix],
[AC_HELP_STRING([--with-wrapper-fflags-prefix],
[Extra flags (before user flags) to add to FFLAGS when using mpif77])])
if test "$with_wrapper_fflags_prefix" = "yes" -o "$with_wrapper_fflags_prefix" = "no"; then
AC_MSG_ERROR([--with-wrapper-fflags-prefix must have an argument. Aborting])
elif test ! -z "$with_wrapper_fflags_prefix" ; then
USER_WRAPPER_EXTRA_FFLAGS_PREFIX="$with_wrapper_fflags_prefix"
fi
AC_ARG_WITH([wrapper-fcflags],
[AC_HELP_STRING([--with-wrapper-fcflags],
[Extra flags to add to FCFLAGS when using mpif90])])
[Extra flags to add to FCFLAGS when using mpifort])])
if test "$with_wrapper_fcflags" = "yes" -o "$with_wrapper_fcflags" = "no"; then
AC_MSG_ERROR([--with-wrapper-fcflags must have an argument. Aborting])
elif test ! -z "$with_wrapper_fcflags" ; then
@ -67,7 +45,7 @@ AC_DEFUN([OMPI_SETUP_WRAPPER_INIT],[
AC_ARG_WITH([wrapper-fcflags-prefix],
[AC_HELP_STRING([--with-wrapper-fcflags-prefix],
[Extra flags (before user flags) to add to FCFLAGS when using mpif90])])
[Extra flags (before user flags) to add to FCFLAGS when using mpifort])])
if test "$with_wrapper_fcflags_prefix" = "yes" -o "$with_wrapper_fcflags_prefix" = "no"; then
AC_MSG_ERROR([--with-wrapper-fcflags-prefix must have an argument. Aborting])
elif test ! -z "$with_wrapper_fcflags_prefix" ; then
@ -102,16 +80,6 @@ AC_DEFUN([_OMPI_SETUP_ORTE_WRAPPERS],[
AC_SUBST([OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
AC_MSG_CHECKING([for OMPI FFLAGS])
OMPI_WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $USER_WRAPPER_EXTRA_FFLAGS"
AC_SUBST([OMPI_WRAPPER_EXTRA_FFLAGS])
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FFLAGS])
AC_MSG_CHECKING([for OMPI FFLAGS_PREFIX])
OMPI_WRAPPER_EXTRA_FFLAGS_PREFIX="$WRAPPER_EXTRA_FFLAGS_PREFIX $USER_WRAPPER_EXTRA_FFLAGS_PREFIX"
AC_SUBST([OMPI_WRAPPER_EXTRA_FFLAGS_PREFIX])
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FFLAGS_PREFIX])
AC_MSG_CHECKING([for OMPI FCFLAGS])
OMPI_WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $USER_WRAPPER_EXTRA_FCFLAGS"
AC_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS])
@ -164,16 +132,6 @@ AC_DEFUN([_OMPI_SETUP_OPAL_WRAPPERS],[
AC_SUBST([OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX])
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CXXFLAGS])
AC_MSG_CHECKING([for OMPI FFLAGS])
OMPI_WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $USER_WRAPPER_EXTRA_FFLAGS"
AC_SUBST([OMPI_WRAPPER_EXTRA_FFLAGS])
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FFLAGS])
AC_MSG_CHECKING([for OMPI FFLAGS_PREFIX])
OMPI_WRAPPER_EXTRA_FFLAGS_PREFIX="$WRAPPER_EXTRA_FFLAGS_PREFIX $USER_WRAPPER_EXTRA_FFLAGS_PREFIX"
AC_SUBST([OMPI_WRAPPER_EXTRA_FFLAGS_PREFIX])
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FFLAGS_PREFIX])
AC_MSG_CHECKING([for OMPI FCFLAGS])
OMPI_WRAPPER_EXTRA_FCFLAGS="$WRAPPER_EXTRA_FCFLAGS $USER_WRAPPER_EXTRA_FCFLAGS"
AC_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS])
@ -201,8 +159,6 @@ AC_DEFUN([_OMPI_SETUP_OPAL_WRAPPERS],[
])
AC_DEFUN([OMPI_SETUP_WRAPPER_FINAL],[
OPAL_UNIQ([WRAPPER_EXTRA_FFLAGS])
OPAL_UNIQ([WRAPPER_EXTRA_FFLAGS_PREFIX])
OPAL_UNIQ([WRAPPER_EXTRA_FCFLAGS])
OPAL_UNIQ([WRAPPER_EXTRA_FCFLAGS_PREFIX])
@ -228,19 +184,12 @@ AC_DEFUN([OMPI_SETUP_WRAPPER_FINAL],[
AC_SUBST([OMPI_WRAPPER_CXX_LIB])
AC_SUBST([OMPI_WRAPPER_CXX_REQUIRED_FILE])
if test "$OMPI_WANT_F77_BINDINGS" = "1" ; then
OMPI_WRAPPER_F77_REQUIRED_FILE=""
if test "$OMPI_WANT_FORTRAN_BINDINGS" = "1" ; then
OMPI_WRAPPER_FORTRAN_REQUIRED_FILE=""
else
OMPI_WRAPPER_F77_REQUIRED_FILE="not supported"
OMPI_WRAPPER_FORTRAN_REQUIRED_FILE="not supported"
fi
AC_SUBST([OMPI_WRAPPER_F77_REQUIRED_FILE])
if test "$OMPI_WANT_F90_BINDINGS" = "1" ; then
OMPI_WRAPPER_F90_REQUIRED_FILE=""
else
OMPI_WRAPPER_F90_REQUIRED_FILE="not supported"
fi
AC_SUBST([OMPI_WRAPPER_F90_REQUIRED_FILE])
AC_SUBST([OMPI_WRAPPER_FORTRAN_REQUIRED_FILE])
# For script-based wrappers that don't do relocatable binaries.
# Don't use if you don't have to.
@ -253,19 +202,11 @@ AC_DEFUN([OMPI_SETUP_WRAPPER_FINAL],[
AC_SUBST([OMPI_WRAPPER_LIBDIR])
# compatibility defines that will eventually go away
WRAPPER_EXTRA_FFLAGS="$OMPI_WRAPPER_EXTRA_FFLAGS"
WRAPPER_EXTRA_FFLAGS_PREFIX="$OMPI_WRAPPER_EXTRA_FFLAGS_PREFIX"
WRAPPER_EXTRA_FCFLAGS="$OMPI_WRAPPER_EXTRA_FCFLAGS"
WRAPPER_EXTRA_FCFLAGS_PREFIX="$OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX"
AC_SUBST([WRAPPER_EXTRA_FFLAGS])
AC_SUBST([WRAPPER_EXTRA_FFLAGS_PREFIX])
AC_SUBST([WRAPPER_EXTRA_FCFLAGS])
AC_SUBST([WRAPPER_EXTRA_FCFLAGS_PREFIX])
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FFLAGS, "$WRAPPER_EXTRA_FFLAGS",
[Additional FFLAGS to pass through the wrapper compilers])
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FFLAGS_PREFIX, "$WRAPPER_EXTRA_FFLAGS_PREFIX",
[Additional FFLAGS to pass through the wrapper compilers])
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FCFLAGS, "$WRAPPER_EXTRA_FCFLAGS",
[Additional FCFLAGS to pass through the wrapper compilers])
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_FCFLAGS_PREFIX, "$WRAPPER_EXTRA_FCFLAGS_PREFIX",

View File

@ -4,7 +4,7 @@
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -418,7 +418,7 @@ extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX
OMPI_DATATYPE_INIT_UNAVAILABLE(NAME, FLAGS)
#if OMPI_WANT_F77_BINDINGS
#if OMPI_BUILD_FORTRAN_BINDINGS
/*
* For Fortran, we need to pass information, such as ALIGNMENT and SIZE as well
* Therefore, for initialization at compile-time, pass this data as well.

View File

@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
* $COPYRIGHT$
@ -120,16 +120,14 @@ ompi_predefined_datatype_t ompi_mpi_integer = OMPI_DATATYPE_INIT_PREDEFIN
ompi_predefined_datatype_t ompi_mpi_real = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_FORTRAN (FLOAT, REAL, OMPI_SIZEOF_FORTRAN_REAL, OMPI_ALIGNMENT_FORTRAN_REAL, OMPI_DATATYPE_FLAG_DATA_FLOAT );
ompi_predefined_datatype_t ompi_mpi_dblprec = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_FORTRAN (FLOAT, DOUBLE_PRECISION, OMPI_SIZEOF_FORTRAN_DOUBLE_PRECISION, OMPI_ALIGNMENT_FORTRAN_DOUBLE_PRECISION, OMPI_DATATYPE_FLAG_DATA_FLOAT );
ompi_predefined_datatype_t ompi_mpi_cplex = OMPI_DATATYPE_INIT_DEFER (COMPLEX, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
#if OMPI_HAVE_F90_DOUBLE_COMPLEX || OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX
/* We do not configure-check for alignment of F90 types ... Alignment of F77 OMPI_ALIGNMENT_FORTRAN_COMPLEX has to suffice */
#if OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX
ompi_predefined_datatype_t ompi_mpi_dblcplex = OMPI_DATATYPE_INIT_DEFER (DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
#else
ompi_predefined_datatype_t ompi_mpi_dblcplex = OMPI_DATATYPE_INIT_UNAVAILABLE (DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
#endif
/* In Fortran, there does not exist a type LONG DOUBLE COMPLEX, but DOUBLE COMPLEX(KIND=8) may require this */
#if HAVE_LONG_DOUBLE && ( OMPI_HAVE_F90_DOUBLE_COMPLEX || OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX )
/* We do not configure-check for alignment of F90 types ... Alignment of F77 OMPI_ALIGNMENT_FORTRAN_COMPLEX has to suffice */
#if HAVE_LONG_DOUBLE && OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX
ompi_predefined_datatype_t ompi_mpi_ldblcplex = OMPI_DATATYPE_INIT_DEFER (LONG_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
#else
ompi_predefined_datatype_t ompi_mpi_ldblcplex = OMPI_DATATYPE_INIT_UNAVAILABLE (LONG_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX );

View File

@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
@ -52,10 +52,21 @@ OBJ_CLASS_INSTANCE(ompi_errhandler_t, opal_object_t, ompi_errhandler_construct,
ompi_errhandler_destruct);
/*
* _addr flavors are for F03 bindings
*/
ompi_predefined_errhandler_t ompi_mpi_errhandler_null;
ompi_predefined_errhandler_t *ompi_mpi_errhandler_null_addr =
&ompi_mpi_errhandler_null;
ompi_predefined_errhandler_t ompi_mpi_errors_are_fatal;
ompi_predefined_errhandler_t *ompi_mpi_errors_are_fatal_addr =
&ompi_mpi_errors_are_fatal;
ompi_predefined_errhandler_t ompi_mpi_errors_return;
ompi_predefined_errhandler_t *ompi_mpi_errors_return_addr =
&ompi_mpi_errors_return;
ompi_predefined_errhandler_t ompi_mpi_errors_throw_exceptions;
ompi_predefined_errhandler_t *ompi_mpi_errors_throw_exceptions_addr =
&ompi_mpi_errors_throw_exceptions;
/*
* Local state to know when the three intrinsics have been freed; see

View File

@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
@ -147,23 +147,26 @@ typedef struct ompi_predefined_errhandler_t ompi_predefined_errhandler_t;
/**
* Global variable for MPI_ERRHANDLER_NULL
* Global variable for MPI_ERRHANDLER_NULL (_addr flavor is for F03 bindings)
*/
OMPI_DECLSPEC extern ompi_predefined_errhandler_t ompi_mpi_errhandler_null;
OMPI_DECLSPEC extern ompi_predefined_errhandler_t *ompi_mpi_errhandler_null_addr;
/**
* Global variable for MPI_ERRORS_ARE_FATAL
* Global variable for MPI_ERRORS_ARE_FATAL (_addr flavor is for F03 bindings)
*/
OMPI_DECLSPEC extern ompi_predefined_errhandler_t ompi_mpi_errors_are_fatal;
OMPI_DECLSPEC extern ompi_predefined_errhandler_t *ompi_mpi_errors_are_fatal_addr;
/**
* Global variable for MPI_ERRORS_RETURN
* Global variable for MPI_ERRORS_RETURN (_addr flavor is for F03 bindings)
*/
OMPI_DECLSPEC extern ompi_predefined_errhandler_t ompi_mpi_errors_return;
OMPI_DECLSPEC extern ompi_predefined_errhandler_t *ompi_mpi_errors_return_addr;
/**
* Global variable for MPI::ERRORS_THROW_EXCEPTIONS. Will abort if
* MPI_INIT wasn't called as MPI::INIT
* MPI_INIT wasn't called as MPI::INIT (_addr flavor is for F03 bindings)
*/
OMPI_DECLSPEC extern ompi_predefined_errhandler_t ompi_mpi_errors_throw_exceptions;

View File

@ -9,7 +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-2008 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012 Oak Ridge National Labs. All rights reserved.
* $COPYRIGHT$
*
@ -25,7 +25,7 @@
#include "ompi/file/file.h"
#include "ompi/request/request.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object,

View File

@ -11,6 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -34,9 +35,10 @@
opal_pointer_array_t ompi_file_f_to_c_table;
/*
* MPI_FILE_NULL
* MPI_FILE_NULL (_addr flavor is for F03 bindings)
*/
ompi_predefined_file_t ompi_mpi_file_null;
ompi_predefined_file_t *ompi_mpi_file_null_addr = &ompi_mpi_file_null;
/*

View File

@ -11,6 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -106,9 +107,10 @@ struct ompi_predefined_file_t {
typedef struct ompi_predefined_file_t ompi_predefined_file_t;
/**
* Back-end instances for MPI_FILE_NULL
* Back-end instances for MPI_FILE_NULL (_addr flavor is for F03 bindings)
*/
OMPI_DECLSPEC extern ompi_predefined_file_t ompi_mpi_file_null;
OMPI_DECLSPEC extern ompi_predefined_file_t *ompi_mpi_file_null_addr;
/**

View File

@ -11,7 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2007 University of Houston. All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2012 Oak Ridge National Labs. All rights reserved.
* $COPYRIGHT$
@ -136,6 +136,7 @@ typedef struct ompi_predefined_group_t ompi_predefined_group_t;
*/
OMPI_DECLSPEC extern struct opal_pointer_array_t ompi_group_f_to_c_table;
OMPI_DECLSPEC extern struct ompi_predefined_group_t ompi_mpi_group_null;
OMPI_DECLSPEC extern struct ompi_predefined_group_t *ompi_mpi_group_null_addr;
/*

View File

@ -11,7 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2007 University of Houston. All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2012 Oak Ridge National Labs. All rights reserved.
* $COPYRIGHT$
@ -45,6 +45,8 @@ opal_pointer_array_t ompi_group_f_to_c_table;
*/
ompi_predefined_group_t ompi_mpi_group_empty;
ompi_predefined_group_t ompi_mpi_group_null;
ompi_predefined_group_t *ompi_mpi_group_empty_addr = &ompi_mpi_group_empty;
ompi_predefined_group_t *ompi_mpi_group_null_addr = &ompi_mpi_group_null;
/*

View File

@ -9,7 +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-2011 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved.
# $COPYRIGHT$
#
@ -23,7 +23,7 @@
# note - headers and nodist_headers will go in ${includedir}/openmpi,
# not ${includedir}/
headers =
headers =
nodist_headers = ompi_config.h
# Install these in $(includedir)
@ -32,7 +32,7 @@ include_HEADERS = mpi_portable_platform.h
# Always install these in $(pkgincludedir)
pkginclude_HEADERS =
if OMPI_WANT_F77_BINDINGS
if OMPI_BUILD_FORTRAN_MPIFH_BINDINGS
include_HEADERS += \
mpif-common.h \
mpif-mpi-io.h
@ -46,46 +46,13 @@ nodist_include_HEADERS = \
mpi-ext.h \
mpif-ext.h
if OMPI_WANT_F77_BINDINGS
if OMPI_BUILD_FORTRAN_MPIFH_BINDINGS
nodist_include_HEADERS += \
mpif.h \
mpif-config.h
endif
noinst_LTLIBRARIES =
if OMPI_WANT_F90_BINDINGS
# If we have any F90 MPI extensions *and* we're building the Fortran
# MPI bindings, compile and generate the mpi_ext F90 module file. Do
# this by compiling a fake library; the modulefile will be created as
# a side-effect of compiling mpif90-ext.f90.
noinst_LTLIBRARIES += libforce_f90_module_to_be_built.la
libforce_f90_module_to_be_built_la_SOURCES = mpif90-ext.f90
mpi_ext.$(OBJEXT): mpif90-ext.f90
$(FCCOMPILE) -c -I. -o $@ $(FCFLAGS_f90) $<
MOSTLYCLEANFILES = *.mod
#
# 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
endif
include ompi/Makefile.am
include ompi/Makefile.include
EXTRA_DIST = $(headers)
@ -95,8 +62,7 @@ nobase_dist_ompi_HEADERS = $(headers)
nobase_nodist_ompi_HEADERS = $(nodist_headers)
endif
# Remove the auto-generated mpi-ext.h file
# Remove the auto-generated files (they are generated by configure)
# Since there is no mpi-ext.h.in, autogen does not know to cleanup this file.
distclean-local:
rm -f mpi-ext.h mpif-ext.h mpif90-ext.f90
rm -f mpi-ext.h mpif-ext.h

View File

@ -148,7 +148,7 @@
#undef OPAL_PTRDIFF_TYPE
/* Whether we want MPI cxx support or not */
#undef OMPI_WANT_CXX_BINDINGS
#undef OMPI_BUILD_CXX_BINDINGS
/* do we want to try to work around C++ bindings SEEK_* issue? */
#undef OMPI_WANT_MPI_CXX_SEEK
@ -595,6 +595,7 @@ enum {
/*
* Datatype combiners.
* Do not change the order of these without also modifying mpif.h.in.
* (see also mpif-common.h.fin).
*/
enum {
MPI_COMBINER_NAMED,
@ -619,7 +620,8 @@ enum {
/*
* Communicator split type constants.
* Do not change the order of these without also modifying mpif.h.in.
* Do not change the order of these without also modifying mpif.h.in
* (see also mpif-common.h.fin).
*/
enum {
MPI_COMM_TYPE_SHARED
@ -2127,7 +2129,7 @@ OMPI_DECLSPEC double PMPI_Wtime(void);
* - We are not building OMPI itself
* - We are using a C++ compiler
*/
#if !defined(OMPI_SKIP_MPICXX) && OMPI_WANT_CXX_BINDINGS && !OMPI_BUILDING
#if !defined(OMPI_SKIP_MPICXX) && OMPI_BUILD_CXX_BINDINGS && !OMPI_BUILDING
#if defined(c_plusplus) || defined(__cplusplus)
#include "openmpi/ompi/mpi/cxx/mpicxx.h"
#endif

View File

@ -12,7 +12,6 @@
! All rights reserved.
! Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
! Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
! $COPYRIGHT$
!
! Additional copyrights may follow
@ -67,6 +66,7 @@
! statements, and is therefore suitable to be included in mpi.f90.
!
!
! First, however, include some output from configure.
!
include 'mpif-config.h'
@ -194,22 +194,6 @@
common/mpi_fortran_status_ignore/MPI_STATUS_IGNORE
common/mpi_fortran_statuses_ignore/MPI_STATUSES_IGNORE
!
! NULL "handles" (indices)
!
integer MPI_GROUP_NULL, MPI_COMM_NULL, MPI_DATATYPE_NULL
integer MPI_REQUEST_NULL, MPI_OP_NULL, MPI_ERRHANDLER_NULL
integer MPI_INFO_NULL, MPI_WIN_NULL, MPI_MESSAGE_NULL
parameter (MPI_GROUP_NULL=0)
parameter (MPI_COMM_NULL=2)
parameter (MPI_DATATYPE_NULL=0)
parameter (MPI_REQUEST_NULL=0)
parameter (MPI_OP_NULL=0)
parameter (MPI_ERRHANDLER_NULL=0)
parameter (MPI_INFO_NULL=0)
parameter (MPI_WIN_NULL=0)
parameter (MPI_MESSAGE_NULL=0)
!
! MPI_Init_thread constants
!
integer MPI_THREAD_SINGLE, MPI_THREAD_FUNNELED
@ -388,8 +372,8 @@
parameter (MPI_COMBINER_F90_INTEGER=16)
parameter (MPI_COMBINER_RESIZED=17)
!
! Communicator split type constants
!
! Communicator split type constants.
!
integer MPI_COMM_TYPE_SHARED
parameter (MPI_COMM_TYPE_SHARED=0)
@ -397,121 +381,8 @@
!
! lookup table indices
!
integer MPI_COMM_WORLD, MPI_COMM_SELF
integer MPI_GROUP_EMPTY
integer MPI_ERRORS_ARE_FATAL, MPI_ERRORS_RETURN
integer MPI_MESSAGE_NO_PROC
parameter (MPI_COMM_WORLD=0)
parameter (MPI_COMM_SELF=1)
parameter (MPI_GROUP_EMPTY=1)
parameter (MPI_ERRORS_ARE_FATAL=1)
parameter (MPI_ERRORS_RETURN=2)
parameter (MPI_MESSAGE_NO_PROC=1)
integer MPI_BYTE, MPI_PACKED, MPI_UB, MPI_LB
integer MPI_CHARACTER, MPI_LOGICAL
integer MPI_INTEGER, MPI_INTEGER1, MPI_INTEGER2, MPI_INTEGER4
integer MPI_INTEGER8, MPI_INTEGER16
integer MPI_REAL, MPI_REAL2, MPI_REAL4, MPI_REAL8, MPI_REAL16
integer MPI_DOUBLE_PRECISION
integer MPI_COMPLEX, MPI_COMPLEX8, MPI_COMPLEX16, MPI_COMPLEX32
integer MPI_DOUBLE_COMPLEX
integer MPI_2REAL, MPI_2DOUBLE_PRECISION, MPI_2INTEGER
integer MPI_2COMPLEX, MPI_2DOUBLE_COMPLEX
! Note that MPI_LOGICALx are not defined by the MPI spec, but there are
! other MPI implementations that have them, so it's good for us to have
! as well.
integer MPI_LOGICAL1, MPI_LOGICAL2, MPI_LOGICAL4, MPI_LOGICAL8
! All other MPI types including the C and C++, as well as the
! ones defined in the MPI 2.2
integer MPI_WCHAR, MPI_CHAR
integer MPI_SIGNED_CHAR, MPI_UNSIGNED_CHAR
integer MPI_SHORT, MPI_UNSIGNED_SHORT
integer MPI_INT, MPI_UNSIGNED, MPI_LONG
integer MPI_UNSIGNED_LONG, MPI_LONG_LONG_INT
integer MPI_UNSIGNED_LONG_LONG
integer MPI_FLOAT, MPI_DOUBLE, MPI_LONG_DOUBLE
integer MPI_FLOAT_INT, MPI_DOUBLE_INT
integer MPI_LONGDBL_INT, MPI_LONG_INT
integer MPI_2INT, MPI_SHORT_INT
integer MPI_CXX_BOOL, MPI_CXX_CPLEX
integer MPI_CXX_DBLCPLEX, MPI_CXX_LDBLCPLEX
integer MPI_INT8_T, MPI_UINT8_T
integer MPI_INT16_T, MPI_UINT16_T
integer MPI_INT32_T, MPI_UINT32_T
integer MPI_INT64_T, MPI_UINT64_T
integer MPI_AINT, MPI_OFFSET
! Now generated; located at bottom of mpif-common.h file
!
! Do NOT change the order of these parameters
!
parameter (MPI_BYTE = 1)
parameter (MPI_PACKED = 2)
parameter (MPI_UB = 3)
parameter (MPI_LB = 4)
parameter (MPI_CHARACTER = 5)
parameter (MPI_LOGICAL = 6)
parameter (MPI_INTEGER = 7)
parameter (MPI_INTEGER1 = 8)
parameter (MPI_INTEGER2 = 9)
parameter (MPI_INTEGER4 = 10)
parameter (MPI_INTEGER8 = 11)
parameter (MPI_INTEGER16 = 12)
parameter (MPI_REAL = 13)
parameter (MPI_REAL4 = 14)
parameter (MPI_REAL8 = 15)
parameter (MPI_REAL16 = 16)
parameter (MPI_DOUBLE_PRECISION = 17)
parameter (MPI_COMPLEX = 18)
parameter (MPI_COMPLEX8 = 19)
parameter (MPI_COMPLEX16 = 20)
parameter (MPI_COMPLEX32 = 21)
parameter (MPI_DOUBLE_COMPLEX = 22)
parameter (MPI_2REAL = 23)
parameter (MPI_2DOUBLE_PRECISION = 24)
parameter (MPI_2INTEGER = 25)
parameter (MPI_2COMPLEX = 26)
parameter (MPI_2DOUBLE_COMPLEX = 27)
parameter (MPI_REAL2 = 28)
parameter (MPI_LOGICAL1 = 29)
parameter (MPI_LOGICAL2 = 30)
parameter (MPI_LOGICAL4 = 31)
parameter (MPI_LOGICAL8 = 32)
parameter (MPI_WCHAR = 33)
parameter (MPI_CHAR = 34)
parameter (MPI_UNSIGNED_CHAR = 35)
parameter (MPI_SIGNED_CHAR = 36)
parameter (MPI_SHORT = 37)
parameter (MPI_UNSIGNED_SHORT = 38)
parameter (MPI_INT = 39)
parameter (MPI_UNSIGNED = 40)
parameter (MPI_LONG = 41)
parameter (MPI_UNSIGNED_LONG = 42)
parameter (MPI_LONG_LONG_INT = 43)
parameter (MPI_UNSIGNED_LONG_LONG = 44)
parameter (MPI_FLOAT = 45)
parameter (MPI_DOUBLE = 46)
parameter (MPI_LONG_DOUBLE = 47)
parameter (MPI_FLOAT_INT = 48)
parameter (MPI_DOUBLE_INT = 49)
parameter (MPI_LONGDBL_INT = 50)
parameter (MPI_LONG_INT = 51)
parameter (MPI_2INT = 52)
parameter (MPI_SHORT_INT = 53)
parameter (MPI_CXX_BOOL = 54)
parameter (MPI_CXX_CPLEX = 55)
parameter (MPI_CXX_DBLCPLEX = 56)
parameter (MPI_CXX_LDBLCPLEX = 57)
parameter (MPI_INT8_T = 58)
parameter (MPI_UINT8_T = 59)
parameter (MPI_INT16_T = 60)
parameter (MPI_UINT16_T = 61)
parameter (MPI_INT32_T = 62)
parameter (MPI_UINT32_T = 63)
parameter (MPI_INT64_T = 64)
parameter (MPI_UINT64_T = 65)
parameter (MPI_AINT = 66)
parameter (MPI_OFFSET = 67)
integer MPI_MAX, MPI_MIN, MPI_SUM, MPI_PROD, MPI_LAND
integer MPI_BAND, MPI_LOR, MPI_BOR, MPI_LXOR, MPI_BXOR

418
ompi/include/mpif-common.pl Executable file
View File

@ -0,0 +1,418 @@
#!/usr/bin/env perl
#
# Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This file generates common parameter values needed for the three
# MPI bindings. It creates the files:
#
# ompi/include/mpif-common.h
# ommp/mpi/fortran/use-mpi-f08/constants.h
use strict;
#----------------------------------------------------------------------------
# Read a file; return its contents in a string
sub read_file {
my ($filename_in) = @_;
open(FILE_IN, $filename_in) || die "Couldn't open file $filename_in";
my $fin;
$fin .= $_
while (<FILE_IN>);
close(FILE_IN);
return $fin;
}
#----------------------------------------------------------------------------
# Write an output file only if a) the output file does not already
# exist, or b) it exists, but its contents are different than $str.
sub write_file {
my ($filename_out, $str) = @_;
my $need_write = 0;
if (! -f $filename_out) {
$need_write = 1;
} else {
open(FILE_IN, $filename_out) || die "Couldn't open $filename_out";
my $tmp;
$tmp .= $_
while (<FILE_IN>);
close(FILE_IN);
if ($str ne $tmp) {
$need_write = 1;
}
}
if ($need_write) {
open(FILE_OUT, ">$filename_out") || die "Couldn't open $filename_out";
print FILE_OUT $str;
close(FILE_OUT);
print "created $filename_out\n";
} else {
print "$filename_out unchanged; not written\n";
}
}
#----------------------------------------------------------------------------
print "creating Fortran header files (with common constants)...\n";
# Find the OMPI topdir. It is likely the pwd.
my $topdir;
if (-r "ompi/include/mpi.h.in") {
$topdir = ".";
} elsif (-r "include/mpi.h.in") {
$topdir = "..";
} elsif (-r "mpi.h.in") {
$topdir = "../..";
} else {
print "Please run this script from the Open MPI topdir or topdir/include/mpi\n";
print "Aborting.\n";
exit(1);
}
#----------------------------------------------------------------------------
my $MPI_COMM_WORLD = 0;
my $MPI_COMM_SELF = 1;
my $MPI_GROUP_EMPTY = 1;
my $MPI_ERRORS_ARE_FATAL = 1;
my $MPI_ERRORS_RETURN = 2;
#
# NULL "handles" (indices)
#
my $MPI_COMM_NULL = 2;
my $MPI_DATATYPE_NULL = 0;
my $MPI_ERRHANDLER_NULL = 0;
my $MPI_GROUP_NULL = 0;
my $MPI_INFO_NULL = 0;
my $MPI_MESSAGE_NULL = 0;
my $MPI_OP_NULL = 0;
my $MPI_REQUEST_NULL = 0;
my $MPI_WIN_NULL = 0;
my $MPI_MESSAGE_NULL = 0;
my $MPI_BYTE = 1;
my $MPI_PACKED = 2;
my $MPI_UB = 3;
my $MPI_LB = 4;
my $MPI_CHARACTER = 5;
my $MPI_LOGICAL = 6;
my $MPI_INTEGER = 7;
my $MPI_INTEGER1 = 8;
my $MPI_INTEGER2 = 9;
my $MPI_INTEGER4 = 10;
my $MPI_INTEGER8 = 11;
my $MPI_INTEGER16 = 12;
my $MPI_REAL = 13;
my $MPI_REAL4 = 14;
my $MPI_REAL8 = 15;
my $MPI_REAL16 = 16;
my $MPI_DOUBLE_PRECISION = 17;
my $MPI_COMPLEX = 18;
my $MPI_COMPLEX8 = 19;
my $MPI_COMPLEX16 = 20;
my $MPI_COMPLEX32 = 21;
my $MPI_DOUBLE_COMPLEX = 22;
my $MPI_2REAL = 23;
my $MPI_2DOUBLE_PRECISION = 24;
my $MPI_2INTEGER = 25;
my $MPI_2COMPLEX = 26;
my $MPI_2DOUBLE_COMPLEX = 27;
my $MPI_REAL2 = 28;
my $MPI_LOGICAL1 = 29;
my $MPI_LOGICAL2 = 30;
my $MPI_LOGICAL4 = 31;
my $MPI_LOGICAL8 = 32;
my $MPI_WCHAR = 33;
my $MPI_CHAR = 34;
my $MPI_UNSIGNED_CHAR = 35;
my $MPI_SIGNED_CHAR = 36;
my $MPI_SHORT = 37;
my $MPI_UNSIGNED_SHORT = 38;
my $MPI_INT = 39;
my $MPI_UNSIGNED = 40;
my $MPI_LONG = 41;
my $MPI_UNSIGNED_LONG = 42;
my $MPI_LONG_LONG_INT = 43;
my $MPI_UNSIGNED_LONG_LONG = 44;
my $MPI_FLOAT = 45;
my $MPI_DOUBLE = 46;
my $MPI_LONG_DOUBLE = 47;
my $MPI_FLOAT_INT = 48;
my $MPI_DOUBLE_INT = 49;
my $MPI_LONGDBL_INT = 50;
my $MPI_LONG_INT = 51;
my $MPI_2INT = 52;
my $MPI_SHORT_INT = 53;
my $MPI_CXX_BOOL = 54;
my $MPI_CXX_CPLEX = 55;
my $MPI_CXX_DBLCPLEX = 56;
my $MPI_CXX_LDBLCPLEX = 57;
my $MPI_INT8_T = 58;
my $MPI_UINT8_T = 59;
my $MPI_INT16_T = 60;
my $MPI_UINT16_T = 61;
my $MPI_INT32_T = 62;
my $MPI_UINT32_T = 63;
my $MPI_INT64_T = 64;
my $MPI_UINT64_T = 65;
my $MPI_AINT = 66;
my $MPI_OFFSET = 67;
#
# create ompi/include/mpif-common.h
#
my $filename_in = "$topdir/ompi/include/mpif-common.h.fin";
my $filename_out = $filename_in;
$filename_out =~ s/\.fin$//;
my $input = read_file($filename_in);
# Add warning to the top
$input = "! -*- fortran -*-
! WARNING! THIS IS A GENERATED FILE!!
! ANY EDITS YOU PUT HERE WILL BE LOST!
! ==> Instead, edit topdir/ompi/include/mpif-common.pl.
$input";
# Add more to the end
$input .= "!
! NULL 'handles' (indices)
!
integer MPI_GROUP_NULL, MPI_COMM_NULL, MPI_DATATYPE_NULL
integer MPI_REQUEST_NULL, MPI_OP_NULL, MPI_ERRHANDLER_NULL
integer MPI_INFO_NULL, MPI_WIN_NULL, MPI_MESSAGE_NULL
parameter (MPI_GROUP_NULL=$MPI_GROUP_NULL)
parameter (MPI_COMM_NULL=$MPI_COMM_NULL)
parameter (MPI_DATATYPE_NULL=$MPI_DATATYPE_NULL)
parameter (MPI_REQUEST_NULL=$MPI_REQUEST_NULL)
parameter (MPI_OP_NULL=$MPI_OP_NULL)
parameter (MPI_ERRHANDLER_NULL=$MPI_ERRHANDLER_NULL)
parameter (MPI_INFO_NULL=$MPI_INFO_NULL)
parameter (MPI_WIN_NULL=$MPI_WIN_NULL)
parameter (MPI_MESSAGE_NULL=$MPI_MESSAGE_NULL)
!
! lookup table indices
!
integer MPI_COMM_WORLD, MPI_COMM_SELF
integer MPI_GROUP_EMPTY
integer MPI_ERRORS_ARE_FATAL, MPI_ERRORS_RETURN
integer OMPI_MPI_COMM_WORLD
integer OMPI_MPI_COMM_SELF
parameter (MPI_COMM_WORLD=$MPI_COMM_WORLD)
parameter (MPI_COMM_SELF=$MPI_COMM_SELF)
parameter (MPI_GROUP_EMPTY=$MPI_GROUP_EMPTY)
parameter (MPI_ERRORS_ARE_FATAL=$MPI_ERRORS_ARE_FATAL)
parameter (MPI_ERRORS_RETURN=$MPI_ERRORS_RETURN)
integer MPI_BYTE, MPI_PACKED, MPI_UB, MPI_LB
integer MPI_CHARACTER, MPI_LOGICAL
integer MPI_INTEGER, MPI_INTEGER1, MPI_INTEGER2, MPI_INTEGER4
integer MPI_INTEGER8, MPI_INTEGER16
integer MPI_REAL, MPI_REAL2, MPI_REAL4, MPI_REAL8, MPI_REAL16
integer MPI_DOUBLE_PRECISION
integer MPI_COMPLEX, MPI_COMPLEX8, MPI_COMPLEX16, MPI_COMPLEX32
integer MPI_DOUBLE_COMPLEX
integer MPI_2REAL, MPI_2DOUBLE_PRECISION, MPI_2INTEGER
integer MPI_2COMPLEX, MPI_2DOUBLE_COMPLEX
! Note that MPI_LOGICALx are not defined by the MPI spec, but there are
! other MPI implementations that have them, so it's good for us to have
! as well.
integer MPI_LOGICAL1, MPI_LOGICAL2, MPI_LOGICAL4, MPI_LOGICAL8
! All other MPI types including the C and C++, as well as the
! ones defined in the MPI 2.2
integer MPI_WCHAR, MPI_CHAR
integer MPI_SIGNED_CHAR, MPI_UNSIGNED_CHAR
integer MPI_SHORT, MPI_UNSIGNED_SHORT
integer MPI_INT, MPI_UNSIGNED, MPI_LONG
integer MPI_UNSIGNED_LONG, MPI_LONG_LONG_INT
integer MPI_UNSIGNED_LONG_LONG
integer MPI_FLOAT, MPI_DOUBLE, MPI_LONG_DOUBLE
integer MPI_FLOAT_INT, MPI_DOUBLE_INT
integer MPI_LONGDBL_INT, MPI_LONG_INT
integer MPI_2INT, MPI_SHORT_INT
integer MPI_CXX_BOOL, MPI_CXX_CPLEX
integer MPI_CXX_DBLCPLEX, MPI_CXX_LDBLCPLEX
integer MPI_INT8_T, MPI_UINT8_T
integer MPI_INT16_T, MPI_UINT16_T
integer MPI_INT32_T, MPI_UINT32_T
integer MPI_INT64_T, MPI_UINT64_T
integer MPI_AINT, MPI_OFFSET
!
! Do NOT change the order of these parameters
!
parameter (MPI_BYTE = $MPI_BYTE)
parameter (MPI_PACKED = $MPI_PACKED)
parameter (MPI_UB = $MPI_UB)
parameter (MPI_LB = $MPI_LB)
parameter (MPI_CHARACTER = $MPI_CHARACTER)
parameter (MPI_LOGICAL = $MPI_LOGICAL)
parameter (MPI_INTEGER = $MPI_INTEGER)
parameter (MPI_INTEGER1 = $MPI_INTEGER1)
parameter (MPI_INTEGER2 = $MPI_INTEGER2)
parameter (MPI_INTEGER4 = $MPI_INTEGER4)
parameter (MPI_INTEGER8 = $MPI_INTEGER8)
parameter (MPI_INTEGER16 = $MPI_INTEGER16)
parameter (MPI_REAL = $MPI_REAL)
parameter (MPI_REAL4 = $MPI_REAL4)
parameter (MPI_REAL8 = $MPI_REAL8)
parameter (MPI_REAL16 = $MPI_REAL16)
parameter (MPI_DOUBLE_PRECISION = $MPI_DOUBLE_PRECISION)
parameter (MPI_COMPLEX = $MPI_COMPLEX)
parameter (MPI_COMPLEX8 = $MPI_COMPLEX8)
parameter (MPI_COMPLEX16 = $MPI_COMPLEX16)
parameter (MPI_COMPLEX32 = $MPI_COMPLEX32)
parameter (MPI_DOUBLE_COMPLEX = $MPI_DOUBLE_COMPLEX)
parameter (MPI_2REAL = $MPI_2REAL)
parameter (MPI_2DOUBLE_PRECISION = $MPI_2DOUBLE_PRECISION)
parameter (MPI_2INTEGER = $MPI_2INTEGER)
parameter (MPI_2COMPLEX = $MPI_2COMPLEX)
parameter (MPI_2DOUBLE_COMPLEX = $MPI_2DOUBLE_COMPLEX)
parameter (MPI_REAL2 = $MPI_REAL2)
parameter (MPI_LOGICAL1 = $MPI_LOGICAL1)
parameter (MPI_LOGICAL2 = $MPI_LOGICAL2)
parameter (MPI_LOGICAL4 = $MPI_LOGICAL4)
parameter (MPI_LOGICAL8 = $MPI_LOGICAL8)
parameter (MPI_WCHAR = $MPI_WCHAR)
parameter (MPI_CHAR = $MPI_CHAR)
parameter (MPI_UNSIGNED_CHAR = $MPI_UNSIGNED_CHAR)
parameter (MPI_SIGNED_CHAR = $MPI_SIGNED_CHAR)
parameter (MPI_SHORT = $MPI_SHORT)
parameter (MPI_UNSIGNED_SHORT = $MPI_UNSIGNED_SHORT)
parameter (MPI_INT = $MPI_INT)
parameter (MPI_UNSIGNED = $MPI_UNSIGNED)
parameter (MPI_LONG = $MPI_LONG)
parameter (MPI_UNSIGNED_LONG = $MPI_UNSIGNED_LONG)
parameter (MPI_LONG_LONG_INT = $MPI_LONG_LONG_INT)
parameter (MPI_UNSIGNED_LONG_LONG = $MPI_UNSIGNED_LONG_LONG)
parameter (MPI_FLOAT = $MPI_FLOAT)
parameter (MPI_DOUBLE = $MPI_DOUBLE)
parameter (MPI_LONG_DOUBLE = $MPI_LONG_DOUBLE)
parameter (MPI_FLOAT_INT = $MPI_FLOAT_INT)
parameter (MPI_DOUBLE_INT = $MPI_DOUBLE_INT)
parameter (MPI_LONGDBL_INT = $MPI_LONGDBL_INT)
parameter (MPI_LONG_INT = $MPI_LONG_INT)
parameter (MPI_2INT = $MPI_2INT)
parameter (MPI_SHORT_INT = $MPI_SHORT_INT)
parameter (MPI_CXX_BOOL = $MPI_CXX_BOOL)
parameter (MPI_CXX_CPLEX = $MPI_CXX_CPLEX)
parameter (MPI_CXX_DBLCPLEX = $MPI_CXX_DBLCPLEX)
parameter (MPI_CXX_LDBLCPLEX = $MPI_CXX_LDBLCPLEX)
parameter (MPI_INT8_T = $MPI_INT8_T)
parameter (MPI_UINT8_T = $MPI_UINT8_T)
parameter (MPI_INT16_T = $MPI_INT16_T)
parameter (MPI_UINT16_T = $MPI_UINT16_T)
parameter (MPI_INT32_T = $MPI_INT32_T)
parameter (MPI_UINT32_T = $MPI_UINT32_T)
parameter (MPI_INT64_T = $MPI_INT64_T)
parameter (MPI_UINT64_T = $MPI_UINT64_T)
parameter (MPI_AINT = $MPI_AINT)
parameter (MPI_OFFSET = $MPI_OFFSET)\n";
# Write the file
write_file($filename_out, $input);
#
# create ompi/mpi/fortran/use-mpi-f08/constants.h
#
$filename_in = "$topdir/ompi/mpi/fortran/use-mpi-f08/constants.h.fin";
$filename_out = $filename_in;
$filename_out =~ s/\.fin$//;
$input = read_file($filename_in);
# Add warning to the top
$input = "/* WARNING! THIS IS A GENERATED FILE!!
* ANY EDITS YOU PUT HERE WILL BE LOST!
* Instead, edit topdir/ompi/include/mpif-common.pl
*/
$input";
# Add more to the end
$input .= "
#define OMPI_MPI_COMM_WORLD $MPI_COMM_WORLD
#define OMPI_MPI_COMM_SELF $MPI_COMM_SELF
#define OMPI_MPI_GROUP_EMPTY $MPI_GROUP_EMPTY
#define OMPI_MPI_ERRORS_ARE_FATAL $MPI_ERRORS_ARE_FATAL
#define OMPI_MPI_ERRORS_RETURN $MPI_ERRORS_RETURN
/*
* NULL 'handles' (indices)
*/
#define OMPI_MPI_GROUP_NULL $MPI_GROUP_NULL
#define OMPI_MPI_COMM_NULL $MPI_COMM_NULL
#define OMPI_MPI_DATATYPE_NULL $MPI_DATATYPE_NULL
#define OMPI_MPI_REQUEST_NULL $MPI_REQUEST_NULL
#define OMPI_MPI_OP_NULL $MPI_OP_NULL
#define OMPI_MPI_ERRHANDLER_NULL $MPI_ERRHANDLER_NULL
#define OMPI_MPI_INFO_NULL $MPI_INFO_NULL
#define OMPI_MPI_WIN_NULL $MPI_WIN_NULL
#define OMPI_MPI_MESSAGE_NULL $MPI_MESSAGE_NULL
#define OMPI_MPI_BYTE $MPI_BYTE
#define OMPI_MPI_PACKED $MPI_PACKED
#define OMPI_MPI_UB $MPI_UB
#define OMPI_MPI_LB $MPI_LB
#define OMPI_MPI_CHARACTER $MPI_CHARACTER
#define OMPI_MPI_LOGICAL $MPI_LOGICAL
#define OMPI_MPI_INTEGER $MPI_INTEGER
#define OMPI_MPI_INTEGER1 $MPI_INTEGER1
#define OMPI_MPI_INTEGER2 $MPI_INTEGER2
#define OMPI_MPI_INTEGER4 $MPI_INTEGER4
#define OMPI_MPI_INTEGER8 $MPI_INTEGER8
#define OMPI_MPI_INTEGER16 $MPI_INTEGER16
#define OMPI_MPI_REAL $MPI_REAL
#define OMPI_MPI_REAL4 $MPI_REAL4
#define OMPI_MPI_REAL8 $MPI_REAL8
#define OMPI_MPI_REAL16 $MPI_REAL16
#define OMPI_MPI_DOUBLE_PRECISION $MPI_DOUBLE_PRECISION
#define OMPI_MPI_COMPLEX $MPI_COMPLEX
#define OMPI_MPI_COMPLEX8 $MPI_COMPLEX8
#define OMPI_MPI_COMPLEX16 $MPI_COMPLEX16
#define OMPI_MPI_COMPLEX32 $MPI_COMPLEX32
#define OMPI_MPI_DOUBLE_COMPLEX $MPI_DOUBLE_COMPLEX
#define OMPI_MPI_2REAL $MPI_2REAL
#define OMPI_MPI_2DOUBLE_PRECISION $MPI_2DOUBLE_PRECISION
#define OMPI_MPI_2INTEGER $MPI_2INTEGER
#define OMPI_MPI_2COMPLEX $MPI_2COMPLEX
#define OMPI_MPI_2DOUBLE_COMPLEX $MPI_2DOUBLE_COMPLEX
#define OMPI_MPI_REAL2 $MPI_REAL2
#define OMPI_MPI_LOGICAL1 $MPI_LOGICAL1
#define OMPI_MPI_LOGICAL2 $MPI_LOGICAL2
#define OMPI_MPI_LOGICAL4 $MPI_LOGICAL4
#define OMPI_MPI_LOGICAL8 $MPI_LOGICAL8\n
#endif /* USE_MPI_F08_CONSTANTS_H */\n";
write_file($filename_out, $input);
exit(0);

View File

@ -76,7 +76,7 @@
parameter (OMPI_MINOR_VERSION=@OMPI_MINOR_VERSION@)
parameter (OMPI_RELEASE_VERSION=@OMPI_RELEASE_VERSION@)
parameter (OMPI_GREEK_VERSION="@OMPI_GREEK_VERSION@")
parameter (OMPI_SVN_VERSION="@OMPI_SVN_R@")
parameter (OMPI_SVN_VERSION="@OMPI_SVN_VERSION@")
!
! Kind parameters
!

View File

@ -0,0 +1,31 @@
# -*- makefile -*-
#
# Copyright (c) 2004-2005 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) 2012 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This makefile.include does not stand on its own - it is included from
# ompi/include//Makefile.am
headers += \
ompi/constants.h \
ompi/types.h \
ompi/memchecker.h \
ompi/totalview.h
nodist_headers += \
ompi/version.h

View File

@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
@ -125,4 +125,11 @@ typedef struct {
# endif
#endif /* defined(__WINDOWS__) */
/* Convenience */
#if OMPI_BUILD_FORTRAN_MPIFH_BINDINGS || OMPI_BUILD_FORTRAN_USEMPI_BINDINGS || OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS
#define OMPI_BUILD_FORTRAN_BINDINGS 1
#else
#define OMPI_BUILD_FORTRAN_BINDINGS 0
#endif
#endif

View File

@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
@ -42,6 +42,7 @@
* Global variables
*/
ompi_predefined_info_t ompi_mpi_info_null;
ompi_predefined_info_t *ompi_mpi_info_null_addr = &ompi_mpi_info_null;
/*

View File

@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
@ -98,6 +98,11 @@ extern opal_pointer_array_t ompi_info_f_to_c_table;
*/
OMPI_DECLSPEC extern ompi_predefined_info_t ompi_mpi_info_null;
/**
* Symbol for Fortran 03 bindings to bind to
*/
OMPI_DECLSPEC extern ompi_predefined_info_t *ompi_mpi_info_null_addr;
/**
* \internal
* Some declarations needed to use OBJ_NEW and OBJ_DESTRUCT macros

View File

@ -7,7 +7,7 @@
* reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -155,10 +155,9 @@ mca_pml_cm_component_init(int* priority,
if (OMPI_SUCCESS != ret) {
*priority = -1;
return NULL;
} else if((strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "psm") == 0) ||
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "mxm") == 0)) {
} else if(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "psm") == 0) {
/*
* If MTL is PSM or MXM then up our priority
* If MTL is PSM then up our priority
* For every other communication layer having MTLs and BTLs, the user/admin
* may still select PML/ob1 (BTLs) or PML/cm (MTLs) if preferable for the app/site.
*/

View File

@ -9,7 +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-2008 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -17,6 +17,8 @@
# $HEADER$
#
EXTRA_DIST += mpi/CMakeLists.txt
EXTRA_DIST += \
mpi/CMakeLists.txt \
mpi/fortran/configure-fortran-output-bottom.h
dist_pkgdata_DATA += mpi/help-mpi-api.txt

View File

@ -1,33 +0,0 @@
/*
* Copyright (c) 2004-2005 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$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
@page page_mpi The src/mpi directory
@section page_mpi_introduction Introduction
This is the introduction.
This is the introduction.
This is the introduction.
This is the introduction.
This is the introduction.
This is the introduction.
This is the introduction.
*/

View File

@ -40,7 +40,7 @@ AM_CPPFLAGS = -DOMPI_PROFILING_DEFINES=0
#
noinst_LTLIBRARIES = libmpi_c.la
if WANT_MPI_BINDINGS_LAYER
if BUILD_MPI_BINDINGS_LAYER
noinst_LTLIBRARIES += libmpi_c_mpi.la
endif

View File

@ -9,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -23,7 +23,7 @@
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/memchecker.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES

View File

@ -10,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -24,7 +24,7 @@
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Comm_f2c = PMPI_Comm_f2c

View File

@ -9,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -22,7 +22,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Errhandler_c2f = PMPI_Errhandler_c2f

View File

@ -10,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -23,7 +23,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Errhandler_f2c = PMPI_Errhandler_f2c

View File

@ -9,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -22,7 +22,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/file/file.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES

View File

@ -10,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -23,7 +23,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/file/file.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES

View File

@ -9,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -22,7 +22,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/group/group.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES

View File

@ -10,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -23,7 +23,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/group/group.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES

View File

@ -9,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -22,7 +22,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/info/info.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES

View File

@ -10,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -23,7 +23,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/info/info.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES

View File

@ -10,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -23,7 +23,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/message/message.h"
#include "ompi/memchecker.h"

View File

@ -10,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -22,7 +22,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/message/message.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES

View File

@ -9,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -22,7 +22,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/op/op.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES

View File

@ -10,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -22,7 +22,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/op/op.h"
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES

View File

@ -34,7 +34,7 @@ AM_CPPFLAGS = -DOMPI_PROFILING_DEFINES=1
#
noinst_LTLIBRARIES =
if WANT_PMPI_BINDINGS_LAYER
if BUILD_PMPI_BINDINGS_LAYER
noinst_LTLIBRARIES += libmpi_c_pmpi.la
endif

View File

@ -10,7 +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 (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -23,7 +23,7 @@
#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/f77/fint_2_int.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/request/request.h"
#include "ompi/memchecker.h"