From f28095e63264a6d4f707355b46fcf5f4911d1726 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 19 May 2005 23:56:02 +0000 Subject: [PATCH] Bunches of fixes for Fortran support: - Fully support REAL*N, INTEGER*N, and COMPLEX*N in the MPI_Op reduction operations. - Update ddt to fully support these types as well, to include using the results of sizes and alignments determined by configure - Discover the goodness of m4 and consolidate a LOT of configure code (i.e., remove a lot of essentially duplicated code and m4-subroutine-ize it). The big kicker was figuring out how to parameterize AC_DEFINE_UNQUOTED, which you can do if you use m4 properly. - If we don't support a given INTEGER*N, REAL*N, or COMPLEX*N, don't error. Just set the right flags so that we don't support them in the MPI layer. This commit was SVN r5788. --- acinclude.m4 | 1 + config/f77_check.m4 | 116 ++++++++++++ config/ompi_find_type.m4 | 61 ++++--- configure.ac | 333 ++++++----------------------------- include/ompi_config_bottom.h | 19 +- src/datatype/dt_module.c | 67 +++++-- src/op/op.c | 164 ++++++++++++++++- src/op/op.h | 22 +++ src/op/op_predefined.c | 140 ++++++++++++--- 9 files changed, 555 insertions(+), 368 deletions(-) create mode 100644 config/f77_check.m4 diff --git a/acinclude.m4 b/acinclude.m4 index 964271a599..6eba066c3f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -28,6 +28,7 @@ sinclude(config/cxx_find_template_repository.m4) sinclude(config/cxx_have_exceptions.m4) sinclude(config/cxx_find_exception_flags.m4) +sinclude(config/f77_check.m4) sinclude(config/f77_check_type.m4) sinclude(config/f77_find_ext_symbol_convention.m4) sinclude(config/f77_get_alignment.m4) diff --git a/config/f77_check.m4 b/config/f77_check.m4 new file mode 100644 index 0000000000..bf8988a689 --- /dev/null +++ b/config/f77_check.m4 @@ -0,0 +1,116 @@ +dnl -*- shell-script -*- +dnl +dnl Copyright (c) 2004-2005 The Trustees of Indiana University. +dnl All rights reserved. +dnl Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +dnl All rights 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_CHECK],[ +# Determine a bunch of things about each Fortran datatype: +# - whether the compiler supports it or not (sometimes an error if it +# does not exist, sometimes not) +# - what the size of it is +# - if it equals the expected size (if there is an expected size) +# - what its alignment is +# - what the C type corresponding to it is (sometimes an error if one +# cannot be found, sometimes not) +# +# Arguments +# 1. Fortran type name +# 2. All-caps version of #define name +# 3. All-lower version of #define name +# 4. Required to have a corresponding C type or not (yes or no) +# 5. Space-delineated list of C types to search (:'s are replaced with +# spaces, e.g., "long:long" is changed to a single type, "long +# long") +# 6. What the expected size is (or -1 if no expected size) + +ofc_c_required="$4" +ofc_c_search_types="$5" +ofc_expected_size="$6" + +# Some defaults + +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]) +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? + + 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 $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) + + if test "$ofc_c_search_types" != ""; then + OMPI_FIND_TYPE([Fortran $1], [$ofc_c_search_types], + [$ofc_c_required], [$ofc_type_size], [ofc_c_type]) + if test -z "$ofc_c_type"; then + ofc_have_type=0 + fi + 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_$2], [$ofc_have_type], + [Whether we have FORTRAN $1 or not]) +AC_DEFINE_UNQUOTED([OMPI_SIZEOF_FORTRAN_$2], [$ofc_type_size], + [Size of FORTRAN $1]) +AC_DEFINE_UNQUOTED([OMPI_ALIGNMENT_FORTRAN_$2], [$ofc_type_alignment], + [Alignment of FORTRAN $1]) +if test "$ofc_c_search_types" != ""; then + AC_DEFINE_UNQUOTED([ompi_fortran_$3_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_F77_GET_FORTRAN_HANDLE_MAX) + +OMPI_FORTRAN_$2_C_TYPE=$ofc_c_type +OMPI_SIZEOF_FORTRAN_$2=$ofc_type_size + +# Clean up + +unset ofc_have_type ofc_type_size ofc_type_alignment ofc_c_type ofc_bogus +unset ofc_fortran_required ofc_c_required ofc_c_search_types ofc_expected_size +])dnl diff --git a/config/ompi_find_type.m4 b/config/ompi_find_type.m4 index a367cad12d..1b9697d9de 100644 --- a/config/ompi_find_type.m4 +++ b/config/ompi_find_type.m4 @@ -17,56 +17,55 @@ dnl AC_DEFUN([OMPI_FIND_TYPE],[ # $1 = message ouptupt -# $2 = suffix of output variable to set -# $3 = list of type names to check -msg="$1" -target_name="$2" -types="$3" -abort_on_fail="$4" +# $2 = C types to check +# $3 = abort on not found +# $4 = target size +# $5 = output variable name +oft_msg="$1" +oft_types="$2" +oft_abort_on_fail="$3" +oft_target_size="$4" +oft_target_name="$5" # Announce -AC_MSG_CHECKING([for C type corresponding to $msg]) - -# Put a default answer in there -str="MPI_$target_name='not found'" -eval $str - -# Get the size of the thing we're looking for -str="target_size=\$OMPI_SIZEOF_${target_name}" -eval $str +AC_MSG_CHECKING([for C type corresponding to $oft_msg]) # Loop over all the types handed to us -real_type= -for type in $types; do - if test -z "$real_type"; then +oft_real_type= +for oft_type in $oft_types; do + if test -z "$oft_real_type"; then # Convert the name handed to us to a variable name, and get - # its size in $type_size + # its size in $oft_type_size - type_varname="`echo $type | sed -e s/:/_/g`" - str="type_size=\$ac_cv_sizeof_$type_varname" - eval $str + oft_type_varname="`echo $oft_type | sed -e s/:/_/g`" + oft_str="oft_type_size=\$ac_cv_sizeof_${oft_type_varname}" + eval $oft_str # If the size matches the target size, we're done - if test "$target_size" != "" -a \ - "$type_size" = "$target_size"; then - real_type="`echo $type | sed -e 's/:/ /'g`" + if test "$oft_target_size" != "" -a \ + "$oft_type_size" = "$oft_target_size"; then + oft_real_type="`echo $oft_type | sed -e 's/:/ /'g`" fi fi done # Did we find it? -if test -z "$real_type"; then +if test -z "$oft_real_type"; then AC_MSG_RESULT([not found]) AC_MSG_WARN([*** Did not find corresponding C type]) - if test "$abort_on_fail" != ""; then + if test "$oft_abort_on_fail" != "no"; then AC_MSG_ERROR([Cannot continue]) fi else - str="MPI_${target_name}_TYPE=\$real_type" - eval $str - AC_MSG_RESULT([$real_type]) + AC_MSG_RESULT([$oft_real_type]) fi -unset types name done str real_type target_size type_size msg type_varname]) +# Set the type in the output, even if it's empty (so that the caller +# knows if we found it or not) + +oft_str="${oft_target_name}=\$oft_real_type" +eval $oft_str + +unset oft_types oft_name oft_str oft_real_type oft_target_size oft_type_size oft_msg oft_type_varname]) diff --git a/configure.ac b/configure.ac index 6a720efbf9..0c715fcfd8 100644 --- a/configure.ac +++ b/configure.ac @@ -370,169 +370,62 @@ OMPI_CONFIG_ASM # Fortran ################################## -OMPI_HAVE_FORTRAN_INTEGER1=0 -OMPI_HAVE_FORTRAN_INTEGER2=0 -OMPI_HAVE_FORTRAN_INTEGER4=0 -OMPI_HAVE_FORTRAN_INTEGER8=0 -OMPI_HAVE_FORTRAN_INTEGER16=0 -OMPI_HAVE_FORTRAN_REAL4=0 -OMPI_HAVE_FORTRAN_REAL8=0 -OMPI_HAVE_FORTRAN_REAL16=0 -OMPI_HAVE_FORTRAN_COMPLEX8=0 -OMPI_HAVE_FORTRAN_COMPLEX16=0 -OMPI_HAVE_FORTRAN_COMPLEX32=0 - -OMPI_SIZEOF_FORTRAN_INTEGER=0 -OMPI_SIZEOF_FORTRAN_REAL=0 -OMPI_SIZEOF_FORTRAN_DBLPREC=0 -OMPI_SIZEOF_FORTRAN_COMPLEX=0 -OMPI_SIZEOF_FORTRAN_DBLCOMPLEX=0 - -OMPI_ALIGNMENT_FORTRAN_INTEGER=0 -OMPI_ALIGNMENT_FORTRAN_REAL=0 -OMPI_ALIGNMENT_FORTRAN_DBLPREC=0 -OMPI_ALIGNMENT_FORTRAN_COMPLEX=0 -OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX=0 - OMPI_SETUP_F77 OMPI_F77_FIND_EXT_SYMBOL_CONVENTION($OMPI_F77) -# Even if we don't want fortran support, we have to have a size for -# INTEGER because it's needed to define MPI_Fint, which is part of -# mpi.h. Hence, if we don't want fortran support, we set the size of -# Fortran INTEGER's to sizeof(int). +# 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]) + +# 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(LOGICAL, LOGICAL, logical, yes, + [char int int32_t], -1) + +OMPI_F77_CHECK(INTEGER, INTEGER, integer, yes, + [int32_t int int64_r long:long long], -1) +OMPI_F77_CHECK(INTEGER*1, INTEGER1, integer1, no, + [char int8_t short int int64_t long:long long], 1) +OMPI_F77_CHECK(INTEGER*2, INTEGER2, integer2, no, + [short int16_t int32_t int int64_t long:long long], 2) +OMPI_F77_CHECK(INTEGER*4, INTEGER4, integer4, no, + [int32_t int int64_t long:long long], 4) +OMPI_F77_CHECK(INTEGER*8, INTEGER8, integer8, no, + [int int64_t long:long long], 8) +OMPI_F77_CHECK(INTEGER*16, INTEGER16, integer16, no, + [int int64_t long:long long], 16) + +OMPI_F77_CHECK(REAL, REAL, real, yes, + [float double long:double], -1) +OMPI_F77_CHECK(REAL*4, REAL4, real4, no, + [float double long:double], 4) +OMPI_F77_CHECK(REAL*8, REAL8, real8, no, + [float double long:double], 8) +OMPI_F77_CHECK(REAL*16, REAL16, real16, no, + [float double long:double], 16) + +OMPI_F77_CHECK(DOUBLE PRECISION, DOUBLE_PRECISION, double_precision, yes, + [float double long:double], -1) + +OMPI_F77_CHECK(COMPLEX, COMPLEX, [], yes, [], -1) + +# 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 +# are different). The fortran complex types are composites of the +# real*(N/2) types. So for us to support complex*N, two conditions +# must be true: # -# Similarly, we need C types for LOGICAL, REAL, and DOUBLE PRECISION -# for the MPI_Op reduction back-end routines. +# a) we must support real*(N/2) (i.e., compiler supports it and we +# have a back-end C type for it) +# b) compiler supports complex*N -if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then - OMPI_SIZEOF_FORTRAN_LOGICAL=$ac_cv_sizeof_int - OMPI_SIZEOF_FORTRAN_INTEGER=$ac_cv_sizeof_int - OMPI_SIZEOF_FORTRAN_REAL=$ac_cv_sizeof_float - OMPI_SIZEOF_FORTRAN_DBLPREC=$ac_cv_sizeof_double -else - # If we want fortran support, then get the sizes and alignments of - # all the rest of the fortran types - - OMPI_F77_CHECK_TYPE(INTEGER*1, OMPI_HAVE_FORTRAN_INTEGER1) - OMPI_F77_CHECK_TYPE(INTEGER*2, OMPI_HAVE_FORTRAN_INTEGER2) - OMPI_F77_CHECK_TYPE(INTEGER*4, OMPI_HAVE_FORTRAN_INTEGER4) - OMPI_F77_CHECK_TYPE(INTEGER*8, OMPI_HAVE_FORTRAN_INTEGER8) - OMPI_F77_CHECK_TYPE(INTEGER*16, OMPI_HAVE_FORTRAN_INTEGER16) - - OMPI_F77_CHECK_TYPE(REAL*4, OMPI_HAVE_FORTRAN_REAL4) - OMPI_F77_CHECK_TYPE(REAL*8, OMPI_HAVE_FORTRAN_REAL8) - OMPI_F77_CHECK_TYPE(REAL*16, OMPI_HAVE_FORTRAN_REAL16) - - OMPI_F77_CHECK_TYPE(COMPLEX*8, OMPI_HAVE_FORTRAN_COMPLEX8) - OMPI_F77_CHECK_TYPE(COMPLEX*16, OMPI_HAVE_FORTRAN_COMPLEX16) - OMPI_F77_CHECK_TYPE(COMPLEX*32, OMPI_HAVE_FORTRAN_COMPLEX32) - - OMPI_F77_GET_SIZEOF(LOGICAL, OMPI_SIZEOF_FORTRAN_LOGICAL) - OMPI_F77_GET_SIZEOF(INTEGER, OMPI_SIZEOF_FORTRAN_INTEGER) - OMPI_F77_GET_SIZEOF(REAL, OMPI_SIZEOF_FORTRAN_REAL) - OMPI_F77_GET_SIZEOF(DOUBLE PRECISION, OMPI_SIZEOF_FORTRAN_DBLPREC) - OMPI_F77_GET_SIZEOF(COMPLEX, OMPI_SIZEOF_FORTRAN_COMPLEX) - OMPI_F77_GET_SIZEOF(DOUBLE COMPLEX, OMPI_SIZEOF_FORTRAN_DBLCOMPLEX) - - if test "$OMPI_HAVE_FORTRAN_INTEGER1" = "1"; then - OMPI_F77_GET_SIZEOF(INTEGER*1, OMPI_SIZEOF_FORTRAN_INTEGER1) - OMPI_F77_PURGE_UNSUPPORTED_KIND(INTEGER*1) - fi - if test "$OMPI_HAVE_FORTRAN_INTEGER2" = "1"; then - OMPI_F77_GET_SIZEOF(INTEGER*2, OMPI_SIZEOF_FORTRAN_INTEGER2) - OMPI_F77_PURGE_UNSUPPORTED_KIND(INTEGER*2) - fi - if test "$OMPI_HAVE_FORTRAN_INTEGER4" = "1"; then - OMPI_F77_GET_SIZEOF(INTEGER*4, OMPI_SIZEOF_FORTRAN_INTEGER4) - OMPI_F77_PURGE_UNSUPPORTED_KIND(INTEGER*4) - fi - if test "$OMPI_HAVE_FORTRAN_INTEGER8" = "1"; then - OMPI_F77_GET_SIZEOF(INTEGER*8, OMPI_SIZEOF_FORTRAN_INTEGER8) - OMPI_F77_PURGE_UNSUPPORTED_KIND(INTEGER*8) - fi - if test "$OMPI_HAVE_FORTRAN_INTEGER16" = "1"; then - OMPI_F77_GET_SIZEOF(INTEGER*16, OMPI_SIZEOF_FORTRAN_INTEGER16) - OMPI_F77_PURGE_UNSUPPORTED_KIND(INTEGER*16) - fi - - if test "$OMPI_HAVE_FORTRAN_REAL4" = "1" ; then - OMPI_F77_GET_SIZEOF(REAL*4, OMPI_SIZEOF_FORTRAN_REAL4) - OMPI_F77_PURGE_UNSUPPORTED_KIND(REAL*4) - fi - if test "$OMPI_HAVE_FORTRAN_REAL8" = "1" ; then - OMPI_F77_GET_SIZEOF(REAL*8, OMPI_SIZEOF_FORTRAN_REAL8) - OMPI_F77_PURGE_UNSUPPORTED_KIND(REAL*8) - fi - if test "$OMPI_HAVE_FORTRAN_REAL16" = "1" ; then - OMPI_F77_GET_SIZEOF(REAL*16, OMPI_SIZEOF_FORTRAN_REAL16) - OMPI_F77_PURGE_UNSUPPORTED_KIND(REAL*16) - fi - OMPI_F77_GET_ALIGNMENT(LOGICAL, OMPI_ALIGNMENT_FORTRAN_LOGICAL) - OMPI_F77_GET_ALIGNMENT(INTEGER, OMPI_ALIGNMENT_FORTRAN_INTEGER) - OMPI_F77_GET_ALIGNMENT(REAL, OMPI_ALIGNMENT_FORTRAN_REAL) - OMPI_F77_GET_ALIGNMENT(DOUBLE PRECISION, OMPI_ALIGNMENT_FORTRAN_DBLPREC) - OMPI_F77_GET_ALIGNMENT(COMPLEX, OMPI_ALIGNMENT_FORTRAN_COMPLEX) - OMPI_F77_GET_ALIGNMENT(DOUBLE COMPLEX, OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX) - -fi - -AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_INTEGER1, $OMPI_HAVE_FORTRAN_INTEGER1, - [Whether we have FORTRAN INTEGER1 or not]) -AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_INTEGER2, $OMPI_HAVE_FORTRAN_INTEGER2, - [Whether we have FORTRAN INTEGER2 or not]) -AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_INTEGER4, $OMPI_HAVE_FORTRAN_INTEGER4, - [Whether we have FORTRAN INTEGER4 or not]) -AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_INTEGER8, $OMPI_HAVE_FORTRAN_INTEGER8, - [Whether we have FORTRAN INTEGER8 or not]) -AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_INTEGER16, $OMPI_HAVE_FORTRAN_INTEGER16, - [Whether we have FORTRAN INTEGER16 or not]) - -AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_REAL4, $OMPI_HAVE_FORTRAN_REAL4, - [Whether we have FORTRAN REAL4 or not]) -AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_REAL8, $OMPI_HAVE_FORTRAN_REAL8, - [Whether we have FORTRAN REAL8 or not]) -AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_REAL16, $OMPI_HAVE_FORTRAN_REAL16, - [Whether we have FORTRAN REAL16 or not]) - -AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_COMPLEX8, $OMPI_HAVE_FORTRAN_COMPLEX8, - [Whether we have FORTRAN COMPLEX8 or not]) -AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_COMPLEX16, $OMPI_HAVE_FORTRAN_COMPLEX16, - [Whether we have FORTRAN COMPLEX16 or not]) -AC_DEFINE_UNQUOTED(OMPI_HAVE_FORTRAN_COMPLEX32, $OMPI_HAVE_FORTRAN_COMPLEX32, - [Whether we have FORTRAN COMPLEX32 or not]) - -AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_LOGICAL, $OMPI_SIZEOF_FORTRAN_LOGICAL, - [Size of fortran logical]) -AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_INTEGER, $OMPI_SIZEOF_FORTRAN_INTEGER, - [Size of fortran integer]) -AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_REAL, $OMPI_SIZEOF_FORTRAN_REAL, - [Size of fortran real]) -AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_DBLPREC, $OMPI_SIZEOF_FORTRAN_DBLPREC, - [Size of fortran double precision]) -AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_COMPLEX, $OMPI_SIZEOF_FORTRAN_COMPLEX, - [Size of fortran complex]) -AC_DEFINE_UNQUOTED(OMPI_SIZEOF_FORTRAN_DBLCOMPLEX, - $OMPI_SIZEOF_FORTRAN_DBLCOMPLEX, - [Size of fortran double complex]) - -AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_LOGICAL, - $OMPI_ALIGNMENT_FORTRAN_LOGICAL, - [Alignment of fortran logical]) -AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_INTEGER, - $OMPI_ALIGNMENT_FORTRAN_INTEGER, - [Alignment of fortran integer]) -AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_REAL, $OMPI_ALIGNMENT_FORTRAN_REAL, - [alignment of fortran real]) -AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_DBLPREC, - $OMPI_ALIGNMENT_FORTRAN_DBLPREC, - [Alignment of fortran double precision]) -AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_COMPLEX, - $OMPI_ALIGNMENT_FORTRAN_COMPLEX, - [Alignment of fortran complex]) -AC_DEFINE_UNQUOTED(OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX, - $OMPI_ALIGNMENT_FORTRAN_DBLCOMPLEX, - [Alignment of fortran double complex]) +OMPI_F77_CHECK(COMPLEX*8, COMPLEX8, [], no, [], 8) +OMPI_F77_CHECK(COMPLEX*16, COMPLEX16, [], no, [], 16) +OMPI_F77_CHECK(COMPLEX*32, COMPLEX32, [], no, [], 32) # Regardless of whether we have fortran bindings, or even a fortran # compiler, get the max value for a fortran MPI handle (this macro @@ -935,7 +828,7 @@ AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_COMPLEX8, $OMPI_HAVE_F90_COMPLEX8, AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_COMPLEX16, $OMPI_HAVE_F90_COMPLEX16, [support for fortran complex*16]) AC_DEFINE_UNQUOTED(OMPI_HAVE_F90_COMPLEX32, $OMPI_HAVE_F90_COMPLEX32, - [support for fortran complex*21]) + [support for fortran complex*32]) AC_DEFINE_UNQUOTED(OMPI_SIZEOF_F90_INT1, $OMPI_SIZEOF_F90_INT1, [size of fortran integer*1]) @@ -1176,128 +1069,6 @@ AC_CHECK_LIB([m], [ceil]) ompi_show_title "System-specific tests" -# -# Determine corresponding C types for Fortran: LOGICAL, INTEGER, REAL, -# DOUBLE PRECISION. If we don't have a fortran compiler, assume some -# sensible defaults (although the values don't really matter). We -# need these types for the back-end MPI_Op reduction functions, -# regardless of whether we have a fortran compiler or not. -# - -if test "$OMPI_F77" != "none"; then - - # Helper function to greatly reduce code replication below - test_f77_type() { - type="$1" - size="$2" - search_c_types="$3" - fallback_c_type="$4" - want_abort="$5" - - str="foo=\$OMPI_HAVE_FORTRAN_$type" - eval $str - if test "$foo" = "1"; then - str="OMPI_SIZEOF_FORTRAN_$type=$size" - eval $str - OMPI_FIND_TYPE([Fortran $type], [FORTRAN_$type], - [$search_c_types], $want_abort) - str="foo=$MPI_FORTRAN_{$type}_TYPE" - eval $str - if test "$str" = ""; then - str="OMPI_HAVE_FORTRAN_$type=0" - eval $str - str="$OMPI_SIZEOF_FORTRAN_$type=0" - eval $str - fi - else - str="MPI_FORTRAN_${type}_TYPE=$fallback_c_type" - eval $str - fi - } - - # Find C types corresponding to the Fortran types. Note that - # it is *not* an error if we don't find a C type for any of - # the optional Fortran types (e.g., INTEGER*1). In this case, - # we'll just not support the optional Fortran type. It *is* - # an error, however, if we can't find a C type for the - # required Fortran types. - - OMPI_FIND_TYPE(Fortran LOGICAL, FORTRAN_LOGICAL, - char int int32_t) - - OMPI_FIND_TYPE(Fortran INTEGER, FORTRAN_INTEGER, - int32_t int intr64_t long:long long) - - test_f77_type INTEGER1 1 "char int8_t short int int64_t long:long long" int no - test_f77_type INTEGER2 2 "short int16_t int int64_t long:long long" int no - test_f77_type INTEGER4 4 "short int int64_t long:long long" int no - test_f77_type INTEGER8 8 "int int64_t long:long long" int no - test_f77_type INTEGER16 16 "int int64_t long:long long" int no - - OMPI_FIND_TYPE(Fortran REAL, FORTRAN_REAL, - float double long:double) - - test_f77_type REAL4 4 "float double long:double" float no - test_f77_type REAL8 8 "float double long:double" float no - test_f77_type REAL16 16 "float double long:double" float no - - OMPI_FIND_TYPE(Fortran DOUBLE PRECISION, FORTRAN_DBLPREC, - float double long:double) -else - MPI_FORTRAN_LOGICAL_TYPE=char - MPI_FORTRAN_INTEGER_TYPE=int - MPI_FORTRAN_INTEGER1_TYPE=char - MPI_FORTRAN_INTEGER2_TYPE=short - MPI_FORTRAN_INTEGER4_TYPE=int - MPI_FORTRAN_INTEGER8_TYPE=long - MPI_FORTRAN_INTEGER16_TYPE=long - MPI_FORTRAN_REAL_TYPE=float - MPI_FORTRAN_REAL4_TYPE=float - MPI_FORTRAN_REAL8_TYPE=double - MPI_FORTRAN_REAL16_TYPE="long double" - MPI_FORTRAN_DBLPREC_TYPE=double - AC_MSG_WARN([*** Did not detect a f77 compiler. Assuming default corresponding types]) - AC_MSG_WARN([*** Fortran LOGICAL = C $MPI_FORTRAN_LOGICAL_TYPE]) - AC_MSG_WARN([*** Fortran INTEGER = C $MPI_FORTRAN_INTEGER_TYPE]) - AC_MSG_WARN([*** Fortran INTEGER1 = C $MPI_FORTRAN_INTEGER1_TYPE]) - AC_MSG_WARN([*** Fortran INTEGER2 = C $MPI_FORTRAN_INTEGER2_TYPE]) - AC_MSG_WARN([*** Fortran INTEGER4 = C $MPI_FORTRAN_INTEGER4_TYPE]) - AC_MSG_WARN([*** Fortran INTEGER8 = C $MPI_FORTRAN_INTEGER8_TYPE]) - AC_MSG_WARN([*** Fortran INTEGER16 = C $MPI_FORTRAN_INTEGER16_TYPE]) - AC_MSG_WARN([*** Fortran REAL = C $MPI_FORTRAN_REAL_TYPE]) - AC_MSG_WARN([*** Fortran REAL4 = C $MPI_FORTRAN_REAL4_TYPE]) - AC_MSG_WARN([*** Fortran REAL8 = C $MPI_FORTRAN_REAL8_TYPE]) - AC_MSG_WARN([*** Fortran REAL16 = C $MPI_FORTRAN_REAL16_TYPE]) - AC_MSG_WARN([*** Fortran DOUBLE PRECISION = C $MPI_FORTRAN_DBLPREC_TYPE]) -fi -AC_DEFINE_UNQUOTED(ompi_fortran_logical_t, $MPI_FORTRAN_LOGICAL_TYPE, - [C type corresponding to Fortran LOGICAL]) - -AC_DEFINE_UNQUOTED(MPI_Fint, $MPI_FORTRAN_INTEGER_TYPE, - [C type corresponding to Fortran INTEGER]) -AC_DEFINE_UNQUOTED(ompi_fortran_integer_t, $MPI_FORTRAN_INTEGER_TYPE, - [C type corresponding to Fortran LOGICAL]) -AC_DEFINE_UNQUOTED(ompi_fortran_integer1_t, $MPI_FORTRAN_INTEGER1_TYPE, - [C type corresponding to Fortran INTEGER1]) -AC_DEFINE_UNQUOTED(ompi_fortran_integer2_t, $MPI_FORTRAN_INTEGER2_TYPE, - [C type corresponding to Fortran INTEGER2]) -AC_DEFINE_UNQUOTED(ompi_fortran_integer4_t, $MPI_FORTRAN_INTEGER4_TYPE, - [C type corresponding to Fortran INTEGER4]) -AC_DEFINE_UNQUOTED(ompi_fortran_integer8_t, $MPI_FORTRAN_INTEGER8_TYPE, - [C type corresponding to Fortran INTEGER4]) - -AC_DEFINE_UNQUOTED(ompi_fortran_real_t, $MPI_FORTRAN_REAL_TYPE, - [C type corresponding to Fortran REAL]) -AC_DEFINE_UNQUOTED(ompi_fortran_real4_t, $MPI_FORTRAN_REAL4_TYPE, - [C type corresponding to Fortran REAL4]) -AC_DEFINE_UNQUOTED(ompi_fortran_real8_t, $MPI_FORTRAN_REAL8_TYPE, - [C type corresponding to Fortran REAL8]) -AC_DEFINE_UNQUOTED(ompi_fortran_real16_t, $MPI_FORTRAN_REAL16_TYPE, - [C type corresponding to Fortran REAL16]) - -AC_DEFINE_UNQUOTED(ompi_fortran_dblprec_t, $MPI_FORTRAN_DBLPREC_TYPE, - [C type corresponding to Fortran DOUBLE PRECISION]) - # # Test to determine type of MPI_Offset. This is searched in the following order # int64_t, long long, long, int. If none of these are 8 bytes, then we should diff --git a/include/ompi_config_bottom.h b/include/ompi_config_bottom.h index f5301c0fb9..0dff5b20b6 100644 --- a/include/ompi_config_bottom.h +++ b/include/ompi_config_bottom.h @@ -75,16 +75,21 @@ * **********************************************************************/ +/* MPI_Fint is the same as ompi_fortran_INTEGER_t */ +#define MPI_Fint ompi_fortran_integer_t + /* Do we have thread support? */ #define OMPI_HAVE_THREAD_SUPPORT (OMPI_ENABLE_MPI_THREADS || OMPI_ENABLE_PROGRESS_THREADS) +#if OMPI_HAVE_FORTRAN_REAL && OMPI_HAVE_FORTRAN_COMPLEX /* * C type for Fortran COMPLEX */ typedef struct { ompi_fortran_real_t real; ompi_fortran_real_t imag; } ompi_fortran_complex_t; +#endif -#if OMPI_HAVE_FORTRAN_REAL4 +#if OMPI_HAVE_FORTRAN_REAL4 && OMPI_HAVE_FORTRAN_COMPLEX8 /* * C type for Fortran COMPLEX*8 */ typedef struct { ompi_fortran_real4_t real; @@ -92,7 +97,7 @@ typedef struct { } ompi_fortran_complex8_t; #endif -#if OMPI_HAVE_FORTRAN_REAL8 +#if OMPI_HAVE_FORTRAN_REAL8 && OMPI_HAVE_FORTRAN_COMPLEX16 /* * C type for Fortran COMPLEX*16 */ typedef struct { ompi_fortran_real8_t real; @@ -100,7 +105,7 @@ typedef struct { } ompi_fortran_complex16_t; #endif -#if OMPI_HAVE_FORTRAN_REAL16 +#if OMPI_HAVE_FORTRAN_REAL16 && OMPI_HAVE_FORTRAN_COMPLEX32 /* * C type for Fortran COMPLEX*32 */ typedef struct { ompi_fortran_real16_t real; @@ -108,11 +113,13 @@ typedef struct { } ompi_fortran_complex32_t; #endif +#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION /* * C type for Fortran DOUBLE COMPLEX */ typedef struct { - ompi_fortran_dblprec_t real; - ompi_fortran_dblprec_t imag; -} ompi_fortran_dblcomplex_t; + ompi_fortran_double_precision_t real; + ompi_fortran_double_precision_t imag; +} ompi_fortran_double_complex_t; +#endif /*********************************************************************** diff --git a/src/datatype/dt_module.c b/src/datatype/dt_module.c index 7751e9f8e1..94c7e1e009 100644 --- a/src/datatype/dt_module.c +++ b/src/datatype/dt_module.c @@ -108,7 +108,7 @@ OMPI_DECLSPEC ompi_datatype_t ompi_mpi_2int = INIT_BASIC_TYPE( DT_2INT, 2INT ); OMPI_DECLSPEC ompi_datatype_t ompi_mpi_short_int = INIT_BASIC_TYPE( DT_SHORT_INT, SHORT_INT ); OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer = INIT_BASIC_FORTRAN_TYPE( DT_INTEGER, INTEGER, OMPI_SIZEOF_FORTRAN_INTEGER, OMPI_ALIGNMENT_FORTRAN_INTEGER, DT_FLAG_DATA_INT ); OMPI_DECLSPEC ompi_datatype_t ompi_mpi_real = INIT_BASIC_FORTRAN_TYPE( DT_REAL, REAL, OMPI_SIZEOF_FORTRAN_REAL, OMPI_ALIGNMENT_FORTRAN_REAL, DT_FLAG_DATA_FLOAT ); -OMPI_DECLSPEC ompi_datatype_t ompi_mpi_dblprec = INIT_BASIC_FORTRAN_TYPE( DT_DBLPREC, DBLPREC, OMPI_SIZEOF_FORTRAN_DBLPREC, OMPI_ALIGNMENT_FORTRAN_DBLPREC, DT_FLAG_DATA_FLOAT ); +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_dblprec = INIT_BASIC_FORTRAN_TYPE( DT_DBLPREC, DBLPREC, OMPI_SIZEOF_FORTRAN_DOUBLE_PRECISION, OMPI_ALIGNMENT_FORTRAN_DOUBLE_PRECISION, DT_FLAG_DATA_FLOAT ); OMPI_DECLSPEC ompi_datatype_t ompi_mpi_2real = INIT_BASIC_TYPE( DT_2REAL, 2REAL ); OMPI_DECLSPEC ompi_datatype_t ompi_mpi_2dblprec = INIT_BASIC_TYPE( DT_2DBLPREC, 2DBLPREC ); OMPI_DECLSPEC ompi_datatype_t ompi_mpi_2integer = INIT_BASIC_TYPE( DT_2INTEGER, 2INTEGER ); @@ -127,30 +127,63 @@ OMPI_DECLSPEC ompi_datatype_t ompi_mpi_2cplex = INIT_BASIC_TYPE( DT_2COMPLEX, 2C OMPI_DECLSPEC ompi_datatype_t ompi_mpi_2dblcplex = INIT_BASIC_TYPE( DT_2DOUBLE_COMPLEX, 2DOUBLE_COMPLEX ); OMPI_DECLSPEC ompi_datatype_t ompi_mpi_unavailable = INIT_BASIC_TYPE( DT_UNAVAILABLE, UNAVAILABLE ); -OMPI_DECLSPEC ompi_datatype_t ompi_mpi_real4 = INIT_BASIC_FORTRAN_TYPE( DT_FLOAT, REAL4, sizeof(float), 4, DT_FLAG_DATA_FLOAT ); -OMPI_DECLSPEC ompi_datatype_t ompi_mpi_real8 = INIT_BASIC_FORTRAN_TYPE( DT_DOUBLE, REAL8, sizeof(double), 8, DT_FLAG_DATA_FLOAT ); -#if HAVE_LONG_DOUBLE -OMPI_DECLSPEC ompi_datatype_t ompi_mpi_real16 = INIT_BASIC_FORTRAN_TYPE( DT_LONG_DOUBLE, REAL16, sizeof(long double), 16, DT_FLAG_DATA_FLOAT ); +#if OMPI_HAVE_FORTRAN_REAL4 +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_real4 = INIT_BASIC_FORTRAN_TYPE( DT_FLOAT, REAL4, OMPI_SIZEOF_FORTRAN_REAL4, OMPI_ALIGNMENT_FORTRAN_REAL4, DT_FLAG_DATA_FLOAT ); +#else +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_real4 = INIT_BASIC_TYPE( DT_UNAVAILABLE, REAL4 ); +#endif +#if OMPI_HAVE_FORTRAN_REAL8 +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_real8 = INIT_BASIC_FORTRAN_TYPE( DT_DOUBLE, REAL8, OMPI_SIZEOF_FORTRAN_REAL8, OMPI_ALIGNMENT_FORTRAN_REAL8, DT_FLAG_DATA_FLOAT ); +#else +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_real8 = INIT_BASIC_TYPE( DT_UNAVAILABLE, REAL8 ); +#endif +#if OMPI_HAVE_FORTRAN_REAL16 +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_real16 = INIT_BASIC_FORTRAN_TYPE( DT_LONG_DOUBLE, REAL16, OMPI_SIZEOF_FORTRAN_REAL16, OMPI_ALIGNMENT_FORTRAN_REAL16, DT_FLAG_DATA_FLOAT ); #else OMPI_DECLSPEC ompi_datatype_t ompi_mpi_real16 = INIT_BASIC_TYPE( DT_UNAVAILABLE, REAL16 ); -#endif /* HAVE_LONG_DOUBLE */ -OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer1 = INIT_BASIC_FORTRAN_TYPE( DT_CHAR, INTEGER1, sizeof(char), 1, DT_FLAG_DATA_INT ); -OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer2 = INIT_BASIC_FORTRAN_TYPE( DT_SHORT, INTEGER2, sizeof(short), 2, DT_FLAG_DATA_INT ); -OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer4 = INIT_BASIC_FORTRAN_TYPE( DT_INT, INTEGER4, sizeof(int), sizeof(int), DT_FLAG_DATA_INT ); -#if HAVE_LONG_LONG -OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer8 = INIT_BASIC_FORTRAN_TYPE( DT_LONG_LONG, INTEGER8, sizeof(long long), 8, DT_FLAG_DATA_INT ); +#endif + +#if OMPI_HAVE_FORTRAN_INTEGER1 +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer1 = INIT_BASIC_FORTRAN_TYPE( DT_CHAR, INTEGER1, OMPI_SIZEOF_FORTRAN_INTEGER1, OMPI_ALIGNMENT_FORTRAN_INTEGER1, DT_FLAG_DATA_INT ); +#else +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer1 = INIT_BASIC_TYPE( DT_UNAVAILABLE, INTEGER1 ); +#endif +#if OMPI_HAVE_FORTRAN_INTEGER2 +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer2 = INIT_BASIC_FORTRAN_TYPE( DT_SHORT, INTEGER2, OMPI_SIZEOF_FORTRAN_INTEGER2, OMPI_ALIGNMENT_FORTRAN_INTEGER2, DT_FLAG_DATA_INT ); +#else +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer2 = INIT_BASIC_TYPE( DT_UNAVAILABLE, INTEGER2 ); +#endif +#if OMPI_HAVE_FORTRAN_INTEGER4 +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer4 = INIT_BASIC_FORTRAN_TYPE( DT_INT, INTEGER4, OMPI_SIZEOF_FORTRAN_INTEGER4, OMPI_ALIGNMENT_FORTRAN_INTEGER4, DT_FLAG_DATA_INT ); +#else +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer4 = INIT_BASIC_TYPE( DT_UNAVAILABLE, INTEGER4 ); +#endif +#if OMPI_HAVE_FORTRAN_INTEGER8 +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer8 = INIT_BASIC_FORTRAN_TYPE( DT_LONG_LONG, INTEGER8, OMPI_SIZEOF_FORTRAN_INTEGER8, OMPI_ALIGNMENT_FORTRAN_INTEGER8, DT_FLAG_DATA_INT ); #else OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer8 = INIT_BASIC_TYPE( DT_UNAVAILABLE, INTEGER8 ); -#endif /* HAVE_LONG_LONG */ +#endif +#if OMPI_HAVE_FORTRAN_INTEGER16 +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer16 = INIT_BASIC_FORTRAN_TYPE( DT_LONG_LONG, INTEGER16, OMPI_SIZEOF_FORTRAN_INTEGER16, OMPI_ALIGNMENT_FORTRAN_INTEGER16, DT_FLAG_DATA_INT ); +#else OMPI_DECLSPEC ompi_datatype_t ompi_mpi_integer16 = INIT_BASIC_TYPE( DT_UNAVAILABLE, INTEGER16 ); +#endif + +#if OMPI_HAVE_FORTRAN_REAL4 && OMPI_HAVE_FORTRAN_COMPLEX8 OMPI_DECLSPEC ompi_datatype_t ompi_mpi_complex8 = INIT_BASIC_FORTRAN_TYPE( DT_COMPLEX_FLOAT, COMPLEX8, OMPI_SIZEOF_FORTRAN_COMPLEX, OMPI_ALIGNMENT_FORTRAN_REAL, DT_FLAG_DATA_COMPLEX ); -OMPI_DECLSPEC ompi_datatype_t ompi_mpi_complex16 = INIT_BASIC_FORTRAN_TYPE( DT_COMPLEX_DOUBLE, COMPLEX16, OMPI_SIZEOF_FORTRAN_DBLCOMPLEX, OMPI_ALIGNMENT_FORTRAN_DBLPREC, DT_FLAG_DATA_COMPLEX ); -#if HAVE_LONG_DOUBLE -/* TODO: still have to add the discovery of long double complex in configure */ -OMPI_DECLSPEC ompi_datatype_t ompi_mpi_complex32 = INIT_BASIC_FORTRAN_TYPE( DT_COMPLEX_LONG_DOUBLE, COMPLEX32, OMPI_SIZEOF_FORTRAN_DBLCOMPLEX * 2, OMPI_ALIGNMENT_FORTRAN_DBLPREC, DT_FLAG_DATA_COMPLEX ); +#else +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_complex8 = INIT_BASIC_TYPE( DT_UNAVAILABLE, COMPLEX8 ); +#endif +#if OMPI_HAVE_FORTRAN_REAL8 && OMPI_HAVE_FORTRAN_COMPLEX16 +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_complex16 = INIT_BASIC_FORTRAN_TYPE( DT_COMPLEX_DOUBLE, COMPLEX16, OMPI_SIZEOF_FORTRAN_COMPLEX16, OMPI_ALIGNMENT_FORTRAN_COMPLEX16, DT_FLAG_DATA_COMPLEX ); +#else +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_complex16 = INIT_BASIC_TYPE( DT_UNAVAILABLE, COMPLEX16 ); +#endif +#if OMPI_HAVE_FORTRAN_REAL16 && OMPI_HAVE_FORTRAN_COMPLEX32 +OMPI_DECLSPEC ompi_datatype_t ompi_mpi_complex32 = INIT_BASIC_FORTRAN_TYPE( DT_COMPLEX_LONG_DOUBLE, COMPLEX32, OMPI_SIZEOF_COMPLEX32, OMPI_ALIGNMENT_FORTRAN_COMPLEX32, DT_FLAG_DATA_COMPLEX ); #else OMPI_DECLSPEC ompi_datatype_t ompi_mpi_complex32 = INIT_BASIC_TYPE( DT_UNAVAILABLE, COMPLEX32 ); -#endif /* HAVE_LONG_DOUBLE */ +#endif /* * NOTE: The order of this array *MUST* match what is listed in diff --git a/src/op/op.c b/src/op/op.c index 838b2a3fd3..da7b1f8347 100644 --- a/src/op/op.c +++ b/src/op/op.c @@ -52,6 +52,9 @@ OBJ_CLASS_INSTANCE(ompi_op_t, ompi_object_t, /* * Helpful defines, because there's soooo many names! */ + +/** C integer ***********************************************************/ + #define C_INTEGER(name) \ { ompi_mpi_op_##name##_int }, /* OMPI_OP_TYPE_INT */ \ { ompi_mpi_op_##name##_long }, /* OMPI_OP_TYPE_LONG */ \ @@ -67,43 +70,186 @@ OBJ_CLASS_INSTANCE(ompi_op_t, ompi_object_t, { NULL }, /* OMPI_OP_TYPE_UNSIGNED */ \ { NULL } /* OMPI_OP_TYPE_UNSIGNED_LONG */ +/** All the Fortran integers ********************************************/ + +#if OMPI_HAVE_FORTRAN_INTEGER +#define FORTRAN_INTEGER_PLAIN(name) { ompi_mpi_op_##name##_fortran_integer } +#else +#define FORTRAN_INTEGER_PLAIN(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_INTEGER1 +#define FORTRAN_INTEGER1(name) { ompi_mpi_op_##name##_fortran_integer1 } +#else +#define FORTRAN_INTEGER1(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_INTEGER2 +#define FORTRAN_INTEGER2(name) { ompi_mpi_op_##name##_fortran_integer2 } +#else +#define FORTRAN_INTEGER2(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_INTEGER4 +#define FORTRAN_INTEGER4(name) { ompi_mpi_op_##name##_fortran_integer4 } +#else +#define FORTRAN_INTEGER4(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_INTEGER8 +#define FORTRAN_INTEGER8(name) { ompi_mpi_op_##name##_fortran_integer8 } +#else +#define FORTRAN_INTEGER8(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_INTEGER16 +#define FORTRAN_INTEGER16(name) { ompi_mpi_op_##name##_fortran_integer16 } +#else +#define FORTRAN_INTEGER16(name) { NULL } +#endif #define FORTRAN_INTEGER(name) \ - { ompi_mpi_op_##name##_fortran_integer } /* OMPI_OP_TYPE_INTEGER */ + FORTRAN_INTEGER_PLAIN(name), /* OMPI_OP_TYPE_INTEGER */ \ + FORTRAN_INTEGER1(name), /* OMPI_OP_TYPE_INTEGER1 */ \ + FORTRAN_INTEGER2(name), /* OMPI_OP_TYPE_INTEGER2 */ \ + FORTRAN_INTEGER4(name), /* OMPI_OP_TYPE_INTEGER4 */ \ + FORTRAN_INTEGER8(name), /* OMPI_OP_TYPE_INTEGER8 */ \ + FORTRAN_INTEGER16(name) /* OMPI_OP_TYPE_INTEGER16 */ #define FORTRAN_INTEGER_NULL \ - { NULL } /* OMPI_OP_TYPE_INTEGER */ + { NULL }, /* OMPI_OP_TYPE_INTEGER */ \ + { NULL }, /* OMPI_OP_TYPE_INTEGER1 */ \ + { NULL }, /* OMPI_OP_TYPE_INTEGER2 */ \ + { NULL }, /* OMPI_OP_TYPE_INTEGER4 */ \ + { NULL }, /* OMPI_OP_TYPE_INTEGER8 */ \ + { NULL } /* OMPI_OP_TYPE_INTEGER16 */ + +/** All the Fortran reals ***********************************************/ + +#if OMPI_HAVE_FORTRAN_REAL +#define FLOATING_POINT_FORTRAN_REAL_PLAIN(name) { ompi_mpi_op_##name##_fortran_real } +#else +#define FLOATING_POINT_FORTRAN_REAL_PLAIN(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_REAL4 +#define FLOATING_POINT_FORTRAN_REAL4(name) { ompi_mpi_op_##name##_fortran_real4 } +#else +#define FLOATING_POINT_FORTRAN_REAL4(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_REAL8 +#define FLOATING_POINT_FORTRAN_REAL8(name) { ompi_mpi_op_##name##_fortran_real8 } +#else +#define FLOATING_POINT_FORTRAN_REAL8(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_REAL16 +#define FLOATING_POINT_FORTRAN_REAL16(name) { ompi_mpi_op_##name##_fortran_real16 } +#else +#define FLOATING_POINT_FORTRAN_REAL16(name) { NULL } +#endif + +#define FLOATING_POINT_FORTRAN_REAL(name) \ + FLOATING_POINT_FORTRAN_REAL_PLAIN(name), /* OMPI_OP_TYPE_REAL */ \ + FLOATING_POINT_FORTRAN_REAL4(name), /* OMPI_OP_TYPE_REAL4 */ \ + FLOATING_POINT_FORTRAN_REAL8(name), /* OMPI_OP_TYPE_REAL8 */ \ + FLOATING_POINT_FORTRAN_REAL16(name) /* OMPI_OP_TYPE_REAL16 */ + +/** Fortran double precision ********************************************/ + +#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION +#define FLOATING_POINT_FORTRAN_DOUBLE_PRECISION(name) \ + { ompi_mpi_op_##name##_fortran_double_precision } +#else +#define FLOATING_POINT_FORTRAN_DOUBLE_PRECISION(name) { NULL } +#endif + +/** Floating point, including all the Fortran reals *********************/ #define FLOATING_POINT(name) \ { ompi_mpi_op_##name##_float }, /* OMPI_OP_TYPE_FLOAT */\ { ompi_mpi_op_##name##_double }, /* OMPI_OP_TYPE_DOUBLE */\ - { ompi_mpi_op_##name##_fortran_real }, /* OMPI_OP_TYPE_REAL */ \ - { ompi_mpi_op_##name##_fortran_double_precision }, /* OMPI_OP_TYPE_DOUBLE_PRECISION */ \ + FLOATING_POINT_FORTRAN_REAL(name), /* OMPI_OP_TYPE_REAL */ \ + FLOATING_POINT_FORTRAN_DOUBLE_PRECISION(name), /* OMPI_OP_TYPE_DOUBLE_PRECISION */ \ { ompi_mpi_op_##name##_long_double } /* OMPI_OP_TYPE_LONG_DOUBLE */ #define FLOATING_POINT_NULL \ { NULL }, /* OMPI_OP_TYPE_FLOAT */ \ { NULL }, /* OMPI_OP_TYPE_DOUBLE */ \ { NULL }, /* OMPI_OP_TYPE_REAL */ \ + { NULL }, /* OMPI_OP_TYPE_REAL4 */ \ + { NULL }, /* OMPI_OP_TYPE_REAL8 */ \ + { NULL }, /* OMPI_OP_TYPE_REAL16 */ \ { NULL }, /* OMPI_OP_TYPE_DOUBLE_PRECISION */ \ { NULL } /* OMPI_OP_TYPE_LONG_DOUBLE */ +/** Fortran logical *****************************************************/ + +#if OMPI_HAVE_FORTRAN_LOGICAL #define LOGICAL(name) \ { ompi_mpi_op_##name##_fortran_logical } /* OMPI_OP_TYPE_LOGICAL */ +#else +#define LOGICAL(name) { NULL } +#endif #define LOGICAL_NULL \ { NULL } /* OMPI_OP_TYPE_LOGICAL */ +/** Fortran complex *****************************************************/ + +#if OMPI_HAVE_FORTRAN_REAL && OMPI_HAVE_FORTRAN_COMPLEX +#define COMPLEX_PLAIN(name) { ompi_mpi_op_##name##_fortran_complex } +#else +#define COMPLEX_PLAIN(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_REAL4 && OMPI_HAVE_FORTRAN_COMPLEX8 +#define COMPLEX8(name) { ompi_mpi_op_##name##_fortran_complex8 } +#else +#define COMPLEX8(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_REAL8 && OMPI_HAVE_FORTRAN_COMPLEX16 +#define COMPLEX16(name) { ompi_mpi_op_##name##_fortran_complex16 } +#else +#define COMPLEX16(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_REAL16 && OMPI_HAVE_FORTRAN_COMPLEX32 +#define COMPLEX32(name) { ompi_mpi_op_##name##_fortran_complex32 } +#else +#define COMPLEX32(name) { NULL } +#endif + #define COMPLEX(name) \ - { ompi_mpi_op_##name##_fortran_complex } /* OMPI_OP_TYPE_COMPLEX */ + COMPLEX_PLAIN(name), /* OMPI_OP_TYPE_COMPLEX */ \ + COMPLEX8(name), /* OMPI_OP_TYPE_COMPLEX8 */ \ + COMPLEX16(name), /* OMPI_OP_TYPE_COMPLEX16 */ \ + COMPLEX32(name) /* OMPI_OP_TYPE_COMPLEX32 */ #define COMPLEX_NULL \ - { NULL } /* OMPI_OP_TYPE_COMPLEX */ + { NULL }, /* OMPI_OP_TYPE_COMPLEX */ \ + { NULL }, /* OMPI_OP_TYPE_COMPLEX8 */ \ + { NULL }, /* OMPI_OP_TYPE_COMPLEX16 */ \ + { NULL } /* OMPI_OP_TYPE_COMPLEX32 */ + +/** Byte ****************************************************************/ #define BYTE(name) \ { ompi_mpi_op_##name##_byte } /* OMPI_OP_TYPE_BYTE */ #define BYTE_NULL \ { NULL } /* OMPI_OP_TYPE_BYTE */ +/** Fortran complex *****************************************************/ +/** Fortran "2" types ***************************************************/ + +#if OMPI_HAVE_FORTRAN_REAL +#define TWOLOC_FORTRAN_2REAL(name) { ompi_mpi_op_##name##_2real } +#else +#define TWOLOC_FORTRAN_2REAL(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION +#define TWOLOC_FORTRAN_2DOUBLE_PRECISION(name) { ompi_mpi_op_##name##_2double_precision } +#else +#define TWOLOC_FORTRAN_2DOUBLE_PRECISION(name) { NULL } +#endif +#if OMPI_HAVE_FORTRAN_INTEGER +#define TWOLOC_FORTRAN_2INTEGER(name) { ompi_mpi_op_##name##_2integer } +#else +#define TWOLOC_FORTRAN_2INTEGER(name) { NULL } +#endif + +/** All "2" types *******************************************************/ + #define TWOLOC(name) \ - { ompi_mpi_op_##name##_2real }, /* OMPI_OP_TYPE_2REAL */ \ - { ompi_mpi_op_##name##_2double_precision }, /* OMPI_OP_TYPE_2DOUBLE_PRECISION */ \ - { ompi_mpi_op_##name##_2integer }, /* OMPI_OP_TYPE_2INTEGER */ \ + TWOLOC_FORTRAN_2REAL(name), /* OMPI_OP_TYPE_2REAL */ \ + TWOLOC_FORTRAN_2DOUBLE_PRECISION(name), /* OMPI_OP_TYPE_2DOUBLE_PRECISION */ \ + TWOLOC_FORTRAN_2INTEGER(name), /* OMPI_OP_TYPE_2INTEGER */ \ { ompi_mpi_op_##name##_float_int }, /* OMPI_OP_TYPE_FLOAT_INT */ \ { ompi_mpi_op_##name##_double_int }, /* OMPI_OP_TYPE_DOUBLE_INT */ \ { ompi_mpi_op_##name##_long_int }, /* OMPI_OP_TYPE_LONG_INT */ \ diff --git a/src/op/op.h b/src/op/op.h index 1576104365..e7c5ee9eb1 100644 --- a/src/op/op.h +++ b/src/op/op.h @@ -89,6 +89,16 @@ enum { OMPI_OP_TYPE_INTEGER, /**< Fortran integer */ + OMPI_OP_TYPE_INTEGER1, + /**< Fortran integer*1 */ + OMPI_OP_TYPE_INTEGER2, + /**< Fortran integer*2 */ + OMPI_OP_TYPE_INTEGER4, + /**< Fortran integer*4 */ + OMPI_OP_TYPE_INTEGER8, + /**< Fortran integer*8 */ + OMPI_OP_TYPE_INTEGER16, + /**< Fortran integer*16 */ OMPI_OP_TYPE_FLOAT, /**< Floating point: float */ @@ -96,6 +106,12 @@ enum { /**< Floating point: double */ OMPI_OP_TYPE_REAL, /**< Floating point: real */ + OMPI_OP_TYPE_REAL4, + /**< Floating point: real*4 */ + OMPI_OP_TYPE_REAL8, + /**< Floating point: real*8 */ + OMPI_OP_TYPE_REAL16, + /**< Floating point: real*16 */ OMPI_OP_TYPE_DOUBLE_PRECISION, /**< Floating point: double precision */ OMPI_OP_TYPE_LONG_DOUBLE, @@ -106,6 +122,12 @@ enum { OMPI_OP_TYPE_COMPLEX, /**< Complex */ + OMPI_OP_TYPE_COMPLEX8, + /**< Complex8 */ + OMPI_OP_TYPE_COMPLEX16, + /**< Complex16 */ + OMPI_OP_TYPE_COMPLEX32, + /**< Complex32 */ OMPI_OP_TYPE_BYTE, /**< Byte */ diff --git a/src/op/op_predefined.c b/src/op/op_predefined.c index 891c872e77..2bcc12f776 100644 --- a/src/op/op_predefined.c +++ b/src/op/op_predefined.c @@ -142,7 +142,9 @@ FUNC_FUNC(max, long_long, long long) FUNC_FUNC(max, unsigned_long_long, unsigned long long) #endif /* Fortran integer */ -FUNC_FUNC(max, fortran_integer, MPI_Fint) +#if OMPI_HAVE_FORTRAN_INTEGER +FUNC_FUNC(max, fortran_integer, ompi_fortran_integer_t) +#endif #if OMPI_HAVE_FORTRAN_INTEGER1 FUNC_FUNC(max, fortran_integer1, ompi_fortran_integer1_t) #endif @@ -161,8 +163,12 @@ FUNC_FUNC(max, fortran_integer16, ompi_fortran_integer16_t) /* Floating point */ FUNC_FUNC(max, float, float) FUNC_FUNC(max, double, double) +#if OMPI_HAVE_FORTRAN_REAL FUNC_FUNC(max, fortran_real, ompi_fortran_real_t) -FUNC_FUNC(max, fortran_double_precision, ompi_fortran_dblprec_t) +#endif +#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION +FUNC_FUNC(max, fortran_double_precision, ompi_fortran_double_precision_t) +#endif FUNC_FUNC(max, long_double, long double) #if OMPI_HAVE_FORTRAN_REAL4 FUNC_FUNC(max, fortran_real4, ompi_fortran_real4_t) @@ -194,7 +200,9 @@ FUNC_FUNC(min, long_long, long long) FUNC_FUNC(min, unsigned_long_long, unsigned long long) #endif /* Fortran integer */ -FUNC_FUNC(min, fortran_integer, MPI_Fint) +#if OMPI_HAVE_FORTRAN_INTEGER +FUNC_FUNC(min, fortran_integer, ompi_fortran_integer_t) +#endif #if OMPI_HAVE_FORTRAN_INTEGER1 FUNC_FUNC(min, fortran_integer1, ompi_fortran_integer1_t) #endif @@ -213,8 +221,12 @@ FUNC_FUNC(min, fortran_integer16, ompi_fortran_integer16_t) /* Floating point */ FUNC_FUNC(min, float, float) FUNC_FUNC(min, double, double) +#if OMPI_HAVE_FORTRAN_REAL FUNC_FUNC(min, fortran_real, ompi_fortran_real_t) -FUNC_FUNC(min, fortran_double_precision, ompi_fortran_dblprec_t) +#endif +#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION +FUNC_FUNC(min, fortran_double_precision, ompi_fortran_double_precision_t) +#endif FUNC_FUNC(min, long_double, long double) #if OMPI_HAVE_FORTRAN_REAL4 FUNC_FUNC(min, fortran_real4, ompi_fortran_real4_t) @@ -243,7 +255,9 @@ OP_FUNC(sum, long_long, long long, +=) OP_FUNC(sum, unsigned_long_long, unsigned long long, +=) #endif /* Fortran integer */ -OP_FUNC(sum, fortran_integer, MPI_Fint, +=) +#if OMPI_HAVE_FORTRAN_INTEGER +OP_FUNC(sum, fortran_integer, ompi_fortran_integer_t, +=) +#endif #if OMPI_HAVE_FORTRAN_INTEGER1 OP_FUNC(sum, fortran_integer1, ompi_fortran_integer1_t, +=) #endif @@ -262,8 +276,12 @@ OP_FUNC(sum, fortran_integer16, ompi_fortran_integer16_t, +=) /* Floating point */ OP_FUNC(sum, float, float, +=) OP_FUNC(sum, double, double, +=) +#if OMPI_HAVE_FORTRAN_REAL OP_FUNC(sum, fortran_real, ompi_fortran_real_t, +=) -OP_FUNC(sum, fortran_double_precision, ompi_fortran_dblprec_t, +=) +#endif +#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION +OP_FUNC(sum, fortran_double_precision, ompi_fortran_double_precision_t, +=) +#endif OP_FUNC(sum, long_double, long double, +=) #if OMPI_HAVE_FORTRAN_REAL4 OP_FUNC(sum, fortran_real4, ompi_fortran_real4_t, +=) @@ -275,14 +293,16 @@ OP_FUNC(sum, fortran_real8, ompi_fortran_real8_t, +=) OP_FUNC(sum, fortran_real16, ompi_fortran_real16_t, +=) #endif /* Complex */ +#if OMPI_HAVE_FORTRAN_REAL && OMPI_HAVE_FORTRAN_COMPLEX COMPLEX_OP_FUNC_SUM(fortran_complex, ompi_fortran_complex_t) -#if OMPI_HAVE_FORTRAN_COMPLEX8 +#endif +#if OMPI_HAVE_FORTRAN_REAL4 && OMPI_HAVE_FORTRAN_COMPLEX8 COMPLEX_OP_FUNC_SUM(fortran_complex8, ompi_fortran_complex8_t) #endif -#if OMPI_HAVE_FORTRAN_COMPLEX16 +#if OMPI_HAVE_FORTRAN_REAL8 && OMPI_HAVE_FORTRAN_COMPLEX16 COMPLEX_OP_FUNC_SUM(fortran_complex16, ompi_fortran_complex16_t) #endif -#if OMPI_HAVE_FORTRAN_COMPLEX32 +#if OMPI_HAVE_FORTRAN_REAL16 && OMPI_HAVE_FORTRAN_COMPLEX32 COMPLEX_OP_FUNC_SUM(fortran_complex32, ompi_fortran_complex32_t) #endif @@ -303,7 +323,9 @@ OP_FUNC(prod, long_long, long long, +=) OP_FUNC(prod, unsigned_long_long, unsigned long long, +=) #endif /* Fortran integer */ -OP_FUNC(prod, fortran_integer, MPI_Fint, *=) +#if OMPI_HAVE_FORTRAN_INTEGER +OP_FUNC(prod, fortran_integer, ompi_fortran_integer_t, *=) +#endif #if OMPI_HAVE_FORTRAN_INTEGER1 OP_FUNC(prod, fortran_integer1, ompi_fortran_integer1_t, +=) #endif @@ -322,8 +344,12 @@ OP_FUNC(prod, fortran_integer16, ompi_fortran_integer16_t, +=) /* Floating point */ OP_FUNC(prod, float, float, *=) OP_FUNC(prod, double, double, *=) +#if OMPI_HAVE_FORTRAN_REAL OP_FUNC(prod, fortran_real, ompi_fortran_real_t, *=) -OP_FUNC(prod, fortran_double_precision, ompi_fortran_dblprec_t, *=) +#endif +#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION +OP_FUNC(prod, fortran_double_precision, ompi_fortran_double_precision_t, *=) +#endif OP_FUNC(prod, long_double, long double, *=) #if OMPI_HAVE_FORTRAN_REAL4 OP_FUNC(prod, fortran_real4, ompi_fortran_real4_t, +=) @@ -335,14 +361,16 @@ OP_FUNC(prod, fortran_real8, ompi_fortran_real8_t, +=) OP_FUNC(prod, fortran_real16, ompi_fortran_real16_t, +=) #endif /* Complex */ +#if OMPI_HAVE_FORTRAN_REAL && OMPI_HAVE_FORTRAN_COMPLEX COMPLEX_OP_FUNC_PROD(fortran_complex, ompi_fortran_complex_t) -#if OMPI_HAVE_FORTRAN_COMPLEX8 +#endif +#if OMPI_HAVE_FORTRAN_REAL4 && OMPI_HAVE_FORTRAN_COMPLEX8 COMPLEX_OP_FUNC_PROD(fortran_complex8, ompi_fortran_complex8_t) #endif -#if OMPI_HAVE_FORTRAN_COMPLEX16 +#if OMPI_HAVE_FORTRAN_REAL8 && OMPI_HAVE_FORTRAN_COMPLEX16 COMPLEX_OP_FUNC_PROD(fortran_complex16, ompi_fortran_complex16_t) #endif -#if OMPI_HAVE_FORTRAN_COMPLEX32 +#if OMPI_HAVE_FORTRAN_REAL16 && OMPI_HAVE_FORTRAN_COMPLEX32 COMPLEX_OP_FUNC_PROD(fortran_complex32, ompi_fortran_complex32_t) #endif @@ -365,7 +393,9 @@ FUNC_FUNC(land, long_long, long long) FUNC_FUNC(land, unsigned_long_long, unsigned long long) #endif /* Logical */ +#if OMPI_HAVE_FORTRAN_LOGICAL FUNC_FUNC(land, fortran_logical, ompi_fortran_logical_t) +#endif /************************************************************************* * Logical OR @@ -386,7 +416,9 @@ FUNC_FUNC(lor, long_long, long long) FUNC_FUNC(lor, unsigned_long_long, unsigned long long) #endif /* Logical */ +#if OMPI_HAVE_FORTRAN_LOGICAL FUNC_FUNC(lor, fortran_logical, ompi_fortran_logical_t) +#endif /************************************************************************* * Logical XOR @@ -407,7 +439,9 @@ FUNC_FUNC(lxor, long_long, long long) FUNC_FUNC(lxor, unsigned_long_long, unsigned long long) #endif /* Logical */ +#if OMPI_HAVE_FORTRAN_LOGICAL FUNC_FUNC(lxor, fortran_logical, ompi_fortran_logical_t) +#endif /************************************************************************* * Bitwise AND @@ -428,7 +462,9 @@ FUNC_FUNC(band, long_long, long long) FUNC_FUNC(band, unsigned_long_long, unsigned long long) #endif /* Fortran integer */ -FUNC_FUNC(band, fortran_integer, MPI_Fint) +#if OMPI_HAVE_FORTRAN_INTEGER +FUNC_FUNC(band, fortran_integer, ompi_fortran_integer_t) +#endif #if OMPI_HAVE_FORTRAN_INTEGER1 FUNC_FUNC(band, fortran_integer1, ompi_fortran_integer1_t) #endif @@ -466,7 +502,9 @@ FUNC_FUNC(bor, long_long, long long) FUNC_FUNC(bor, unsigned_long_long, unsigned long long) #endif /* Fortran integer */ -FUNC_FUNC(bor, fortran_integer, MPI_Fint) +#if OMPI_HAVE_FORTRAN_INTEGER +FUNC_FUNC(bor, fortran_integer, ompi_fortran_integer_t) +#endif #if OMPI_HAVE_FORTRAN_INTEGER1 FUNC_FUNC(bor, fortran_integer1, ompi_fortran_integer1_t) #endif @@ -504,7 +542,9 @@ FUNC_FUNC(bxor, long_long, long long) FUNC_FUNC(bxor, unsigned_long_long, unsigned long long) #endif /* Fortran integer */ -FUNC_FUNC(bxor, fortran_integer, MPI_Fint) +#if OMPI_HAVE_FORTRAN_INTEGER +FUNC_FUNC(bxor, fortran_integer, ompi_fortran_integer_t) +#endif #if OMPI_HAVE_FORTRAN_INTEGER1 FUNC_FUNC(bxor, fortran_integer1, ompi_fortran_integer1_t) #endif @@ -527,9 +567,15 @@ FUNC_FUNC(bxor, byte, char) * Min and max location "pair" datatypes *************************************************************************/ +#if OMPI_HAVE_FORTRAN_REAL LOC_STRUCT(2real, ompi_fortran_real_t, ompi_fortran_real_t) -LOC_STRUCT(2double_precision, ompi_fortran_dblprec_t, ompi_fortran_dblprec_t) +#endif +#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION +LOC_STRUCT(2double_precision, ompi_fortran_double_precision_t, ompi_fortran_double_precision_t) +#endif +#if OMPI_HAVE_FORTRAN_INTEGER LOC_STRUCT(2integer, ompi_fortran_integer_t, ompi_fortran_integer_t) +#endif LOC_STRUCT(float_int, float, int) LOC_STRUCT(double_int, double, int) LOC_STRUCT(long_int, long, int) @@ -541,9 +587,15 @@ LOC_STRUCT(long_double_int, long double, int) * Max location *************************************************************************/ +#if OMPI_HAVE_FORTRAN_REAL LOC_FUNC(maxloc, 2real, >) +#endif +#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION LOC_FUNC(maxloc, 2double_precision, >) +#endif +#if OMPI_HAVE_FORTRAN_INTEGER LOC_FUNC(maxloc, 2integer, >) +#endif LOC_FUNC(maxloc, float_int, >) LOC_FUNC(maxloc, double_int, >) LOC_FUNC(maxloc, long_int, >) @@ -555,9 +607,15 @@ LOC_FUNC(maxloc, long_double_int, >) * Min location *************************************************************************/ +#if OMPI_HAVE_FORTRAN_REAL LOC_FUNC(minloc, 2real, <) +#endif +#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION LOC_FUNC(minloc, 2double_precision, <) +#endif +#if OMPI_HAVE_FORTRAN_INTEGER LOC_FUNC(minloc, 2integer, <) +#endif LOC_FUNC(minloc, float_int, <) LOC_FUNC(minloc, double_int, <) LOC_FUNC(minloc, long_int, <) @@ -577,25 +635,59 @@ OP_FUNC(replace, unsigned_short, unsigned short, =) OP_FUNC(replace, unsigned, unsigned, =) OP_FUNC(replace, unsigned_long, unsigned long, =) /* Fortran integer */ -OP_FUNC(replace, fortran_integer, MPI_Fint, =) +#if OMPI_HAVE_FORTRAN_INTEGER +OP_FUNC(replace, fortran_integer, ompi_fortran_integer_t, =) +#endif +#if OMPI_HAVE_FORTRAN_INTEGER1 +OP_FUNC(replace, fortran_integer1, ompi_fortran_integer1_t, =) +#endif +#if OMPI_HAVE_FORTRAN_INTEGER2 +OP_FUNC(replace, fortran_integer2, ompi_fortran_integer2_t, =) +#endif +#if OMPI_HAVE_FORTRAN_INTEGER4 +OP_FUNC(replace, fortran_integer4, ompi_fortran_integer4_t, =) +#endif +#if OMPI_HAVE_FORTRAN_INTEGER8 +OP_FUNC(replace, fortran_integer8, ompi_fortran_integer8_t, =) +#endif +#if OMPI_HAVE_FORTRAN_INTEGER16 +OP_FUNC(replace, fortran_integer16, ompi_fortran_integer16_t, =) +#endif /* Floating point */ OP_FUNC(replace, float, float, =) OP_FUNC(replace, double, double, =) +#if OMPI_HAVE_FORTRAN_REAL OP_FUNC(replace, fortran_real, ompi_fortran_real_t, =) -OP_FUNC(replace, fortran_double_precision, ompi_fortran_dblprec_t, =) +#endif +#if OMPI_HAVE_FORTRAN_REAL4 +OP_FUNC(replace, fortran_real4, ompi_fortran_real4_t, =) +#endif +#if OMPI_HAVE_FORTRAN_REAL8 +OP_FUNC(replace, fortran_real8, ompi_fortran_real8_t, =) +#endif +#if OMPI_HAVE_FORTRAN_REAL16 +OP_FUNC(replace, fortran_real16, ompi_fortran_real16_t, =) +#endif +#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION +OP_FUNC(replace, fortran_double_precision, ompi_fortran_double_precision_t, =) +#endif OP_FUNC(replace, long_double, long double, =) /* Complex */ +#if OMPI_HAVE_FORTRAN_REAL && OMPI_HAVE_FORTRAN_COMPLEX OP_FUNC(replace, fortran_complex, ompi_fortran_complex_t, =) -#if OMPI_HAVE_FORTRAN_COMPLEX8 +#endif +#if OMPI_HAVE_FORTRAN_REAL4 && OMPI_HAVE_FORTRAN_COMPLEX8 OP_FUNC(replace, fortran_complex8, ompi_fortran_complex8_t, =) #endif -#if OMPI_HAVE_FORTRAN_COMPLEX16 +#if OMPI_HAVE_FORTRAN_REAL8 && OMPI_HAVE_FORTRAN_COMPLEX16 OP_FUNC(replace, fortran_complex16, ompi_fortran_complex16_t, =) #endif -#if OMPI_HAVE_FORTRAN_COMPLEX32 +#if OMPI_HAVE_FORTRAN_REAL16 && OMPI_HAVE_FORTRAN_COMPLEX32 OP_FUNC(replace, fortran_complex32, ompi_fortran_complex32_t, =) #endif /* Byte */ OP_FUNC(replace, byte, char, =) -/* Byte */ +/* Logical */ +#if OMPI_HAVE_FORTRAN_LOGICAL OP_FUNC(replace, fortran_logical, ompi_fortran_logical_t, =) +#endif