Commit 6165992c authored by James Dinan's avatar James Dinan
Browse files

[svn-r10219] Refactoring of oputil for use in RMA.

An extra argument was added to the oputil macros to provide a name,
which can be used to generate union types.  This is needed for
generating types to be included in the RMA packet headers.  The RMA code
is also modified to use this new functionality, replacing the old
hand-coded unions.

Reviewer: goodell@
parent dd49d111
......@@ -62,7 +62,8 @@ noinst_HEADERS += \
src/include/pmi.h \
src/include/pmi2.h \
src/include/rlog.h \
src/include/rlog_macros.h
src/include/rlog_macros.h \
src/include/oputil.h
src/include/param_vals.h: src/util/param/params.yml
$(top_srcdir)/maint/genparams
......@@ -5,6 +5,9 @@
* See COPYRIGHT in top-level directory.
*/
#ifndef OPUTIL_H_INCLUDED
#define OPUTIL_H_INCLUDED
/* The MPI Standard (MPI-2.1, sec 5.9.2) defines which predfined reduction
operators are valid by groups of types:
C integer
......@@ -16,16 +19,16 @@
We define an "x-macro" for each type group. Immediately prior to
instantiating any of these macros you should define a valid
MPIR_OP_TYPE_MACRO(mpi_type_,c_type_). The primary use for this is to expand
a given group's list into a sequence of case statements. The macro
MPIR_OP_TYPE_REDUCE_CASE is available as a convenience to generate a case
block that performs a reduction with the given operator. */
MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_). The primary use for this
is to expand a given group's list into a sequence of case statements. The
macro MPIR_OP_TYPE_REDUCE_CASE is available as a convenience to generate a
case block that performs a reduction with the given operator. */
#if 0 /* sample usage: */
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_,c_type_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_,c_type_,MPIR_MAX)
#define MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_,c_type_,MPIR_MAX)
/* or */
#define MPIR_OP_TYPE_MACRO(mpi_type_,c_type_) case (mpi_type_):
#define MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_) case (mpi_type_):
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
......@@ -58,148 +61,148 @@ MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
the standard macro to be expanded like any other type. */
/* first define all wrapper macros as empty for possibly non-existent types */
#define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_COMPLEX8(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_COMPLEX16(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_LONG_LONG(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_LONG_DOUBLE(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_INTEGER1_CTYPE(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_INTEGER2_CTYPE(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_INTEGER4_CTYPE(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_INTEGER8_CTYPE(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_INTEGER16_CTYPE(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_REAL4_CTYPE(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_REAL8_CTYPE(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_REAL16_CTYPE(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_CXX(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_CXX_COMPLEX(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_CXX_LONG_DOUBLE_COMPLEX(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_INT8_T(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_INT16_T(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_INT32_T(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_INT64_T(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_UINT8_T(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_UINT16_T(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_UINT32_T(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_UINT64_T(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_C_BOOL(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_C_FLOAT_COMPLEX(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_C_DOUBLE_COMPLEX(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_C_LONG_DOUBLE_COMPLEX(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_COMPLEX8(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_COMPLEX16(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_LONG_LONG(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_LONG_DOUBLE(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_INTEGER1_CTYPE(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_INTEGER2_CTYPE(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_INTEGER4_CTYPE(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_INTEGER8_CTYPE(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_INTEGER16_CTYPE(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_REAL4_CTYPE(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_REAL8_CTYPE(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_REAL16_CTYPE(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_CXX(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_CXX_COMPLEX(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_CXX_LONG_DOUBLE_COMPLEX(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_INT8_T(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_INT16_T(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_INT32_T(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_INT64_T(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_UINT8_T(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_UINT16_T(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_UINT32_T(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_UINT64_T(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_C_BOOL(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_C_FLOAT_COMPLEX(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_C_DOUBLE_COMPLEX(mpi_type_,c_type_,type_name_)
#define MPIR_OP_TYPE_MACRO_HAVE_C_LONG_DOUBLE_COMPLEX(mpi_type_,c_type_,type_name_)
/* then redefine them to be valid based on other preprocessor definitions */
#if defined(HAVE_FORTRAN_BINDING)
# undef MPIR_OP_TYPE_MACRO_HAVE_FORTRAN
# undef MPIR_OP_TYPE_MACRO_HAVE_COMPLEX8
# undef MPIR_OP_TYPE_MACRO_HAVE_COMPLEX16
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
/* These two shouldn't really be gated on HAVE_FORTRAN_BINDING alone. There
should instead be an individual test like HAVE_LONG_DOUBLE, etc. */
# define MPIR_OP_TYPE_MACRO_HAVE_COMPLEX8(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_COMPLEX16(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_COMPLEX8(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
# define MPIR_OP_TYPE_MACRO_HAVE_COMPLEX16(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(HAVE_LONG_LONG_INT)
# undef MPIR_OP_TYPE_MACRO_HAVE_LONG_LONG
# define MPIR_OP_TYPE_MACRO_HAVE_LONG_LONG(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_LONG_LONG(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(HAVE_LONG_DOUBLE)
# undef MPIR_OP_TYPE_MACRO_HAVE_LONG_DOUBLE
# define MPIR_OP_TYPE_MACRO_HAVE_LONG_DOUBLE(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_LONG_DOUBLE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
/* Fortran fixed width integer type support */
#if defined(MPIR_INTEGER1_CTYPE)
# undef MPIR_OP_TYPE_MACRO_HAVE_INTEGER1_CTYPE
# define MPIR_OP_TYPE_MACRO_HAVE_INTEGER1_CTYPE(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_INTEGER1_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(MPIR_INTEGER2_CTYPE)
# undef MPIR_OP_TYPE_MACRO_HAVE_INTEGER2_CTYPE
# define MPIR_OP_TYPE_MACRO_HAVE_INTEGER2_CTYPE(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_INTEGER2_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(MPIR_INTEGER4_CTYPE)
# undef MPIR_OP_TYPE_MACRO_HAVE_INTEGER4_CTYPE
# define MPIR_OP_TYPE_MACRO_HAVE_INTEGER4_CTYPE(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_INTEGER4_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(MPIR_INTEGER8_CTYPE)
# undef MPIR_OP_TYPE_MACRO_HAVE_INTEGER8_CTYPE
# define MPIR_OP_TYPE_MACRO_HAVE_INTEGER8_CTYPE(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_INTEGER8_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(MPIR_INTEGER16_CTYPE)
# undef MPIR_OP_TYPE_MACRO_HAVE_INTEGER16_CTYPE
# define MPIR_OP_TYPE_MACRO_HAVE_INTEGER16_CTYPE(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_INTEGER16_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
/* Fortran fixed width floating point type support */
#if defined(MPIR_REAL4_CTYPE)
# undef MPIR_OP_TYPE_MACRO_HAVE_REAL4_CTYPE
# define MPIR_OP_TYPE_MACRO_HAVE_REAL4_CTYPE(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_REAL4_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(MPIR_REAL8_CTYPE)
# undef MPIR_OP_TYPE_MACRO_HAVE_REAL8_CTYPE
# define MPIR_OP_TYPE_MACRO_HAVE_REAL8_CTYPE(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_REAL8_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(MPIR_REAL16_CTYPE)
# undef MPIR_OP_TYPE_MACRO_HAVE_REAL16_CTYPE
# define MPIR_OP_TYPE_MACRO_HAVE_REAL16_CTYPE(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_REAL16_CTYPE(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
/* general C++ types */
#if defined(HAVE_CXX_BINDING)
# undef MPIR_OP_TYPE_MACRO_HAVE_CXX
# define MPIR_OP_TYPE_MACRO_HAVE_CXX(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_CXX(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
/* C++ complex types */
#if defined(HAVE_CXX_COMPLEX)
# undef MPIR_OP_TYPE_MACRO_HAVE_CXX_COMPLEX
# define MPIR_OP_TYPE_MACRO_HAVE_CXX_COMPLEX(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_CXX_COMPLEX(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
/* also test against MPI_DATATYPE_NULL for extra safety, 0x0c000000 is the uncasted value. */
#if defined(HAVE_CXX_COMPLEX) && (MPIR_CXX_LONG_DOUBLE_COMPLEX_VALUE != 0x0c000000)
# undef MPIR_OP_TYPE_MACRO_HAVE_CXX_LONG_DOUBLE_COMPLEX
# define MPIR_OP_TYPE_MACRO_HAVE_CXX_LONG_DOUBLE_COMPLEX(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_CXX_LONG_DOUBLE_COMPLEX(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
/* C99 fixed-width types */
#if defined(HAVE_INT8_T)
# undef MPIR_OP_TYPE_MACRO_HAVE_INT8_T
# define MPIR_OP_TYPE_MACRO_HAVE_INT8_T(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_INT8_T(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(HAVE_INT16_T)
# undef MPIR_OP_TYPE_MACRO_HAVE_INT16_T
# define MPIR_OP_TYPE_MACRO_HAVE_INT16_T(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_INT16_T(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(HAVE_INT32_T)
# undef MPIR_OP_TYPE_MACRO_HAVE_INT32_T
# define MPIR_OP_TYPE_MACRO_HAVE_INT32_T(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_INT32_T(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(HAVE_INT64_T)
# undef MPIR_OP_TYPE_MACRO_HAVE_INT64_T
# define MPIR_OP_TYPE_MACRO_HAVE_INT64_T(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_INT64_T(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(HAVE_UINT8_T)
# undef MPIR_OP_TYPE_MACRO_HAVE_UINT8_T
# define MPIR_OP_TYPE_MACRO_HAVE_UINT8_T(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_UINT8_T(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(HAVE_UINT16_T)
# undef MPIR_OP_TYPE_MACRO_HAVE_UINT16_T
# define MPIR_OP_TYPE_MACRO_HAVE_UINT16_T(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_UINT16_T(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(HAVE_UINT32_T)
# undef MPIR_OP_TYPE_MACRO_HAVE_UINT32_T
# define MPIR_OP_TYPE_MACRO_HAVE_UINT32_T(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_UINT32_T(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(HAVE_UINT64_T)
# undef MPIR_OP_TYPE_MACRO_HAVE_UINT64_T
# define MPIR_OP_TYPE_MACRO_HAVE_UINT64_T(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_UINT64_T(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
/* C boolean */
#if defined(HAVE__BOOL)
#undef MPIR_OP_TYPE_MACRO_HAVE_C_BOOL
#define MPIR_OP_TYPE_MACRO_HAVE_C_BOOL(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
#define MPIR_OP_TYPE_MACRO_HAVE_C_BOOL(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
/* C complex types */
......@@ -208,18 +211,18 @@ MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
standard MPIR_OP_TYPE_MACRO. This lets us override behavior for these
natively handled types with a single macro redefinition instead of 3. */
#undef MPIR_OP_C_COMPLEX_TYPE_MACRO
#define MPIR_OP_C_COMPLEX_TYPE_MACRO(mpi_type_,c_type_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_)
#define MPIR_OP_C_COMPLEX_TYPE_MACRO(mpi_type_,c_type_,type_name_) MPIR_OP_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#if defined(HAVE_FLOAT__COMPLEX)
# undef MPIR_OP_TYPE_MACRO_HAVE_C_FLOAT_COMPLEX
# define MPIR_OP_TYPE_MACRO_HAVE_C_FLOAT_COMPLEX(mpi_type_,c_type_) MPIR_OP_C_COMPLEX_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_C_FLOAT_COMPLEX(mpi_type_,c_type_,type_name_) MPIR_OP_C_COMPLEX_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(HAVE_DOUBLE__COMPLEX)
# undef MPIR_OP_TYPE_MACRO_HAVE_C_DOUBLE_COMPLEX
# define MPIR_OP_TYPE_MACRO_HAVE_C_DOUBLE_COMPLEX(mpi_type_,c_type_) MPIR_OP_C_COMPLEX_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_C_DOUBLE_COMPLEX(mpi_type_,c_type_,type_name_) MPIR_OP_C_COMPLEX_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
#if defined(HAVE_LONG_DOUBLE__COMPLEX)
# undef MPIR_OP_TYPE_MACRO_HAVE_C_LONG_DOUBLE_COMPLEX
# define MPIR_OP_TYPE_MACRO_HAVE_C_LONG_DOUBLE_COMPLEX(mpi_type_,c_type_) MPIR_OP_C_COMPLEX_TYPE_MACRO(mpi_type_,c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_C_LONG_DOUBLE_COMPLEX(mpi_type_,c_type_,type_name_) MPIR_OP_C_COMPLEX_TYPE_MACRO(mpi_type_,c_type_,type_name_)
#endif
/* C types needed to support some of the complex types.
......@@ -264,86 +267,86 @@ typedef struct {
in this list are not a problem. */
/* c integer group */
#define MPIR_OP_TYPE_GROUP_C_INTEGER \
MPIR_OP_TYPE_MACRO(MPI_INT, int) \
MPIR_OP_TYPE_MACRO(MPI_LONG, long) \
MPIR_OP_TYPE_MACRO(MPI_SHORT, short) \
MPIR_OP_TYPE_MACRO(MPI_UNSIGNED_SHORT, unsigned short) \
MPIR_OP_TYPE_MACRO(MPI_UNSIGNED, unsigned) \
MPIR_OP_TYPE_MACRO(MPI_UNSIGNED_LONG, unsigned long) \
MPIR_OP_TYPE_MACRO_HAVE_LONG_LONG(MPI_LONG_LONG, long long) \
MPIR_OP_TYPE_MACRO_HAVE_LONG_LONG(MPI_UNSIGNED_LONG_LONG, unsigned long long) \
MPIR_OP_TYPE_MACRO(MPI_SIGNED_CHAR, signed char) \
MPIR_OP_TYPE_MACRO(MPI_UNSIGNED_CHAR, unsigned char) \
MPIR_OP_TYPE_MACRO_HAVE_INT8_T(MPI_INT8_T, int8_t) \
MPIR_OP_TYPE_MACRO_HAVE_INT16_T(MPI_INT16_T, int16_t) \
MPIR_OP_TYPE_MACRO_HAVE_INT32_T(MPI_INT32_T, int32_t) \
MPIR_OP_TYPE_MACRO_HAVE_INT64_T(MPI_INT64_T, int64_t) \
MPIR_OP_TYPE_MACRO_HAVE_UINT8_T(MPI_UINT8_T, uint8_t) \
MPIR_OP_TYPE_MACRO_HAVE_UINT16_T(MPI_UINT16_T, uint16_t) \
MPIR_OP_TYPE_MACRO_HAVE_UINT32_T(MPI_UINT32_T, uint32_t) \
MPIR_OP_TYPE_MACRO_HAVE_UINT64_T(MPI_UINT64_T, uint64_t) \
#define MPIR_OP_TYPE_GROUP_C_INTEGER \
MPIR_OP_TYPE_MACRO(MPI_INT, int, mpir_typename_int) \
MPIR_OP_TYPE_MACRO(MPI_LONG, long, mpir_typename_long) \
MPIR_OP_TYPE_MACRO(MPI_SHORT, short, mpir_typename_short) \
MPIR_OP_TYPE_MACRO(MPI_UNSIGNED_SHORT, unsigned short, mpir_typename_unsigned_short) \
MPIR_OP_TYPE_MACRO(MPI_UNSIGNED, unsigned, mpir_typename_unsigned) \
MPIR_OP_TYPE_MACRO(MPI_UNSIGNED_LONG, unsigned long, mpir_typename_unsigned_long) \
MPIR_OP_TYPE_MACRO_HAVE_LONG_LONG(MPI_LONG_LONG, long long, mpir_typename_long_long) \
MPIR_OP_TYPE_MACRO_HAVE_LONG_LONG(MPI_UNSIGNED_LONG_LONG, unsigned long long, mpir_typename_unsigned_long_long) \
MPIR_OP_TYPE_MACRO(MPI_SIGNED_CHAR, signed char, mpir_typename_signed_char) \
MPIR_OP_TYPE_MACRO(MPI_UNSIGNED_CHAR, unsigned char, mpir_typename_unsigned_char) \
MPIR_OP_TYPE_MACRO_HAVE_INT8_T(MPI_INT8_T, int8_t, mpir_typename_int8_t) \
MPIR_OP_TYPE_MACRO_HAVE_INT16_T(MPI_INT16_T, int16_t, mpir_typename_int16_t) \
MPIR_OP_TYPE_MACRO_HAVE_INT32_T(MPI_INT32_T, int32_t, mpir_typename_int32_t) \
MPIR_OP_TYPE_MACRO_HAVE_INT64_T(MPI_INT64_T, int64_t, mpir_typename_int64_t) \
MPIR_OP_TYPE_MACRO_HAVE_UINT8_T(MPI_UINT8_T, uint8_t, mpir_typename_uint8_t) \
MPIR_OP_TYPE_MACRO_HAVE_UINT16_T(MPI_UINT16_T, uint16_t, mpir_typename_uint16_t) \
MPIR_OP_TYPE_MACRO_HAVE_UINT32_T(MPI_UINT32_T, uint32_t, mpir_typename_uint32_t) \
MPIR_OP_TYPE_MACRO_HAVE_UINT64_T(MPI_UINT64_T, uint64_t, mpir_typename_uint64_t) \
/* The MPI Standard doesn't include these types in the C integer group for
predefined operations but MPICH2 supports them when possible. */
#define MPIR_OP_TYPE_GROUP_C_INTEGER_EXTRA \
MPIR_OP_TYPE_MACRO(MPI_CHAR, char)
#define MPIR_OP_TYPE_GROUP_C_INTEGER_EXTRA \
MPIR_OP_TYPE_MACRO(MPI_CHAR, char, mpir_typename_char)
/* fortran integer group */
#define MPIR_OP_TYPE_GROUP_FORTRAN_INTEGER \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_INTEGER, MPI_Fint) \
MPIR_OP_TYPE_MACRO(MPI_AINT, MPI_Aint) \
MPIR_OP_TYPE_MACRO(MPI_OFFSET, MPI_Offset)
#define MPIR_OP_TYPE_GROUP_FORTRAN_INTEGER \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_INTEGER, MPI_Fint, mpir_typename_integer) \
MPIR_OP_TYPE_MACRO(MPI_AINT, MPI_Aint, mpir_typename_aint) \
MPIR_OP_TYPE_MACRO(MPI_OFFSET, MPI_Offset, mpir_typename_offset)
/* The MPI Standard doesn't include these types in the Fortran integer group for
predefined operations but MPICH2 supports them when possible. */
#define MPIR_OP_TYPE_GROUP_FORTRAN_INTEGER_EXTRA \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_CHARACTER, char) \
MPIR_OP_TYPE_MACRO_HAVE_INTEGER1_CTYPE(MPI_INTEGER1, MPIR_INTEGER1_CTYPE) \
MPIR_OP_TYPE_MACRO_HAVE_INTEGER2_CTYPE(MPI_INTEGER2, MPIR_INTEGER2_CTYPE) \
MPIR_OP_TYPE_MACRO_HAVE_INTEGER4_CTYPE(MPI_INTEGER4, MPIR_INTEGER4_CTYPE) \
MPIR_OP_TYPE_MACRO_HAVE_INTEGER8_CTYPE(MPI_INTEGER8, MPIR_INTEGER8_CTYPE) \
MPIR_OP_TYPE_MACRO_HAVE_INTEGER16_CTYPE(MPI_INTEGER16, MPIR_INTEGER16_CTYPE)
#define MPIR_OP_TYPE_GROUP_FORTRAN_INTEGER_EXTRA \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_CHARACTER, char, mpir_typename_character) \
MPIR_OP_TYPE_MACRO_HAVE_INTEGER1_CTYPE(MPI_INTEGER1, MPIR_INTEGER1_CTYPE, mpir_typename_integer1) \
MPIR_OP_TYPE_MACRO_HAVE_INTEGER2_CTYPE(MPI_INTEGER2, MPIR_INTEGER2_CTYPE, mpir_typename_integer2) \
MPIR_OP_TYPE_MACRO_HAVE_INTEGER4_CTYPE(MPI_INTEGER4, MPIR_INTEGER4_CTYPE, mpir_typename_integer4) \
MPIR_OP_TYPE_MACRO_HAVE_INTEGER8_CTYPE(MPI_INTEGER8, MPIR_INTEGER8_CTYPE, mpir_typename_integer8) \
MPIR_OP_TYPE_MACRO_HAVE_INTEGER16_CTYPE(MPI_INTEGER16, MPIR_INTEGER16_CTYPE, mpir_typename_integer16)
/* floating point group */
/* FIXME: REAL need not be float, nor DOUBLE_PRECISION be double.
Fortran types are not synonyms for the C types */
#define MPIR_OP_TYPE_GROUP_FLOATING_POINT \
MPIR_OP_TYPE_MACRO(MPI_FLOAT, float) \
MPIR_OP_TYPE_MACRO(MPI_DOUBLE, double) \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_REAL, MPIR_FC_REAL_CTYPE) \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_DOUBLE_PRECISION, MPIR_FC_DOUBLE_CTYPE)\
MPIR_OP_TYPE_MACRO_HAVE_LONG_DOUBLE(MPI_LONG_DOUBLE, long double) \
#define MPIR_OP_TYPE_GROUP_FLOATING_POINT \
MPIR_OP_TYPE_MACRO(MPI_FLOAT, float, mpir_typename_float) \
MPIR_OP_TYPE_MACRO(MPI_DOUBLE, double, mpir_typename_double) \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_REAL, MPIR_FC_REAL_CTYPE, mpir_typename_real) \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_DOUBLE_PRECISION, MPIR_FC_DOUBLE_CTYPE, mpir_typename_double_precision) \
MPIR_OP_TYPE_MACRO_HAVE_LONG_DOUBLE(MPI_LONG_DOUBLE, long double, mpir_typename_long_double) \
/* The MPI Standard doesn't include these types in the floating point group for
predefined operations but MPICH2 supports them when possible. */
#define MPIR_OP_TYPE_GROUP_FLOATING_POINT_EXTRA \
MPIR_OP_TYPE_MACRO_HAVE_REAL4_CTYPE(MPI_REAL4, MPIR_REAL4_CTYPE) \
MPIR_OP_TYPE_MACRO_HAVE_REAL8_CTYPE(MPI_REAL8, MPIR_REAL8_CTYPE) \
MPIR_OP_TYPE_MACRO_HAVE_REAL16_CTYPE(MPI_REAL16, MPIR_REAL16_CTYPE)
#define MPIR_OP_TYPE_GROUP_FLOATING_POINT_EXTRA \
MPIR_OP_TYPE_MACRO_HAVE_REAL4_CTYPE(MPI_REAL4, MPIR_REAL4_CTYPE, mpir_typename_real4) \
MPIR_OP_TYPE_MACRO_HAVE_REAL8_CTYPE(MPI_REAL8, MPIR_REAL8_CTYPE, mpir_typename_real8) \
MPIR_OP_TYPE_MACRO_HAVE_REAL16_CTYPE(MPI_REAL16, MPIR_REAL16_CTYPE, mpir_typename_real16)
/* logical group */
/* FIXME Is MPI_Fint really OK here? */
#define MPIR_OP_TYPE_GROUP_LOGICAL \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_LOGICAL, MPI_Fint) \
MPIR_OP_TYPE_MACRO_HAVE_C_BOOL(MPI_C_BOOL, _Bool) \
MPIR_OP_TYPE_MACRO_HAVE_CXX(MPIR_CXX_BOOL_VALUE, MPIR_CXX_BOOL_CTYPE)
#define MPIR_OP_TYPE_GROUP_LOGICAL \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_LOGICAL, MPI_Fint, mpir_typename_logical) \
MPIR_OP_TYPE_MACRO_HAVE_C_BOOL(MPI_C_BOOL, _Bool, mpir_typename_c_bool) \
MPIR_OP_TYPE_MACRO_HAVE_CXX(MPIR_CXX_BOOL_VALUE, MPIR_CXX_BOOL_CTYPE, mpir_typename_cxx_bool_value)
#define MPIR_OP_TYPE_GROUP_LOGICAL_EXTRA /* empty, provided for consistency */
/* complex group */
#define MPIR_OP_TYPE_GROUP_COMPLEX \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_COMPLEX, s_fc_complex) \
MPIR_OP_TYPE_MACRO_HAVE_C_FLOAT_COMPLEX(MPI_C_FLOAT_COMPLEX, float _Complex) \
MPIR_OP_TYPE_MACRO_HAVE_C_DOUBLE_COMPLEX(MPI_C_DOUBLE_COMPLEX, double _Complex) \
MPIR_OP_TYPE_MACRO_HAVE_C_LONG_DOUBLE_COMPLEX(MPI_C_LONG_DOUBLE_COMPLEX, long double _Complex)
#define MPIR_OP_TYPE_GROUP_COMPLEX_EXTRA \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_DOUBLE_COMPLEX, d_fc_complex) \
MPIR_OP_TYPE_MACRO_HAVE_COMPLEX8(MPI_COMPLEX8, s_complex) \
MPIR_OP_TYPE_MACRO_HAVE_COMPLEX16(MPI_COMPLEX16, d_complex) \
MPIR_OP_TYPE_MACRO_HAVE_CXX_COMPLEX(MPIR_CXX_COMPLEX_VALUE, s_complex) \
MPIR_OP_TYPE_MACRO_HAVE_CXX_COMPLEX(MPIR_CXX_DOUBLE_COMPLEX_VALUE, d_complex) \
MPIR_OP_TYPE_MACRO_HAVE_CXX_LONG_DOUBLE_COMPLEX(MPIR_CXX_LONG_DOUBLE_COMPLEX_VALUE, ld_complex)
#define MPIR_OP_TYPE_GROUP_COMPLEX \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_COMPLEX, s_fc_complex, mpir_typename_complex) \
MPIR_OP_TYPE_MACRO_HAVE_C_FLOAT_COMPLEX(MPI_C_FLOAT_COMPLEX, float _Complex, mpir_typename_c_float_complex) \
MPIR_OP_TYPE_MACRO_HAVE_C_DOUBLE_COMPLEX(MPI_C_DOUBLE_COMPLEX, double _Complex, mpir_typename_c_double_complex) \
MPIR_OP_TYPE_MACRO_HAVE_C_LONG_DOUBLE_COMPLEX(MPI_C_LONG_DOUBLE_COMPLEX, long double _Complex, mpir_typename_c_long_double_complex)
#define MPIR_OP_TYPE_GROUP_COMPLEX_EXTRA \
MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(MPI_DOUBLE_COMPLEX, d_fc_complex, mpir_typename_double_complex) \
MPIR_OP_TYPE_MACRO_HAVE_COMPLEX8(MPI_COMPLEX8, s_complex, mpir_typename_complex8) \
MPIR_OP_TYPE_MACRO_HAVE_COMPLEX16(MPI_COMPLEX16, d_complex, mpir_typename_complex16) \
MPIR_OP_TYPE_MACRO_HAVE_CXX_COMPLEX(MPIR_CXX_COMPLEX_VALUE, s_complex, mpir_typename_cxx_complex_value) \
MPIR_OP_TYPE_MACRO_HAVE_CXX_COMPLEX(MPIR_CXX_DOUBLE_COMPLEX_VALUE, d_complex, mpir_typename_cxx_double_complex_value) \
MPIR_OP_TYPE_MACRO_HAVE_CXX_LONG_DOUBLE_COMPLEX(MPIR_CXX_LONG_DOUBLE_COMPLEX_VALUE, ld_complex, mpir_typename_cxx_long_double_complex_value)
/* byte group */
#define MPIR_OP_TYPE_GROUP_BYTE \
MPIR_OP_TYPE_MACRO(MPI_BYTE, unsigned char)
#define MPIR_OP_TYPE_GROUP_BYTE \
MPIR_OP_TYPE_MACRO(MPI_BYTE, unsigned char, mpir_typename_byte)
#define MPIR_OP_TYPE_GROUP_BYTE_EXTRA /* empty, provided for consistency */
/* convenience macro that just is all non-extra groups concatenated */
......@@ -364,3 +367,4 @@ typedef struct {
MPIR_OP_TYPE_GROUP(COMPLEX_EXTRA) \
MPIR_OP_TYPE_GROUP(BYTE_EXTRA)
#endif /* OPUTIL_H_INCLUDED */
......@@ -30,7 +30,7 @@ void MPIR_BAND (
switch (*type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LBAND)
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LBAND)
/* no semicolons by necessity */
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
......@@ -60,7 +60,7 @@ int MPIR_BAND_check_dtype ( MPI_Datatype type )
{
switch (type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) case (mpi_type_):
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) case (mpi_type_):
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
MPIR_OP_TYPE_GROUP(BYTE)
......
......@@ -30,7 +30,7 @@ void MPIR_BOR (
switch (*type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LBOR)
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LBOR)
/* no semicolons by necessity */
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
......@@ -60,7 +60,7 @@ int MPIR_BOR_check_dtype ( MPI_Datatype type )
{
switch (type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) case (mpi_type_):
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) case (mpi_type_):
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
MPIR_OP_TYPE_GROUP(BYTE)
......
......@@ -30,7 +30,7 @@ void MPIR_BXOR (
switch (*type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LBXOR)
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LBXOR)
/* no semicolons by necessity */
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
......@@ -60,7 +60,7 @@ int MPIR_BXOR_check_dtype ( MPI_Datatype type )
{
switch (type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) case (mpi_type_):
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) case (mpi_type_):
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
MPIR_OP_TYPE_GROUP(BYTE)
......
......@@ -39,14 +39,14 @@ void MPIR_LAND (
switch (*type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LLAND)
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LLAND)
/* no semicolons by necessity */
MPIR_OP_TYPE_GROUP(C_INTEGER)
/* MPI_LOGICAL requires special handling (MPIR_{TO,FROM}_FLOG) */
#if defined(HAVE_FORTRAN_BINDING)
# undef MPIR_OP_TYPE_MACRO_HAVE_FORTRAN
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_, c_type_) \
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_, c_type_, type_name_) \
case (mpi_type_): { \
c_type_ * restrict a = (c_type_ *)inoutvec; \
c_type_ * restrict b = (c_type_ *)invec; \
......@@ -60,7 +60,7 @@ void MPIR_LAND (
MPIR_OP_TYPE_GROUP(LOGICAL_EXTRA)
/* now revert _HAVE_FORTRAN macro to default */
# undef MPIR_OP_TYPE_MACRO_HAVE_FORTRAN
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_, c_type_) MPIR_OP_TYPE_MACRO(mpi_type_, c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_)
#else
/* if we don't have Fortran support then we don't have to jump through
any hoops, simply expand the group */
......@@ -97,7 +97,7 @@ int MPIR_LAND_check_dtype ( MPI_Datatype type )
{
switch (type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) case (mpi_type_):
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) case (mpi_type_):
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(LOGICAL) /* no special handling needed in check_dtype code */
MPIR_OP_TYPE_GROUP(LOGICAL_EXTRA)
......
......@@ -39,14 +39,14 @@ void MPIR_LOR (
switch (*type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LLOR)
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LLOR)
/* no semicolons by necessity */
MPIR_OP_TYPE_GROUP(C_INTEGER)
/* MPI_LOGICAL requires special handling (MPIR_{TO,FROM}_FLOG) */
#if defined(HAVE_FORTRAN_BINDING)
# undef MPIR_OP_TYPE_MACRO_HAVE_FORTRAN
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_, c_type_) \
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_, c_type_, type_name_) \
case (mpi_type_): { \
c_type_ * restrict a = (c_type_ *)inoutvec; \
c_type_ * restrict b = (c_type_ *)invec; \
......@@ -60,7 +60,7 @@ void MPIR_LOR (
MPIR_OP_TYPE_GROUP(LOGICAL_EXTRA)
/* now revert _HAVE_FORTRAN macro to default */
# undef MPIR_OP_TYPE_MACRO_HAVE_FORTRAN
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_, c_type_) MPIR_OP_TYPE_MACRO(mpi_type_, c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_)
#else
/* if we don't have Fortran support then we don't have to jump through
any hoops, simply expand the group */
......@@ -97,7 +97,7 @@ int MPIR_LOR_check_dtype ( MPI_Datatype type )
{
switch (type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) case (mpi_type_):
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) case (mpi_type_):
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(LOGICAL) /* no special handling needed in check_dtype code */
MPIR_OP_TYPE_GROUP(LOGICAL_EXTRA)
......
......@@ -39,14 +39,14 @@ void MPIR_LXOR (
switch (*type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LLXOR)
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LLXOR)
/* no semicolons by necessity */
MPIR_OP_TYPE_GROUP(C_INTEGER)
/* MPI_LOGICAL requires special handling (MPIR_{TO,FROM}_FLOG) */
#if defined(HAVE_FORTRAN_BINDING)
# undef MPIR_OP_TYPE_MACRO_HAVE_FORTRAN
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_, c_type_) \
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_, c_type_, type_name_) \
case (mpi_type_): { \
c_type_ * restrict a = (c_type_ *)inoutvec; \
c_type_ * restrict b = (c_type_ *)invec; \
......@@ -60,7 +60,7 @@ void MPIR_LXOR (
MPIR_OP_TYPE_GROUP(LOGICAL_EXTRA)
/* now revert _HAVE_FORTRAN macro to default */
# undef MPIR_OP_TYPE_MACRO_HAVE_FORTRAN
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_, c_type_) MPIR_OP_TYPE_MACRO(mpi_type_, c_type_)
# define MPIR_OP_TYPE_MACRO_HAVE_FORTRAN(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_)
#else
/* if we don't have Fortran support then we don't have to jump through
any hoops, simply expand the group */
......@@ -97,7 +97,7 @@ int MPIR_LXOR_check_dtype ( MPI_Datatype type )
{
switch (type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) case (mpi_type_):
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) case (mpi_type_):
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(LOGICAL) /* no special handling needed in check_dtype code */
MPIR_OP_TYPE_GROUP(LOGICAL_EXTRA)
......
......@@ -27,7 +27,7 @@ void MPIR_MAXF(
switch (*type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_MAX)
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_MAX)
/* no semicolons by necessity */
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
......@@ -57,7 +57,7 @@ int MPIR_MAXF_check_dtype( MPI_Datatype type )
{
switch (type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) case (mpi_type_):
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) case (mpi_type_):
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
MPIR_OP_TYPE_GROUP(FLOATING_POINT)
......
......@@ -26,7 +26,7 @@ void MPIR_MINF (
switch (*type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_MIN)
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_MIN)
/* no semicolons by necessity */
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
......@@ -56,7 +56,7 @@ int MPIR_MINF_check_dtype ( MPI_Datatype type )
{
switch (type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) case (mpi_type_):
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) case (mpi_type_):
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
MPIR_OP_TYPE_GROUP(FLOATING_POINT)
......
......@@ -28,7 +28,7 @@ void MPIR_PROD (
switch (*type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LPROD)
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_, c_type_, MPIR_LPROD)
/* no semicolons by necessity */
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
......@@ -40,7 +40,7 @@ void MPIR_PROD (
/* complex multiplication is slightly different than scalar multiplication */
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) \
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_, type_name_) \
case (mpi_type_): { \
c_type_ * restrict a = (c_type_ *)inoutvec; \
c_type_ * restrict b = (c_type_ *)invec; \
......@@ -53,13 +53,13 @@ void MPIR_PROD (
break; \
}
#undef MPIR_OP_C_COMPLEX_TYPE_MACRO
#define MPIR_OP_C_COMPLEX_TYPE_MACRO(mpi_type_,c_type_) MPIR_OP_TYPE_REDUCE_CASE(mpi_type_,c_type_,MPIR_LPROD)