Cleanup complex datatypes and update datatypes and operator code to use C99.
This commit changes the underlying opal complex datatypes to match the C99 types: float _Complex, double _Complex, and long double _Complex. The fortran and C++ types now are aliases to these basic types instead of structure types. The operators in ompi/mca/op/base now work on only the C99 types and the fortran types use these operators if the fortran type matches a C complex type (this should almost always be the case.) C99 is not is use in both the datatype and operator code and should make the code both cleaner and much less fragile. This commit was SVN r29193.
Этот коммит содержится в:
родитель
601f9e37cd
Коммит
7929fb9dea
@ -1,10 +1,12 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2009-2010 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
||||
* Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -391,17 +393,17 @@ extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX
|
||||
*/
|
||||
|
||||
#define OMPI_DATATYPE_EMPTY_DATA(NAME) \
|
||||
OMPI_DATATYPE_MPI_ ## NAME /*id*/, \
|
||||
0 /*d_f_to_c_index*/, \
|
||||
NULL /*d_keyhash*/, \
|
||||
NULL /*args*/, \
|
||||
NULL /*packed_description*/, \
|
||||
"MPI_" # NAME /*name*/
|
||||
.id = OMPI_DATATYPE_MPI_ ## NAME, \
|
||||
.d_f_to_c_index = 0, \
|
||||
.d_keyhash = NULL, \
|
||||
.args = NULL, \
|
||||
.packed_description = NULL, \
|
||||
.name = "MPI_" # NAME
|
||||
|
||||
#define OMPI_DATATYPE_INITIALIZER_UNAVAILABLE(FLAGS) \
|
||||
OPAL_DATATYPE_INITIALIZER_UNAVAILABLE(FLAGS)
|
||||
|
||||
#define OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE( TYPE, NAME, FLAGS ) \
|
||||
#define OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_X( TYPE, NAME, FLAGS ) \
|
||||
{ /*ompi_predefined_datatype_t*/ \
|
||||
{ /* ompi_datatype_t */ \
|
||||
OMPI_DATATYPE_INITIALIZER_ ## TYPE (OMPI_DATATYPE_FLAG_PREDEFINED | \
|
||||
@ -410,6 +412,10 @@ extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX
|
||||
}, \
|
||||
{0, } /* padding */ \
|
||||
}
|
||||
|
||||
/* Preprocessor hack to make sure TYPE gets expanded properly */
|
||||
#define OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE(TYPE, NAME, FLAGS) OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_X(TYPE, NAME, FLAGS)
|
||||
|
||||
/*
|
||||
* Two macros for convenience
|
||||
*/
|
||||
@ -437,29 +443,29 @@ extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX
|
||||
*/
|
||||
#define OMPI_DATATYPE_INITIALIZER_FORTRAN( TYPE, NAME, SIZE, ALIGN, FLAGS ) \
|
||||
{ \
|
||||
OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
OPAL_DATATYPE_FLAG_BASIC | \
|
||||
.super = OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
.flags = OPAL_DATATYPE_FLAG_BASIC | \
|
||||
OMPI_DATATYPE_FLAG_PREDEFINED | \
|
||||
OMPI_DATATYPE_FLAG_DATA_FORTRAN | (FLAGS) /*flag*/, \
|
||||
OPAL_DATATYPE_ ## TYPE ## SIZE /*id*/, \
|
||||
(((uint32_t)1)<<(OPAL_DATATYPE_ ## TYPE ## SIZE)) /*bdt_used*/, \
|
||||
SIZE /*size*/, \
|
||||
0 /*true_lb*/, SIZE /*true_ub*/, 0 /*lb*/, SIZE /*ub*/, \
|
||||
(ALIGN) /*align*/, \
|
||||
1 /*nbElems*/, \
|
||||
OPAL_DATATYPE_INIT_NAME(TYPE ## SIZE) /*name*/, \
|
||||
OPAL_DATATYPE_INIT_DESC_PREDEFINED(TYPE ## SIZE) /*desc*/, \
|
||||
OPAL_DATATYPE_INIT_DESC_PREDEFINED(TYPE ## SIZE) /*opt_desc*/, \
|
||||
OPAL_DATATYPE_INIT_BTYPES_ARRAY_ ## TYPE ## SIZE /*btypes*/ \
|
||||
OMPI_DATATYPE_FLAG_DATA_FORTRAN | (FLAGS), \
|
||||
.id = OPAL_DATATYPE_ ## TYPE ## SIZE, \
|
||||
.bdt_used = (((uint32_t)1)<<(OPAL_DATATYPE_ ## TYPE ## SIZE)), \
|
||||
.size = SIZE, \
|
||||
.true_lb = 0, .true_ub = SIZE, .lb = 0, .ub = SIZE, \
|
||||
.align = (ALIGN), \
|
||||
.nbElems = 1, \
|
||||
.name = OPAL_DATATYPE_INIT_NAME(TYPE ## SIZE), \
|
||||
.desc = OPAL_DATATYPE_INIT_DESC_PREDEFINED(TYPE ## SIZE), \
|
||||
.opt_desc = OPAL_DATATYPE_INIT_DESC_PREDEFINED(TYPE ## SIZE), \
|
||||
.btypes = OPAL_DATATYPE_INIT_BTYPES_ARRAY(TYPE ## SIZE) \
|
||||
}
|
||||
|
||||
#define OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_FORTRAN( TYPE, NAME, SIZE, ALIGN, FLAGS ) \
|
||||
{ /*ompi_predefined_datatype_t*/ \
|
||||
{ /*ompi_datatype_t*/ \
|
||||
OMPI_DATATYPE_INITIALIZER_FORTRAN( TYPE, NAME, SIZE, ALIGN, FLAGS) /*super*/, \
|
||||
.dt = { \
|
||||
.super = OMPI_DATATYPE_INITIALIZER_FORTRAN( TYPE, NAME, SIZE, ALIGN, FLAGS), \
|
||||
OMPI_DATATYPE_EMPTY_DATA(NAME) /*id,d_f_to_c_index,d_keyhash,args,packed_description,name*/ \
|
||||
}, \
|
||||
{0, } /* padding */ \
|
||||
.padding = {0, } \
|
||||
}
|
||||
#else
|
||||
#define OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_FORTRAN( TYPE, NAME, SIZE, ALIGN, FLAGS ) \
|
||||
@ -601,18 +607,15 @@ extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX
|
||||
|
||||
#define OMPI_DATATYPE_INITIALIZER_WCHAR OPAL_DATATYPE_INITIALIZER_WCHAR
|
||||
|
||||
#define OMPI_DATATYPE_INITIALIZER_C_FLOAT_COMPLEX OPAL_DATATYPE_INITIALIZER_FLOAT_COMPLEX
|
||||
#define OMPI_DATATYPE_INITIALIZER_C_DOUBLE_COMPLEX OPAL_DATATYPE_INITIALIZER_DOUBLE_COMPLEX
|
||||
#define OMPI_DATATYPE_INITIALIZER_C_LONG_DOUBLE_COMPLEX OPAL_DATATYPE_INITIALIZER_LONG_DOUBLE_COMPLEX
|
||||
|
||||
/*
|
||||
* Following are the structured types, that cannot be represented
|
||||
* by one single OPAL basic type
|
||||
*/
|
||||
#define OMPI_DATATYPE_FIRST_TYPE OPAL_DATATYPE_MAX_PREDEFINED
|
||||
#define OMPI_DATATYPE_COMPLEX (OMPI_DATATYPE_FIRST_TYPE+0) /* Equal to OMPI_DATATYPE_FIRST_TYPE */
|
||||
#define OMPI_DATATYPE_DOUBLE_COMPLEX (OMPI_DATATYPE_FIRST_TYPE+1)
|
||||
#define OMPI_DATATYPE_LONG_DOUBLE_COMPLEX (OMPI_DATATYPE_FIRST_TYPE+2)
|
||||
|
||||
#define OMPI_DATATYPE_COMPLEX8 (OMPI_DATATYPE_FIRST_TYPE+3)
|
||||
#define OMPI_DATATYPE_COMPLEX16 (OMPI_DATATYPE_FIRST_TYPE+4)
|
||||
#define OMPI_DATATYPE_COMPLEX32 (OMPI_DATATYPE_FIRST_TYPE+5)
|
||||
|
||||
/*
|
||||
* Derived datatypes supposely contiguous
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
@ -13,6 +13,8 @@
|
||||
* 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 (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -101,15 +103,63 @@ ompi_predefined_datatype_t ompi_mpi_packed = OMPI_DATATYPE_INIT_PREDEFIN
|
||||
/*
|
||||
* C++ / C99 datatypes
|
||||
*/
|
||||
ompi_predefined_datatype_t ompi_mpi_c_bool = OMPI_DATATYPE_INIT_PREDEFINED (BOOL, OMPI_DATATYPE_FLAG_DATA_C);
|
||||
ompi_predefined_datatype_t ompi_mpi_cxx_bool = OMPI_DATATYPE_INIT_PREDEFINED (BOOL, OMPI_DATATYPE_FLAG_DATA_CPP);
|
||||
ompi_predefined_datatype_t ompi_mpi_cxx_cplex = OMPI_DATATYPE_INIT_DEFER (COMPLEX, OMPI_DATATYPE_FLAG_DATA_CPP | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
ompi_predefined_datatype_t ompi_mpi_cxx_dblcplex = OMPI_DATATYPE_INIT_DEFER (DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_CPP | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
|
||||
/*
|
||||
* Complex datatypes for C (base types), C++, and fortran
|
||||
*/
|
||||
ompi_predefined_datatype_t ompi_mpi_c_float_complex = OMPI_DATATYPE_INIT_PREDEFINED (C_FLOAT_COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
ompi_predefined_datatype_t ompi_mpi_c_complex = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE (C_FLOAT_COMPLEX, C_COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
ompi_predefined_datatype_t ompi_mpi_c_double_complex = OMPI_DATATYPE_INIT_PREDEFINED (C_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
#if HAVE_LONG_DOUBLE
|
||||
ompi_predefined_datatype_t ompi_mpi_cxx_ldblcplex = OMPI_DATATYPE_INIT_DEFER (LONG_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_CPP | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
ompi_predefined_datatype_t ompi_mpi_c_long_double_complex = OMPI_DATATYPE_INIT_PREDEFINED (C_LONG_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
#else
|
||||
ompi_predefined_datatype_t ompi_mpi_cxx_ldblcplex = OMPI_DATATYPE_INIT_UNAVAILABLE (LONG_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_CPP | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
ompi_predefined_datatype_t ompi_mpi_c_long_double_complex = OMPI_DATATYPE_INIT_UNAVAILABLE (C_LONG_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
#endif /* HAVE_LONG_DOUBLE */
|
||||
|
||||
/* The C++ complex datatypes are the same as the C datatypes */
|
||||
ompi_predefined_datatype_t ompi_mpi_cxx_cplex = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE (C_FLOAT_COMPLEX, C_FLOAT_COMPLEX, OMPI_DATATYPE_FLAG_DATA_CPP | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
ompi_predefined_datatype_t ompi_mpi_cxx_dblcplex = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE (C_DOUBLE_COMPLEX, C_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_CPP | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
ompi_predefined_datatype_t ompi_mpi_cxx_ldblcplex = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE (C_LONG_DOUBLE_COMPLEX, C_LONG_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_CPP | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX
|
||||
ompi_predefined_datatype_t ompi_mpi_cplex = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE (OMPI_KIND_FORTRAN_COMPLEX, COMPLEX, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
#else
|
||||
ompi_predefined_datatype_t ompi_mpi_cplex = OMPI_DATATYPE_INIT_UNAVAILABLE (COMPLEX, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
#endif
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX
|
||||
ompi_predefined_datatype_t ompi_mpi_dblcplex = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE (OMPI_KIND_FORTRAN_DOUBLE_COMPLEX, 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_FORTRAN_DOUBLE_COMPLEX
|
||||
ompi_predefined_datatype_t ompi_mpi_ldblcplex = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE (C_LONG_DOUBLE_COMPLEX, 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 );
|
||||
#endif
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX8
|
||||
ompi_predefined_datatype_t ompi_mpi_complex8 = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE (OMPI_KIND_FORTRAN_COMPLEX8, COMPLEX8, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
#else
|
||||
ompi_predefined_datatype_t ompi_mpi_complex8 = OMPI_DATATYPE_INIT_UNAVAILABLE (COMPLEX8, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX);
|
||||
#endif
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX16
|
||||
ompi_predefined_datatype_t ompi_mpi_complex16 = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE (OMPI_KIND_FORTRAN_COMPLEX16, COMPLEX16, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
#else
|
||||
ompi_predefined_datatype_t ompi_mpi_complex16 = OMPI_DATATYPE_INIT_UNAVAILABLE (COMPLEX16, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX);
|
||||
#endif
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX32
|
||||
ompi_predefined_datatype_t ompi_mpi_complex32 = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE (OMPI_KIND_FORTRAN_COMPLEX32, COMPLEX32, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
#else
|
||||
ompi_predefined_datatype_t ompi_mpi_complex32 = OMPI_DATATYPE_INIT_UNAVAILABLE (COMPLEX32, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Fortran datatypes
|
||||
*/
|
||||
@ -118,19 +168,7 @@ ompi_predefined_datatype_t ompi_mpi_character = OMPI_DATATYPE_INIT_PREDEFIN
|
||||
ompi_predefined_datatype_t ompi_mpi_integer = OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_FORTRAN (INT, INTEGER, OMPI_SIZEOF_FORTRAN_INTEGER, OMPI_ALIGNMENT_FORTRAN_INTEGER, OMPI_DATATYPE_FLAG_DATA_INT );
|
||||
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_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_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 );
|
||||
#endif
|
||||
|
||||
/* Aggregate struct datatypes are not const */
|
||||
ompi_predefined_datatype_t ompi_mpi_float_int = OMPI_DATATYPE_INIT_DEFER (FLOAT_INT, OMPI_DATATYPE_FLAG_DATA_C );
|
||||
@ -220,22 +258,6 @@ ompi_predefined_datatype_t ompi_mpi_integer16 = OMPI_DATATYPE_INIT_PREDEFIN
|
||||
ompi_predefined_datatype_t ompi_mpi_integer16 = OMPI_DATATYPE_INIT_UNAVAILABLE (INTEGER8, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_INT);
|
||||
#endif
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX8
|
||||
ompi_predefined_datatype_t ompi_mpi_complex8 = OMPI_DATATYPE_INIT_DEFER (COMPLEX8, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX);
|
||||
#else
|
||||
ompi_predefined_datatype_t ompi_mpi_complex8 = OMPI_DATATYPE_INIT_UNAVAILABLE (COMPLEX8, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX);
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX16
|
||||
ompi_predefined_datatype_t ompi_mpi_complex16 = OMPI_DATATYPE_INIT_DEFER (COMPLEX16, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX);
|
||||
#else
|
||||
ompi_predefined_datatype_t ompi_mpi_complex16 = OMPI_DATATYPE_INIT_UNAVAILABLE (COMPLEX16, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX);
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX32
|
||||
ompi_predefined_datatype_t ompi_mpi_complex32 = OMPI_DATATYPE_INIT_DEFER (COMPLEX32, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX);
|
||||
#else
|
||||
ompi_predefined_datatype_t ompi_mpi_complex32 = OMPI_DATATYPE_INIT_UNAVAILABLE (COMPLEX32, OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_COMPLEX);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* MPI 2.2 Datatypes
|
||||
*/
|
||||
@ -264,16 +286,6 @@ ompi_predefined_datatype_t ompi_mpi_offset = OMPI_DATATYPE_INIT_PREDEFINED_BASIC
|
||||
ompi_predefined_datatype_t ompi_mpi_offset = OMPI_DATATYPE_INIT_UNAVAILABLE_BASIC_TYPE(UINT64_T, OFFSET, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_INT);
|
||||
#endif /* OMPI_MPI_OFFSET_SIZE == SIZEOF_INT */
|
||||
|
||||
ompi_predefined_datatype_t ompi_mpi_c_bool = OMPI_DATATYPE_INIT_PREDEFINED (BOOL, OMPI_DATATYPE_FLAG_DATA_C);
|
||||
ompi_predefined_datatype_t ompi_mpi_c_complex = OMPI_DATATYPE_INIT_DEFER (COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
ompi_predefined_datatype_t ompi_mpi_c_float_complex = OMPI_DATATYPE_INIT_DEFER (COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
ompi_predefined_datatype_t ompi_mpi_c_double_complex = OMPI_DATATYPE_INIT_DEFER (DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
#if HAVE_LONG_DOUBLE
|
||||
ompi_predefined_datatype_t ompi_mpi_c_long_double_complex = OMPI_DATATYPE_INIT_DEFER (LONG_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
#else
|
||||
ompi_predefined_datatype_t ompi_mpi_c_long_double_complex = OMPI_DATATYPE_INIT_UNAVAILABLE (LONG_DOUBLE_COMPLEX, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX );
|
||||
#endif /* HAVE_LONG_DOUBLE */
|
||||
|
||||
/*
|
||||
* MPI 3.0 Datatypes
|
||||
*/
|
||||
@ -292,66 +304,66 @@ ompi_predefined_datatype_t ompi_mpi_count = OMPI_DATATYPE_INIT_UNAVAILABLE_BASIC
|
||||
* Everything referring to types/ids should be ORDERED as in ompi_datatype_basicDatatypes array.
|
||||
*/
|
||||
const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX_PREDEFINED] = {
|
||||
&ompi_mpi_datatype_null.dt, /* 0x00 */
|
||||
&ompi_mpi_int8_t.dt, /* 0x01 */
|
||||
&ompi_mpi_uint8_t.dt, /* 0x02 */
|
||||
&ompi_mpi_int16_t.dt, /* 0x03 */
|
||||
&ompi_mpi_uint16_t.dt, /* 0x04 */
|
||||
&ompi_mpi_int32_t.dt, /* 0x05 */
|
||||
&ompi_mpi_uint32_t.dt, /* 0x06 */
|
||||
&ompi_mpi_int64_t.dt, /* 0x07 */
|
||||
&ompi_mpi_uint64_t.dt, /* 0x08 */
|
||||
&ompi_mpi_float.dt, /* 0x09 */
|
||||
&ompi_mpi_double.dt, /* 0x0A */
|
||||
&ompi_mpi_long_double.dt, /* 0x0B */
|
||||
&ompi_mpi_complex8.dt, /* 0x0C */
|
||||
&ompi_mpi_complex16.dt, /* 0x0D */
|
||||
&ompi_mpi_complex32.dt, /* 0x0E */
|
||||
&ompi_mpi_wchar.dt, /* 0x0F */
|
||||
&ompi_mpi_packed.dt, /* 0x10 */
|
||||
[OMPI_DATATYPE_MPI_EMPTY] = &ompi_mpi_datatype_null.dt,
|
||||
[OMPI_DATATYPE_MPI_INT8_T] = &ompi_mpi_int8_t.dt,
|
||||
[OMPI_DATATYPE_MPI_UINT8_T] = &ompi_mpi_uint8_t.dt,
|
||||
[OMPI_DATATYPE_MPI_INT16_T] = &ompi_mpi_int16_t.dt,
|
||||
[OMPI_DATATYPE_MPI_UINT16_T] = &ompi_mpi_uint16_t.dt,
|
||||
[OMPI_DATATYPE_MPI_INT32_T] = &ompi_mpi_int32_t.dt,
|
||||
[OMPI_DATATYPE_MPI_UINT32_T] = &ompi_mpi_uint32_t.dt,
|
||||
[OMPI_DATATYPE_MPI_INT64_T] = &ompi_mpi_int64_t.dt,
|
||||
[OMPI_DATATYPE_MPI_UINT64_T] = &ompi_mpi_uint64_t.dt,
|
||||
[OMPI_DATATYPE_MPI_FLOAT] = &ompi_mpi_float.dt,
|
||||
[OMPI_DATATYPE_MPI_DOUBLE] = &ompi_mpi_double.dt,
|
||||
[OMPI_DATATYPE_MPI_LONG_DOUBLE] = &ompi_mpi_long_double.dt,
|
||||
[OMPI_DATATYPE_MPI_COMPLEX8] = &ompi_mpi_complex8.dt,
|
||||
[OMPI_DATATYPE_MPI_COMPLEX16] = &ompi_mpi_complex16.dt,
|
||||
[OMPI_DATATYPE_MPI_COMPLEX32] = &ompi_mpi_complex32.dt,
|
||||
[OMPI_DATATYPE_MPI_WCHAR] = &ompi_mpi_wchar.dt,
|
||||
[OMPI_DATATYPE_MPI_PACKED] = &ompi_mpi_packed.dt,
|
||||
|
||||
/* C++ / C99 datatypes */
|
||||
&ompi_mpi_cxx_bool.dt, /* 0x11 */
|
||||
[OMPI_DATATYPE_MPI_BOOL] = &ompi_mpi_cxx_bool.dt,
|
||||
|
||||
/* Fortran datatypes */
|
||||
&ompi_mpi_logical.dt, /* 0x12 */
|
||||
&ompi_mpi_character.dt, /* 0x13 */
|
||||
&ompi_mpi_integer.dt, /* 0x14 */
|
||||
&ompi_mpi_real.dt, /* 0x15 */
|
||||
&ompi_mpi_dblprec.dt, /* 0x16 */
|
||||
[OMPI_DATATYPE_MPI_LOGICAL] = &ompi_mpi_logical.dt,
|
||||
[OMPI_DATATYPE_MPI_CHARACTER] = &ompi_mpi_character.dt,
|
||||
[OMPI_DATATYPE_MPI_INTEGER] = &ompi_mpi_integer.dt,
|
||||
[OMPI_DATATYPE_MPI_REAL] = &ompi_mpi_real.dt,
|
||||
[OMPI_DATATYPE_MPI_DOUBLE_PRECISION] = &ompi_mpi_dblprec.dt,
|
||||
|
||||
&ompi_mpi_cplex.dt, /* 0x17 */
|
||||
&ompi_mpi_dblcplex.dt, /* 0x18 */
|
||||
&ompi_mpi_ldblcplex.dt, /* 0x19 */
|
||||
&ompi_mpi_2int.dt, /* 0x1A */
|
||||
&ompi_mpi_2integer.dt, /* 0x1B */
|
||||
&ompi_mpi_2real.dt, /* 0x1C */
|
||||
&ompi_mpi_2dblprec.dt, /* 0x1D */
|
||||
&ompi_mpi_2cplex.dt, /* 0x1E */
|
||||
&ompi_mpi_2dblcplex.dt, /* 0x1F */
|
||||
[OMPI_DATATYPE_MPI_COMPLEX] = &ompi_mpi_cplex.dt,
|
||||
[OMPI_DATATYPE_MPI_DOUBLE_COMPLEX] = &ompi_mpi_dblcplex.dt,
|
||||
[OMPI_DATATYPE_MPI_LONG_DOUBLE_COMPLEX] = &ompi_mpi_ldblcplex.dt,
|
||||
[OMPI_DATATYPE_MPI_2INT] = &ompi_mpi_2int.dt,
|
||||
[OMPI_DATATYPE_MPI_2INTEGER] = &ompi_mpi_2integer.dt,
|
||||
[OMPI_DATATYPE_MPI_2REAL] = &ompi_mpi_2real.dt,
|
||||
[OMPI_DATATYPE_MPI_2DBLPREC] = &ompi_mpi_2dblprec.dt,
|
||||
[OMPI_DATATYPE_MPI_2COMPLEX] = &ompi_mpi_2cplex.dt,
|
||||
[OMPI_DATATYPE_MPI_2DOUBLE_COMPLEX] = &ompi_mpi_2dblcplex.dt,
|
||||
|
||||
&ompi_mpi_float_int.dt, /* 0x20 */
|
||||
&ompi_mpi_double_int.dt, /* 0x21 */
|
||||
&ompi_mpi_longdbl_int.dt, /* 0x22 */
|
||||
&ompi_mpi_long_int.dt, /* 0x23 */
|
||||
&ompi_mpi_short_int.dt, /* 0x24 */
|
||||
[OMPI_DATATYPE_MPI_FLOAT_INT] = &ompi_mpi_float_int.dt,
|
||||
[OMPI_DATATYPE_MPI_DOUBLE_INT] = &ompi_mpi_double_int.dt,
|
||||
[OMPI_DATATYPE_MPI_LONG_DOUBLE_INT] = &ompi_mpi_longdbl_int.dt,
|
||||
[OMPI_DATATYPE_MPI_LONG_INT] = &ompi_mpi_long_int.dt,
|
||||
[OMPI_DATATYPE_MPI_SHORT_INT] = &ompi_mpi_short_int.dt,
|
||||
|
||||
/* MPI 2.2 types */
|
||||
&ompi_mpi_aint.dt, /* 0x25 */
|
||||
&ompi_mpi_offset.dt, /* 0x26 */
|
||||
&ompi_mpi_c_bool.dt, /* 0x27 */
|
||||
&ompi_mpi_c_complex.dt, /* 0x28 */
|
||||
&ompi_mpi_c_float_complex.dt, /* 0x29 */
|
||||
&ompi_mpi_c_double_complex.dt, /* 0x2A */
|
||||
&ompi_mpi_c_long_double_complex.dt, /* 0x2B */
|
||||
[OMPI_DATATYPE_MPI_AINT] = &ompi_mpi_aint.dt,
|
||||
[OMPI_DATATYPE_MPI_OFFSET] = &ompi_mpi_offset.dt,
|
||||
[OMPI_DATATYPE_MPI_C_BOOL] = &ompi_mpi_c_bool.dt,
|
||||
[OMPI_DATATYPE_MPI_C_COMPLEX] = &ompi_mpi_c_complex.dt,
|
||||
[OMPI_DATATYPE_MPI_C_FLOAT_COMPLEX] = &ompi_mpi_c_float_complex.dt,
|
||||
[OMPI_DATATYPE_MPI_C_DOUBLE_COMPLEX] = &ompi_mpi_c_double_complex.dt,
|
||||
[OMPI_DATATYPE_MPI_C_LONG_DOUBLE_COMPLEX] = &ompi_mpi_c_long_double_complex.dt,
|
||||
|
||||
&ompi_mpi_lb.dt, /* 0x2C */
|
||||
&ompi_mpi_ub.dt, /* 0x2D */
|
||||
[OMPI_DATATYPE_MPI_LB] = &ompi_mpi_lb.dt,
|
||||
[OMPI_DATATYPE_MPI_UB] = &ompi_mpi_ub.dt,
|
||||
|
||||
/* MPI 3.0 types */
|
||||
&ompi_mpi_count.dt, /* 0x2E */
|
||||
[OMPI_DATATYPE_MPI_COUNT] = &ompi_mpi_count.dt,
|
||||
|
||||
&ompi_mpi_unavailable.dt, /* 0x2F */
|
||||
[OMPI_DATATYPE_MPI_UNAVAILABLE] = &ompi_mpi_unavailable.dt,
|
||||
};
|
||||
|
||||
opal_pointer_array_t ompi_datatype_f_to_c_table;
|
||||
@ -452,33 +464,6 @@ int32_t ompi_datatype_init( void )
|
||||
* in mpif.h
|
||||
*/
|
||||
|
||||
/* the complex datatypes (float, double and long double) */
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( &ompi_mpi_cplex.dt, OMPI_DATATYPE_COMPLEX, "MPI_COMPLEX",
|
||||
float, float, OMPI_DATATYPE_MPI_FLOAT, OMPI_DATATYPE_MPI_FLOAT,
|
||||
OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_FLOAT );
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX8
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( &ompi_mpi_complex8.dt, OMPI_DATATYPE_COMPLEX8, "MPI_COMPLEX8",
|
||||
float, float, OMPI_DATATYPE_MPI_FLOAT, OMPI_DATATYPE_MPI_FLOAT,
|
||||
OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_FLOAT );
|
||||
#endif /* OMPI_HAVE_FORTRAN_COMPLEX8 */
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX16
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( &ompi_mpi_complex16.dt, OMPI_DATATYPE_COMPLEX16, "MPI_COMPLEX16",
|
||||
double, double, OMPI_DATATYPE_MPI_DOUBLE, OMPI_DATATYPE_MPI_DOUBLE,
|
||||
OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_FLOAT );
|
||||
#endif /* OMPI_HAVE_FORTRAN_COMPLEX16 */
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX32 && HAVE_LONG_DOUBLE
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( &ompi_mpi_complex32.dt, OMPI_DATATYPE_COMPLEX32, "MPI_COMPLEX32",
|
||||
long double, long double, OMPI_DATATYPE_MPI_LONG_DOUBLE, OMPI_DATATYPE_MPI_LONG_DOUBLE,
|
||||
OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_FLOAT );
|
||||
#endif /* OMPI_HAVE_FORTRAN_COMPLEX32 && HAVE_LONG_DOUBLE */
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( &ompi_mpi_dblcplex.dt, OMPI_DATATYPE_DOUBLE_COMPLEX, "MPI_DOUBLE_COMPLEX",
|
||||
double, double, OMPI_DATATYPE_MPI_DOUBLE, OMPI_DATATYPE_MPI_DOUBLE,
|
||||
OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_FLOAT );
|
||||
#if HAVE_LONG_DOUBLE
|
||||
DECLARE_MPI2_COMPOSED_STRUCT_DDT( &ompi_mpi_ldblcplex.dt, OMPI_DATATYPE_LONG_DOUBLE_COMPLEX, "MPI_LONG_DOUBLE_COMPLEX",
|
||||
long double, long double, OMPI_DATATYPE_MPI_LONG_DOUBLE, OMPI_DATATYPE_MPI_LONG_DOUBLE,
|
||||
OMPI_DATATYPE_FLAG_DATA_FORTRAN | OMPI_DATATYPE_FLAG_DATA_FLOAT );
|
||||
#endif /* HAVE_LONG_DOUBLE */
|
||||
|
||||
/* Now the predefined MPI2 datatypes (they should last forever!) */
|
||||
DECLARE_MPI2_COMPOSED_BLOCK_DDT( &ompi_mpi_2int.dt, OMPI_DATATYPE_2INT, "MPI_2INT",
|
||||
@ -525,27 +510,6 @@ int32_t ompi_datatype_init( void )
|
||||
/* Copy the desc pointer from the <OMPI_DATATYPE_MPI_MAX_PREDEFINED datatypes to
|
||||
the synonym types */
|
||||
|
||||
/* C++ complex types */
|
||||
DECLARE_MPI_SYNONYM_DDT( &ompi_mpi_cxx_cplex.dt, "MPI_CXX_COMPLEX", &ompi_mpi_cplex.dt );
|
||||
ompi_mpi_cxx_cplex.dt.super.flags |= OMPI_DATATYPE_FLAG_DATA_CPP | OMPI_DATATYPE_FLAG_DATA_COMPLEX;
|
||||
DECLARE_MPI_SYNONYM_DDT( &ompi_mpi_cxx_dblcplex.dt, "MPI_CXX_DOUBLE_COMPLEX", &ompi_mpi_dblcplex.dt );
|
||||
ompi_mpi_cxx_dblcplex.dt.super.flags |= OMPI_DATATYPE_FLAG_DATA_CPP | OMPI_DATATYPE_FLAG_DATA_COMPLEX;
|
||||
|
||||
/* C99 complex types */
|
||||
DECLARE_MPI_SYNONYM_DDT( &ompi_mpi_c_complex.dt, "MPI_C_COMPLEX", &ompi_mpi_cplex.dt );
|
||||
ompi_mpi_c_complex.dt.super.flags |= OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX;
|
||||
DECLARE_MPI_SYNONYM_DDT( &ompi_mpi_c_float_complex.dt, "MPI_C_FLOAT_COMPLEX", &ompi_mpi_cplex.dt );
|
||||
ompi_mpi_c_float_complex.dt.super.flags |= OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX;
|
||||
DECLARE_MPI_SYNONYM_DDT( &ompi_mpi_c_double_complex.dt, "MPI_C_DOUBLE_COMPLEX", &ompi_mpi_dblcplex.dt );
|
||||
ompi_mpi_c_double_complex.dt.super.flags |= OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX;
|
||||
|
||||
#if HAVE_LONG_DOUBLE
|
||||
DECLARE_MPI_SYNONYM_DDT( &ompi_mpi_cxx_ldblcplex.dt, "MPI_CXX_LONG_DOUBLE_COMPLEX", &ompi_mpi_ldblcplex.dt );
|
||||
ompi_mpi_cxx_ldblcplex.dt.super.flags |= OMPI_DATATYPE_FLAG_DATA_CPP | OMPI_DATATYPE_FLAG_DATA_COMPLEX;
|
||||
DECLARE_MPI_SYNONYM_DDT( &ompi_mpi_c_long_double_complex.dt, "MPI_C_LONG_DOUBLE_COMPLEX", &ompi_mpi_ldblcplex.dt );
|
||||
ompi_mpi_c_long_double_complex.dt.super.flags |= OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_COMPLEX;
|
||||
#endif /* HAVE_LONG_DOUBLE */
|
||||
|
||||
|
||||
/* Start to populate the f2c index translation table */
|
||||
|
||||
@ -648,9 +612,13 @@ int32_t ompi_datatype_init( void )
|
||||
MOOG(uint64_t, 65);
|
||||
MOOG(aint, 66);
|
||||
MOOG(offset, 67);
|
||||
MOOG(c_complex, 68);
|
||||
MOOG(c_float_complex, 69);
|
||||
MOOG(c_double_complex, 70);
|
||||
MOOG(c_long_double_complex, 71);
|
||||
|
||||
/* MPI 3.0 types */
|
||||
MOOG(count, 68);
|
||||
MOOG(count, 72);
|
||||
|
||||
/**
|
||||
* Now make sure all non-contiguous types are marked as such.
|
||||
|
@ -182,7 +182,11 @@ $handles->{MPI_INT64_T} = 64;
|
||||
$handles->{MPI_UINT64_T} = 65;
|
||||
$handles->{MPI_AINT} = 66;
|
||||
$handles->{MPI_OFFSET} = 67;
|
||||
$handles->{MPI_COUNT} = 68;
|
||||
$handles->{MPI_C_COMPLEX} = 68;
|
||||
$handles->{MPI_C_FLOAT_COMPLEX} = 69;
|
||||
$handles->{MPI_C_DOUBLE_COMPLEX} = 70;
|
||||
$handles->{MPI_C_LONG_DOUBLE_COMPLEX} = 71;
|
||||
$handles->{MPI_COUNT} = 72;
|
||||
|
||||
$handles->{MPI_MESSAGE_NO_PROC} = 1;
|
||||
|
||||
|
@ -38,47 +38,6 @@
|
||||
/* MPI_Fint is the same as ompi_fortran_INTEGER_t */
|
||||
#define MPI_Fint ompi_fortran_integer_t
|
||||
|
||||
#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 && OMPI_HAVE_FORTRAN_COMPLEX8
|
||||
/* * C type for Fortran COMPLEX*8 */
|
||||
typedef struct {
|
||||
ompi_fortran_real4_t real;
|
||||
ompi_fortran_real4_t imag;
|
||||
} ompi_fortran_complex8_t;
|
||||
#endif
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_REAL8 && OMPI_HAVE_FORTRAN_COMPLEX16
|
||||
/* * C type for Fortran COMPLEX*16 */
|
||||
typedef struct {
|
||||
ompi_fortran_real8_t real;
|
||||
ompi_fortran_real8_t imag;
|
||||
} ompi_fortran_complex16_t;
|
||||
#endif
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_REAL16 && OMPI_HAVE_FORTRAN_COMPLEX32
|
||||
/* * C type for Fortran COMPLEX*32 */
|
||||
typedef struct {
|
||||
ompi_fortran_real16_t real;
|
||||
ompi_fortran_real16_t imag;
|
||||
} ompi_fortran_complex32_t;
|
||||
#endif
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION
|
||||
/* * C type for Fortran DOUBLE COMPLEX */
|
||||
typedef struct {
|
||||
ompi_fortran_double_precision_t real;
|
||||
ompi_fortran_double_precision_t imag;
|
||||
} ompi_fortran_double_complex_t;
|
||||
#endif
|
||||
|
||||
|
||||
# if OPAL_C_HAVE_VISIBILITY
|
||||
# ifndef OMPI_DECLSPEC
|
||||
# define OMPI_DECLSPEC __opal_attribute_visibility__("default")
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
@ -25,536 +26,9 @@
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/mca/op/op.h"
|
||||
|
||||
/*
|
||||
* Since we have so many of these, and they're all identical except
|
||||
* for the name, use macros to prototype them.
|
||||
*/
|
||||
#define OMPI_OP_PROTO (void *in, void *out, int *count, struct ompi_datatype_t **dtype, struct ompi_op_base_module_1_0_0_t *module)
|
||||
|
||||
/* C integer */
|
||||
#define OMPI_OP_HANDLER_C_INTEGER_INTRINSIC(name) \
|
||||
void ompi_op_base_##name##_int8_t OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_uint8_t OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_int16_t OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_uint16_t OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_int32_t OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_uint32_t OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_int64_t OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_uint64_t OMPI_OP_PROTO;
|
||||
#define OMPI_OP_HANDLER_C_INTEGER(name) \
|
||||
OMPI_OP_HANDLER_C_INTEGER_INTRINSIC(name)
|
||||
|
||||
/* Fortran integer */
|
||||
|
||||
#define OMPI_OP_HANDLER_FORTRAN_INTEGER_INTRINSIC(name) \
|
||||
void ompi_op_base_##name##_fortran_integer OMPI_OP_PROTO;
|
||||
#if OMPI_HAVE_FORTRAN_INTEGER1
|
||||
#define OMPI_OP_HANDLER_FORTRAN_INTEGER1(name) \
|
||||
void ompi_op_base_##name##_fortran_integer1 OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_FORTRAN_INTEGER1(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_INTEGER2
|
||||
#define OMPI_OP_HANDLER_FORTRAN_INTEGER2(name) \
|
||||
void ompi_op_base_##name##_fortran_integer2 OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_FORTRAN_INTEGER2(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_INTEGER4
|
||||
#define OMPI_OP_HANDLER_FORTRAN_INTEGER4(name) \
|
||||
void ompi_op_base_##name##_fortran_integer4 OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_FORTRAN_INTEGER4(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_INTEGER8
|
||||
#define OMPI_OP_HANDLER_FORTRAN_INTEGER8(name) \
|
||||
void ompi_op_base_##name##_fortran_integer8 OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_FORTRAN_INTEGER8(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_INTEGER16
|
||||
#define OMPI_OP_HANDLER_FORTRAN_INTEGER16(name) \
|
||||
void ompi_op_base_##name##_fortran_integer16 OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_FORTRAN_INTEGER16(name)
|
||||
#endif
|
||||
#define OMPI_OP_HANDLER_FORTRAN_INTEGER(name) \
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER_INTRINSIC(name) \
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER1(name) \
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER2(name) \
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER4(name) \
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER8(name) \
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER16(name)
|
||||
|
||||
/* Floating point */
|
||||
|
||||
#define OMPI_OP_HANDLER_FLOATING_POINT_INTRINSIC(name) \
|
||||
void ompi_op_base_##name##_float OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_double OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_fortran_real OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_fortran_double_precision OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_long_double OMPI_OP_PROTO;
|
||||
#if OMPI_HAVE_FORTRAN_REAL2
|
||||
#define OMPI_OP_HANDLER_FLOATING_POINT_REAL2(name) \
|
||||
void ompi_op_base_##name##_fortran_real2 OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_FLOATING_POINT_REAL2(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_REAL4
|
||||
#define OMPI_OP_HANDLER_FLOATING_POINT_REAL4(name) \
|
||||
void ompi_op_base_##name##_fortran_real4 OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_FLOATING_POINT_REAL4(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_REAL8
|
||||
#define OMPI_OP_HANDLER_FLOATING_POINT_REAL8(name) \
|
||||
void ompi_op_base_##name##_fortran_real8 OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_FLOATING_POINT_REAL8(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_REAL16
|
||||
#define OMPI_OP_HANDLER_FLOATING_POINT_REAL16(name) \
|
||||
void ompi_op_base_##name##_fortran_real16 OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_FLOATING_POINT_REAL16(name)
|
||||
#endif
|
||||
#define OMPI_OP_HANDLER_FLOATING_POINT(name) \
|
||||
OMPI_OP_HANDLER_FLOATING_POINT_INTRINSIC(name) \
|
||||
OMPI_OP_HANDLER_FLOATING_POINT_REAL4(name) \
|
||||
OMPI_OP_HANDLER_FLOATING_POINT_REAL8(name) \
|
||||
OMPI_OP_HANDLER_FLOATING_POINT_REAL16(name) \
|
||||
|
||||
/* Logical */
|
||||
|
||||
#define OMPI_OP_HANDLER_LOGICAL(name) \
|
||||
void ompi_op_base_##name##_fortran_logical OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_bool OMPI_OP_PROTO;
|
||||
|
||||
/* Complex */
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_REAL
|
||||
#define OMPI_OP_HANDLER_COMPLEX_INTRINSIC(name) \
|
||||
void ompi_op_base_##name##_fortran_complex OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_COMPLEX_INTRINSIC(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION
|
||||
#define OMPI_OP_HANDLER_DOUBLE_COMPLEX_INTRINSIC(name) \
|
||||
void ompi_op_base_##name##_fortran_double_complex OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_DOUBLE_COMPLEX_INTRINSIC(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_REAL4
|
||||
#define OMPI_OP_HANDLER_COMPLEX8(name) \
|
||||
void ompi_op_base_##name##_fortran_complex8 OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_COMPLEX8(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_REAL8
|
||||
#define OMPI_OP_HANDLER_COMPLEX16(name) \
|
||||
void ompi_op_base_##name##_fortran_complex16 OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_COMPLEX16(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_REAL16
|
||||
#define OMPI_OP_HANDLER_COMPLEX32(name) \
|
||||
void ompi_op_base_##name##_fortran_complex32 OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_COMPLEX32(name)
|
||||
#endif
|
||||
#if HAVE_FLOAT__COMPLEX
|
||||
#define OMPI_OP_HANDLER_FLOAT__COMPLEX(name) \
|
||||
void ompi_op_base_##name##_c_float__complex OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_FLOAT__COMPLEX(name)
|
||||
#endif
|
||||
#if HAVE_DOUBLE__COMPLEX
|
||||
#define OMPI_OP_HANDLER_DOUBLE__COMPLEX(name) \
|
||||
void ompi_op_base_##name##_c_double__complex OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_DOUBLE__COMPLEX(name)
|
||||
#endif
|
||||
#if HAVE_LONG_DOUBLE__COMPLEX
|
||||
#define OMPI_OP_HANDLER_LONG_DOUBLE__COMPLEX(name) \
|
||||
void ompi_op_base_##name##_c_long_double__complex OMPI_OP_PROTO;
|
||||
#else
|
||||
#define OMPI_OP_HANDLER_LONG_DOUBLE__COMPLEX(name)
|
||||
#endif
|
||||
|
||||
#define OMPI_OP_HANDLER_COMPLEX(name) \
|
||||
OMPI_OP_HANDLER_COMPLEX_INTRINSIC(name) \
|
||||
OMPI_OP_HANDLER_DOUBLE_COMPLEX_INTRINSIC(name) \
|
||||
OMPI_OP_HANDLER_COMPLEX8(name) \
|
||||
OMPI_OP_HANDLER_COMPLEX16(name) \
|
||||
OMPI_OP_HANDLER_COMPLEX32(name) \
|
||||
OMPI_OP_HANDLER_FLOAT__COMPLEX(name) \
|
||||
OMPI_OP_HANDLER_DOUBLE__COMPLEX(name) \
|
||||
OMPI_OP_HANDLER_LONG_DOUBLE__COMPLEX(name)
|
||||
|
||||
/* Byte */
|
||||
|
||||
#define OMPI_OP_HANDLER_BYTE(name) \
|
||||
void ompi_op_base_##name##_byte OMPI_OP_PROTO;
|
||||
|
||||
/* "2 type" */
|
||||
|
||||
#define OMPI_OP_HANDLER_2TYPE(name) \
|
||||
void ompi_op_base_##name##_2real OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_2double_precision OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_2integer OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_float_int OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_double_int OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_long_int OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_2int OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_short_int OMPI_OP_PROTO; \
|
||||
void ompi_op_base_##name##_long_double_int OMPI_OP_PROTO;
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_MAX
|
||||
*/
|
||||
OMPI_OP_HANDLER_C_INTEGER(max)
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER(max)
|
||||
OMPI_OP_HANDLER_FLOATING_POINT(max)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_MIN
|
||||
*/
|
||||
OMPI_OP_HANDLER_C_INTEGER(min)
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER(min)
|
||||
OMPI_OP_HANDLER_FLOATING_POINT(min)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_SUM
|
||||
*/
|
||||
OMPI_OP_HANDLER_C_INTEGER(sum)
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER(sum)
|
||||
OMPI_OP_HANDLER_FLOATING_POINT(sum)
|
||||
OMPI_OP_HANDLER_COMPLEX(sum)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_PROD
|
||||
*/
|
||||
OMPI_OP_HANDLER_C_INTEGER(prod)
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER(prod)
|
||||
OMPI_OP_HANDLER_FLOATING_POINT(prod)
|
||||
OMPI_OP_HANDLER_COMPLEX(prod)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_LAND
|
||||
*/
|
||||
OMPI_OP_HANDLER_C_INTEGER(land)
|
||||
OMPI_OP_HANDLER_LOGICAL(land)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_BAND
|
||||
*/
|
||||
OMPI_OP_HANDLER_C_INTEGER(band)
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER(band)
|
||||
OMPI_OP_HANDLER_BYTE(band)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_LOR
|
||||
*/
|
||||
OMPI_OP_HANDLER_C_INTEGER(lor)
|
||||
OMPI_OP_HANDLER_LOGICAL(lor)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_BOR
|
||||
*/
|
||||
OMPI_OP_HANDLER_C_INTEGER(bor)
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER(bor)
|
||||
OMPI_OP_HANDLER_BYTE(bor)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_LXOR
|
||||
*/
|
||||
OMPI_OP_HANDLER_C_INTEGER(lxor)
|
||||
OMPI_OP_HANDLER_LOGICAL(lxor)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_BXOR
|
||||
*/
|
||||
OMPI_OP_HANDLER_C_INTEGER(bxor)
|
||||
OMPI_OP_HANDLER_FORTRAN_INTEGER(bxor)
|
||||
OMPI_OP_HANDLER_BYTE(bxor)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_MAXLOC
|
||||
*/
|
||||
OMPI_OP_HANDLER_2TYPE(maxloc)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_MINLOC
|
||||
*/
|
||||
OMPI_OP_HANDLER_2TYPE(minloc)
|
||||
|
||||
/*
|
||||
* 3 buffer prototypes (two input and one output)
|
||||
*/
|
||||
#define OMPI_OP_PROTO_3BUF \
|
||||
( void * restrict in1, void * restrict in2, void * restrict out, \
|
||||
int *count, struct ompi_datatype_t **dtype, \
|
||||
struct ompi_op_base_module_1_0_0_t *module)
|
||||
|
||||
/* C integer */
|
||||
|
||||
#define OMPI_OP_3BUFF_HANDLER_C_INTEGER_INTRINSIC(name) \
|
||||
void ompi_op_base_3buff_##name##_int8_t OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_uint8_t OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_int16_t OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_uint16_t OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_int32_t OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_uint32_t OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_int64_t OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_uint64_t OMPI_OP_PROTO_3BUF;
|
||||
#define OMPI_OP_3BUFF_HANDLER_C_INTEGER(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_C_INTEGER_INTRINSIC(name)
|
||||
|
||||
/* Fortran integer */
|
||||
|
||||
#define OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER_INTRINSIC(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_integer OMPI_OP_PROTO_3BUF;
|
||||
#if OMPI_HAVE_FORTRAN_INTEGER1
|
||||
#define OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER1(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_integer1 OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER1(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_INTEGER2
|
||||
#define OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER2(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_integer2 OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER2(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_INTEGER4
|
||||
#define OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER4(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_integer4 OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER4(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_INTEGER8
|
||||
#define OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER8(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_integer8 OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER8(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_INTEGER16
|
||||
#define OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER16(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_integer16 OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER16(name)
|
||||
#endif
|
||||
#define OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER_INTRINSIC(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER1(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER2(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER4(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER8(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER16(name)
|
||||
|
||||
/* Floating point */
|
||||
|
||||
#define OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_INTRINSIC(name) \
|
||||
void ompi_op_base_3buff_##name##_float OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_double OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_fortran_real OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_fortran_double_precision OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_long_double OMPI_OP_PROTO_3BUF;
|
||||
#if OMPI_HAVE_FORTRAN_REAL2
|
||||
#define OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_REAL2(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_real2 OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_REAL2(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_REAL4
|
||||
#define OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_REAL4(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_real4 OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_REAL4(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_REAL8
|
||||
#define OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_REAL8(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_real8 OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_REAL8(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_REAL16
|
||||
#define OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_REAL16(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_real16 OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_REAL16(name)
|
||||
#endif
|
||||
#define OMPI_OP_3BUFF_HANDLER_FLOATING_POINT(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_INTRINSIC(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_REAL4(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_REAL8(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_FLOATING_POINT_REAL16(name) \
|
||||
|
||||
/* Logical */
|
||||
|
||||
#define OMPI_OP_3BUFF_HANDLER_LOGICAL(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_logical OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_bool OMPI_OP_PROTO_3BUF;
|
||||
|
||||
/* Complex */
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_REAL
|
||||
#define OMPI_OP_3BUFF_HANDLER_COMPLEX_INTRINSIC(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_complex OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_COMPLEX_INTRINSIC(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_DOUBLE_PRECISION
|
||||
#define OMPI_OP_3BUFF_HANDLER_DOUBLE_COMPLEX_INTRINSIC(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_double_complex OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_DOUBLE_COMPLEX_INTRINSIC(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_REAL4
|
||||
#define OMPI_OP_3BUFF_HANDLER_COMPLEX8(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_complex8 OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_COMPLEX8(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_REAL8
|
||||
#define OMPI_OP_3BUFF_HANDLER_COMPLEX16(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_complex16 OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_COMPLEX16(name)
|
||||
#endif
|
||||
#if OMPI_HAVE_FORTRAN_REAL16
|
||||
#define OMPI_OP_3BUFF_HANDLER_COMPLEX32(name) \
|
||||
void ompi_op_base_3buff_##name##_fortran_complex32 OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_COMPLEX32(name)
|
||||
#endif
|
||||
#if HAVE_FLOAT__COMPLEX
|
||||
#define OMPI_OP_3BUFF_HANDLER_FLOAT__COMPLEX(name) \
|
||||
void ompi_op_base_3buff_##name##_c_float__complex OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_FLOAT__COMPLEX(name)
|
||||
#endif
|
||||
#if HAVE_DOUBLE__COMPLEX
|
||||
#define OMPI_OP_3BUFF_HANDLER_DOUBLE__COMPLEX(name) \
|
||||
void ompi_op_base_3buff_##name##_c_double__complex OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_DOUBLE__COMPLEX(name)
|
||||
#endif
|
||||
#if HAVE_LONG_DOUBLE__COMPLEX
|
||||
#define OMPI_OP_3BUFF_HANDLER_LONG_DOUBLE__COMPLEX(name) \
|
||||
void ompi_op_base_3buff_##name##_c_long_double__complex OMPI_OP_PROTO_3BUF;
|
||||
#else
|
||||
#define OMPI_OP_3BUFF_HANDLER_LONG_DOUBLE__COMPLEX(name)
|
||||
#endif
|
||||
#define OMPI_OP_3BUFF_HANDLER_COMPLEX(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_COMPLEX_INTRINSIC(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_DOUBLE_COMPLEX_INTRINSIC(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_COMPLEX8(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_COMPLEX16(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_COMPLEX32(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_FLOAT__COMPLEX(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_DOUBLE__COMPLEX(name) \
|
||||
OMPI_OP_3BUFF_HANDLER_LONG_DOUBLE__COMPLEX(name)
|
||||
|
||||
/* Byte */
|
||||
|
||||
#define OMPI_OP_3BUFF_HANDLER_BYTE(name) \
|
||||
void ompi_op_base_3buff_##name##_byte OMPI_OP_PROTO_3BUF;
|
||||
|
||||
/* "2 type" */
|
||||
|
||||
#define OMPI_OP_3BUFF_HANDLER_2TYPE(name) \
|
||||
void ompi_op_base_3buff_##name##_2real OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_2double_precision OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_2integer OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_float_int OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_double_int OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_long_int OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_2int OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_short_int OMPI_OP_PROTO_3BUF; \
|
||||
void ompi_op_base_3buff_##name##_long_double_int OMPI_OP_PROTO_3BUF;
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_MAX
|
||||
*/
|
||||
OMPI_OP_3BUFF_HANDLER_C_INTEGER(max)
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER(max)
|
||||
OMPI_OP_3BUFF_HANDLER_FLOATING_POINT(max)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_MIN
|
||||
*/
|
||||
OMPI_OP_3BUFF_HANDLER_C_INTEGER(min)
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER(min)
|
||||
OMPI_OP_3BUFF_HANDLER_FLOATING_POINT(min)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_SUM
|
||||
*/
|
||||
OMPI_OP_3BUFF_HANDLER_C_INTEGER(sum)
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER(sum)
|
||||
OMPI_OP_3BUFF_HANDLER_FLOATING_POINT(sum)
|
||||
OMPI_OP_3BUFF_HANDLER_COMPLEX(sum)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_PROD
|
||||
*/
|
||||
OMPI_OP_3BUFF_HANDLER_C_INTEGER(prod)
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER(prod)
|
||||
OMPI_OP_3BUFF_HANDLER_FLOATING_POINT(prod)
|
||||
OMPI_OP_3BUFF_HANDLER_COMPLEX(prod)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_LAND
|
||||
*/
|
||||
OMPI_OP_3BUFF_HANDLER_C_INTEGER(land)
|
||||
OMPI_OP_3BUFF_HANDLER_LOGICAL(land)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_BAND
|
||||
*/
|
||||
OMPI_OP_3BUFF_HANDLER_C_INTEGER(band)
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER(band)
|
||||
OMPI_OP_3BUFF_HANDLER_BYTE(band)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_LOR
|
||||
*/
|
||||
OMPI_OP_3BUFF_HANDLER_C_INTEGER(lor)
|
||||
OMPI_OP_3BUFF_HANDLER_LOGICAL(lor)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_BOR
|
||||
*/
|
||||
OMPI_OP_3BUFF_HANDLER_C_INTEGER(bor)
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER(bor)
|
||||
OMPI_OP_3BUFF_HANDLER_BYTE(bor)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_LXOR
|
||||
*/
|
||||
OMPI_OP_3BUFF_HANDLER_C_INTEGER(lxor)
|
||||
OMPI_OP_3BUFF_HANDLER_LOGICAL(lxor)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_BXOR
|
||||
*/
|
||||
OMPI_OP_3BUFF_HANDLER_C_INTEGER(bxor)
|
||||
OMPI_OP_3BUFF_HANDLER_FORTRAN_INTEGER(bxor)
|
||||
OMPI_OP_3BUFF_HANDLER_BYTE(bxor)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_MAXLOC
|
||||
*/
|
||||
OMPI_OP_3BUFF_HANDLER_2TYPE(maxloc)
|
||||
|
||||
/**
|
||||
* Handler functions for MPI_MINLOC
|
||||
*/
|
||||
OMPI_OP_3BUFF_HANDLER_2TYPE(minloc)
|
||||
|
||||
/**
|
||||
* Globals holding all the "base" function pointers, indexed by op and
|
||||
* datatype.
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@ -1,3 +1,4 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
@ -13,6 +14,8 @@
|
||||
* reserved.
|
||||
* Copyright (c) 2007-2008 UT-Battelle, LLC
|
||||
* Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -153,23 +156,12 @@ enum {
|
||||
OMPI_OP_BASE_TYPE_BOOL,
|
||||
|
||||
/** Complex */
|
||||
OMPI_OP_BASE_TYPE_COMPLEX,
|
||||
/** Double complex */
|
||||
OMPI_OP_BASE_TYPE_DOUBLE_COMPLEX,
|
||||
/** Complex8 */
|
||||
OMPI_OP_BASE_TYPE_COMPLEX8,
|
||||
/** Complex16 */
|
||||
OMPI_OP_BASE_TYPE_COMPLEX16,
|
||||
/** Complex32 */
|
||||
OMPI_OP_BASE_TYPE_COMPLEX32,
|
||||
|
||||
/** C Complex */
|
||||
/* float _Complex */
|
||||
OMPI_OP_BASE_TYPE_C_FLOAT__COMPLEX,
|
||||
/* double _Complex */
|
||||
OMPI_OP_BASE_TYPE_C_DOUBLE__COMPLEX,
|
||||
/* long double _Complex */
|
||||
OMPI_OP_BASE_TYPE_C_LONG_DOUBLE__COMPLEX,
|
||||
/* float complex */
|
||||
OMPI_OP_BASE_TYPE_C_FLOAT_COMPLEX,
|
||||
/* double complex */
|
||||
OMPI_OP_BASE_TYPE_C_DOUBLE_COMPLEX,
|
||||
/* long double complex */
|
||||
OMPI_OP_BASE_TYPE_C_LONG_DOUBLE_COMPLEX,
|
||||
|
||||
/** Byte */
|
||||
OMPI_OP_BASE_TYPE_BYTE,
|
||||
|
44
ompi/op/op.c
44
ompi/op/op.c
@ -1,3 +1,4 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
@ -11,6 +12,8 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -92,6 +95,10 @@ ompi_predefined_op_t *ompi_mpi_op_replace_addr = &ompi_mpi_op_replace;
|
||||
*/
|
||||
int ompi_op_ddt_map[OMPI_DATATYPE_MAX_PREDEFINED];
|
||||
|
||||
/* Get the c complex operator associated with a fortran complex type */
|
||||
#define FORTRAN_COMPLEX_OP_TYPE_X(type) OMPI_OP_BASE_TYPE_ ## type
|
||||
/* Preprocessor hack to ensure type gets expanded correctly */
|
||||
#define FORTRAN_COMPLEX_OP_TYPE(type) FORTRAN_COMPLEX_OP_TYPE_X(type)
|
||||
|
||||
#define FLAGS_NO_FLOAT \
|
||||
(OMPI_OP_FLAGS_INTRINSIC | OMPI_OP_FLAGS_ASSOC | OMPI_OP_FLAGS_COMMUTE)
|
||||
@ -131,15 +138,20 @@ int ompi_op_init(void)
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_FLOAT] = OMPI_OP_BASE_TYPE_FLOAT;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_DOUBLE] = OMPI_OP_BASE_TYPE_DOUBLE;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_LONG_DOUBLE] = OMPI_OP_BASE_TYPE_LONG_DOUBLE;
|
||||
#if OMPI_SIZEOF_FORTRAN_COMPLEX8 == SIZEOF_FLOAT__COMPLEX
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_COMPLEX8] = OMPI_OP_BASE_TYPE_COMPLEX8;
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX8
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_COMPLEX8] = FORTRAN_COMPLEX_OP_TYPE(OMPI_KIND_FORTRAN_COMPLEX8);
|
||||
#endif
|
||||
#if OMPI_SIZEOF_FORTRAN_COMPLEX16 == SIZEOF_DOUBLE__COMPLEX
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_COMPLEX16] = OMPI_OP_BASE_TYPE_COMPLEX16;
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX16
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_COMPLEX16] = FORTRAN_COMPLEX_OP_TYPE(OMPI_KIND_FORTRAN_COMPLEX16);
|
||||
#endif
|
||||
#if OMPI_SIZEOF_FORTRAN_COMPLEX32 == SIZEOF_LONG_DOUBLE__COMPLEX
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_COMPLEX32] = OMPI_OP_BASE_TYPE_COMPLEX32;
|
||||
|
||||
/* Only enable reductions on COMPLEX32 if the REAL*16 matches the equivalent C type */
|
||||
#if OMPI_REAL16_MATCHES_C && OMPI_HAVE_FORTRAN_COMPLEX32
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_COMPLEX32] = FORTRAN_COMPLEX_OP_TYPE(OMPI_KIND_FORTRAN_COMPLEX32);
|
||||
#endif
|
||||
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_WCHAR] = OMPI_OP_BASE_TYPE_WCHAR;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_BOOL] = OMPI_OP_BASE_TYPE_BOOL;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_LOGICAL] = OMPI_OP_BASE_TYPE_LOGICAL;
|
||||
@ -148,9 +160,15 @@ int ompi_op_init(void)
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_REAL] = OMPI_OP_BASE_TYPE_REAL;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_DOUBLE_PRECISION] = OMPI_OP_BASE_TYPE_DOUBLE_PRECISION;
|
||||
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_COMPLEX] = OMPI_OP_BASE_TYPE_COMPLEX8;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_DOUBLE_COMPLEX] = OMPI_OP_BASE_TYPE_COMPLEX16;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_LONG_DOUBLE_COMPLEX] = OMPI_OP_BASE_TYPE_COMPLEX32;
|
||||
#if OMPI_HAVE_FORTRAN_COMPLEX
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_COMPLEX] = FORTRAN_COMPLEX_OP_TYPE(OMPI_KIND_FORTRAN_COMPLEX);
|
||||
#endif
|
||||
|
||||
#if OMPI_HAVE_FORTRAN_DOUBLE_COMPLEX
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_DOUBLE_COMPLEX] = FORTRAN_COMPLEX_OP_TYPE(OMPI_KIND_FORTRAN_DOUBLE_COMPLEX);
|
||||
#endif
|
||||
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_LONG_DOUBLE_COMPLEX] = OMPI_OP_BASE_TYPE_C_LONG_DOUBLE_COMPLEX;
|
||||
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_2INT] = OMPI_OP_BASE_TYPE_2INT;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_2INTEGER] = OMPI_OP_BASE_TYPE_2INTEGER;
|
||||
@ -180,10 +198,10 @@ int ompi_op_init(void)
|
||||
#warning Unsupported definition for MPI_OFFSET
|
||||
#endif
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_C_BOOL] = OMPI_OP_BASE_TYPE_BOOL;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_C_COMPLEX] = OMPI_OP_BASE_TYPE_C_FLOAT__COMPLEX;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_C_FLOAT_COMPLEX] = OMPI_OP_BASE_TYPE_C_FLOAT__COMPLEX;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_C_DOUBLE_COMPLEX] = OMPI_OP_BASE_TYPE_C_DOUBLE__COMPLEX;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_C_LONG_DOUBLE_COMPLEX] = OMPI_OP_BASE_TYPE_C_LONG_DOUBLE__COMPLEX;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_C_COMPLEX] = OMPI_OP_BASE_TYPE_C_FLOAT_COMPLEX;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_C_FLOAT_COMPLEX] = OMPI_OP_BASE_TYPE_C_FLOAT_COMPLEX;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_C_DOUBLE_COMPLEX] = OMPI_OP_BASE_TYPE_C_DOUBLE_COMPLEX;
|
||||
ompi_op_ddt_map[OMPI_DATATYPE_MPI_C_LONG_DOUBLE_COMPLEX] = OMPI_OP_BASE_TYPE_C_LONG_DOUBLE_COMPLEX;
|
||||
|
||||
/* MPI 3.0 datatypes */
|
||||
#if OMPI_MPI_COUNT_SIZE == 4
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
@ -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 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
||||
@ -49,7 +49,9 @@ BEGIN_C_DECLS
|
||||
*
|
||||
* This must match the same definition as in opal_datatype_internal.h
|
||||
*/
|
||||
#if !defined(OPAL_DATATYPE_MAX_PREDEFINED)
|
||||
#define OPAL_DATATYPE_MAX_PREDEFINED 25
|
||||
#endif
|
||||
/*
|
||||
* No more than this number of _Basic_ datatypes in C/CPP or Fortran
|
||||
* are supported (in order to not change setup and usage of btypes).
|
||||
@ -166,9 +168,9 @@ OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_float4; /* in bytes
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_float8; /* in bytes */
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_float12; /* in bytes */
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_float16; /* in bytes */
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_complex8; /* in bytes */
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_complex16; /* in bytes */
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_complex32; /* in bytes */
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_float_complex;
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_double_complex;
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_long_double_complex;
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_bool;
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_wchar;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
@ -11,6 +11,8 @@
|
||||
* Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -122,22 +124,20 @@ static inline void DUMP( char* fmt __opal_attribute_unused_tmp__, ... )
|
||||
#define OPAL_DATATYPE_FLOAT8 16
|
||||
#define OPAL_DATATYPE_FLOAT12 17
|
||||
#define OPAL_DATATYPE_FLOAT16 18
|
||||
#define OPAL_DATATYPE_COMPLEX8 19
|
||||
#define OPAL_DATATYPE_COMPLEX16 20
|
||||
#define OPAL_DATATYPE_COMPLEX32 21
|
||||
#define OPAL_DATATYPE_FLOAT_COMPLEX 19
|
||||
#define OPAL_DATATYPE_DOUBLE_COMPLEX 20
|
||||
#define OPAL_DATATYPE_LONG_DOUBLE_COMPLEX 21
|
||||
#define OPAL_DATATYPE_BOOL 22
|
||||
#define OPAL_DATATYPE_WCHAR 23
|
||||
#define OPAL_DATATYPE_UNAVAILABLE 24
|
||||
|
||||
#ifndef OPAL_DATATYPE_MAX_PREDEFINED
|
||||
#define OPAL_DATATYPE_MAX_PREDEFINED 25
|
||||
#endif
|
||||
|
||||
#define OPAL_DATATYPE_MAX_PREDEFINED (OPAL_DATATYPE_UNAVAILABLE+1)
|
||||
#elif OPAL_DATATYPE_MAX_PREDEFINED <= OPAL_DATATYPE_UNAVAILABLE
|
||||
/*
|
||||
* If the number of basic datatype should change update
|
||||
* OPAL_DATATYPE_MAX_PREDEFINED in datatype.h
|
||||
* OPAL_DATATYPE_MAX_PREDEFINED in opal_datatype.h
|
||||
*/
|
||||
#if OPAL_DATATYPE_MAX_PREDEFINED <= OPAL_DATATYPE_UNAVAILABLE
|
||||
#error OPAL_DATATYPE_MAX_PREDEFINED should be updated to the next value after the OPAL_DATATYPE_UNAVAILABLE define
|
||||
#endif
|
||||
|
||||
@ -230,50 +230,11 @@ struct opal_datatype_t;
|
||||
* into
|
||||
* OPAL_DATATYPE_INIT_BTYPES_ARRAY_[0-21], then order and naming would _not_ matter....
|
||||
*/
|
||||
#define Z5 0, 0, 0, 0, 0
|
||||
#define Z10 Z5, Z5
|
||||
#define Z15 Z10, Z5
|
||||
#define Z20 Z10, Z10
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_UNAVAILABLE { 0, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_LOOP { 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_END_LOOP { 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_LB { 0, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_UB { 0, 0, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_INT1 { 0, 0, 0, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_INT2 { Z5, 1, } /*5*/
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_INT4 { Z5, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_INT8 { Z5, 0, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_INT16 { Z5, 0, 0, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_UINT1 { Z5, 0, 0, 0, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_UINT2 { Z10, 1, } /*10*/
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_UINT4 { Z10, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_UINT8 { Z10, 0, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_UINT16 { Z10, 0, 0, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_FLOAT2 { Z10, 0, 0, 0, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_FLOAT4 { Z15, 1, } /*15*/
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_FLOAT8 { Z15, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_FLOAT12 { Z15, 0, 0, 1, }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_FLOAT16 { Z15, 0, 0, 0, 1, }
|
||||
#if HAVE_FLOAT__COMPLEX
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_COMPLEX8 { Z15, 0, 0, 0, 0, 1 }
|
||||
#else
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_COMPLEX8 { Z15, 2 } /* two floats */
|
||||
#endif
|
||||
#if HAVE_DOUBLE__COMPLEX
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_COMPLEX16 { Z15, 0, 0, 0, 0, 0, 1 }
|
||||
#else
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_COMPLEX16 { Z15, 0, 2, }
|
||||
#endif
|
||||
#if HAVE_LONG_DOUBLE__COMPLEX
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_COMPLEX32 { Z15, 0, 0, 0, 0, 0, 0, 1 }
|
||||
#else
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_COMPLEX32 { Z15, 0, 0, 0, 2, }
|
||||
#endif
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_BOOL { Z20, 0, 1, } /*22*/
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_WCHAR { Z20, 0, 0, 1, }
|
||||
|
||||
#define OPAL_DATATYPE_INIT_NAME(NAME) "OPAL_" _OPAL_DATATYPE_INIT_NAME(NAME)
|
||||
#define _OPAL_DATATYPE_INIT_NAME(NAME) #NAME
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY_UNAVAILABLE { 0 }
|
||||
#define OPAL_DATATYPE_INIT_BTYPES_ARRAY(NAME) { [OPAL_DATATYPE_ ## NAME] = 1 }
|
||||
|
||||
#define OPAL_DATATYPE_INIT_NAME(NAME) "OPAL_" #NAME
|
||||
|
||||
/*
|
||||
* Macro to initialize the main description for basic types, setting the pointer
|
||||
@ -282,76 +243,76 @@ struct opal_datatype_t;
|
||||
*/
|
||||
#define OPAL_DATATYPE_INIT_DESC_PREDEFINED(NAME) \
|
||||
{ \
|
||||
1 /*length*/, 1/*used*/, \
|
||||
&(opal_datatype_predefined_elem_desc[2 * OPAL_DATATYPE_ ## NAME]) /*desc*/ \
|
||||
.length = 1, .used = 1, \
|
||||
.desc = &(opal_datatype_predefined_elem_desc[2 * OPAL_DATATYPE_ ## NAME]) \
|
||||
}
|
||||
#define OPAL_DATATYPE_INIT_DESC_NULL {0 /*length*/, 0/*used*/, NULL /*desc*/}
|
||||
#define OPAL_DATATYPE_INIT_DESC_NULL {.length = 0, .used = 0, .desc = NULL}
|
||||
|
||||
#define OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( NAME, FLAGS ) \
|
||||
{ \
|
||||
OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
OPAL_DATATYPE_FLAG_UNAVAILABLE | OPAL_DATATYPE_FLAG_PREDEFINED | (FLAGS) /*flag*/, \
|
||||
OPAL_DATATYPE_ ## NAME /*id*/, \
|
||||
0 /*bdt_used*/, \
|
||||
0 /*size*/, \
|
||||
0 /*true_lb*/, 0 /*true_ub*/, 0 /*lb*/, 0 /*ub*/, \
|
||||
0 /*align*/, \
|
||||
1 /*nbElems*/, \
|
||||
OPAL_DATATYPE_INIT_NAME(NAME), /*name*/ \
|
||||
OPAL_DATATYPE_INIT_DESC_PREDEFINED(UNAVAILABLE), /*desc*/ \
|
||||
OPAL_DATATYPE_INIT_DESC_PREDEFINED(UNAVAILABLE), /*opt_desc*/ \
|
||||
OPAL_DATATYPE_INIT_BTYPES_ARRAY_UNAVAILABLE /*btypes*/ \
|
||||
.super = OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
.flags = OPAL_DATATYPE_FLAG_UNAVAILABLE | OPAL_DATATYPE_FLAG_PREDEFINED | (FLAGS), \
|
||||
.id = OPAL_DATATYPE_ ## NAME, \
|
||||
.bdt_used = 0, \
|
||||
.size = 0, \
|
||||
.true_lb = 0, .true_ub = 0, .lb = 0, .ub = 0, \
|
||||
.align = 0, \
|
||||
.nbElems = 1, \
|
||||
.name = OPAL_DATATYPE_INIT_NAME(NAME), \
|
||||
.desc = OPAL_DATATYPE_INIT_DESC_PREDEFINED(UNAVAILABLE), \
|
||||
.opt_desc = OPAL_DATATYPE_INIT_DESC_PREDEFINED(UNAVAILABLE), \
|
||||
.btypes = OPAL_DATATYPE_INIT_BTYPES_ARRAY_UNAVAILABLE \
|
||||
}
|
||||
|
||||
#define OPAL_DATATYPE_INITIALIZER_UNAVAILABLE( FLAGS ) \
|
||||
OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( UNAVAILABLE, (FLAGS) )
|
||||
|
||||
#define OPAL_DATATYPE_INITIALIZER_EMPTY( FLAGS ) \
|
||||
{ \
|
||||
OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
OPAL_DATATYPE_FLAG_PREDEFINED | (FLAGS) /*flag*/, \
|
||||
0 /*id*/, \
|
||||
0 /*bdt_used*/, \
|
||||
0 /*size*/, \
|
||||
0 /*true_lb*/, 0 /*true_ub*/, 0 /*lb*/, 0 /*ub*/, \
|
||||
0 /*align*/, \
|
||||
1 /*nbElems*/, \
|
||||
OPAL_DATATYPE_INIT_NAME(EMPTY), /*name*/ \
|
||||
OPAL_DATATYPE_INIT_DESC_NULL, /*desc*/ \
|
||||
OPAL_DATATYPE_INIT_DESC_NULL, /*opt_desc*/ \
|
||||
OPAL_DATATYPE_INIT_BTYPES_ARRAY_UNAVAILABLE /*btypes*/ \
|
||||
#define OPAL_DATATYPE_INITIALIZER_EMPTY( FLAGS ) \
|
||||
{ \
|
||||
.super = OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
.flags = OPAL_DATATYPE_FLAG_PREDEFINED | (FLAGS), \
|
||||
.id = 0, \
|
||||
.bdt_used = 0, \
|
||||
.size = 0, \
|
||||
.true_lb = 0, .true_ub = 0, .lb = 0, .ub = 0, \
|
||||
.align = 0, \
|
||||
.nbElems = 1, \
|
||||
.name = OPAL_DATATYPE_INIT_NAME(EMPTY), \
|
||||
.desc = OPAL_DATATYPE_INIT_DESC_NULL, \
|
||||
.opt_desc = OPAL_DATATYPE_INIT_DESC_NULL, \
|
||||
.btypes = OPAL_DATATYPE_INIT_BTYPES_ARRAY_UNAVAILABLE \
|
||||
}
|
||||
|
||||
#define OPAL_DATATYPE_INIT_BASIC_TYPE( TYPE, NAME, FLAGS ) \
|
||||
{ \
|
||||
OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
OPAL_DATATYPE_FLAG_PREDEFINED | (FLAGS) /*flag*/, \
|
||||
TYPE /*id*/, \
|
||||
(((uint32_t)1)<<(TYPE)) /*bdt_used*/, \
|
||||
0 /*size*/, \
|
||||
0 /*true_lb*/, 0 /*true_ub*/, 0 /*lb*/, 0 /*ub*/, \
|
||||
0 /*align*/, \
|
||||
1 /*nbElems*/, \
|
||||
OPAL_DATATYPE_INIT_NAME(NAME), /*name*/ \
|
||||
OPAL_DATATYPE_INIT_DESC_NULL, /*desc*/ \
|
||||
OPAL_DATATYPE_INIT_DESC_NULL, /*opt_desc*/ \
|
||||
OPAL_DATATYPE_INIT_BTYPES_ARRAY_ ## NAME /*btypes*/ \
|
||||
#define OPAL_DATATYPE_INIT_BASIC_TYPE( TYPE, NAME, FLAGS ) \
|
||||
{ \
|
||||
.super = OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
.flags = OPAL_DATATYPE_FLAG_PREDEFINED | (FLAGS), \
|
||||
.id = TYPE, \
|
||||
.bdt_used = (((uint32_t)1)<<(TYPE)), \
|
||||
.size = 0, \
|
||||
.true_lb = 0, .true_ub = 0, .lb = 0, .ub = 0, \
|
||||
.align = 0, \
|
||||
.nbElems = 1, \
|
||||
.name = OPAL_DATATYPE_INIT_NAME(NAME), \
|
||||
.desc = OPAL_DATATYPE_INIT_DESC_NULL, \
|
||||
.opt_desc = OPAL_DATATYPE_INIT_DESC_NULL, \
|
||||
.btypes = OPAL_DATATYPE_INIT_BTYPES_ARRAY(NAME) \
|
||||
}
|
||||
|
||||
#define OPAL_DATATYPE_INIT_BASIC_DATATYPE( TYPE, ALIGN, NAME, FLAGS ) \
|
||||
{ \
|
||||
OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
OPAL_DATATYPE_FLAG_BASIC | (FLAGS) /*flag*/, \
|
||||
OPAL_DATATYPE_ ## NAME /*id*/, \
|
||||
(((uint32_t)1)<<(OPAL_DATATYPE_ ## NAME)) /*bdt_used*/, \
|
||||
sizeof(TYPE) /*size*/, \
|
||||
0 /*true_lb*/, sizeof(TYPE) /*true_ub*/, 0 /*lb*/, sizeof(TYPE) /*ub*/, \
|
||||
(ALIGN) /*align*/, \
|
||||
1 /*nbElems*/, \
|
||||
OPAL_DATATYPE_INIT_NAME(NAME) /*name*/, \
|
||||
OPAL_DATATYPE_INIT_DESC_PREDEFINED(NAME) /*desc*/, \
|
||||
OPAL_DATATYPE_INIT_DESC_PREDEFINED(NAME) /*opt_desc*/, \
|
||||
OPAL_DATATYPE_INIT_BTYPES_ARRAY_ ## NAME /*btypes*/ \
|
||||
.super = OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
.flags = OPAL_DATATYPE_FLAG_BASIC | (FLAGS), \
|
||||
.id = OPAL_DATATYPE_ ## NAME, \
|
||||
.bdt_used = (((uint32_t)1)<<(OPAL_DATATYPE_ ## NAME)), \
|
||||
.size = sizeof(TYPE), \
|
||||
.true_lb = 0, .true_ub = sizeof(TYPE), .lb = 0, .ub = sizeof(TYPE), \
|
||||
.align = (ALIGN), \
|
||||
.nbElems = 1, \
|
||||
.name = OPAL_DATATYPE_INIT_NAME(NAME), \
|
||||
.desc = OPAL_DATATYPE_INIT_DESC_PREDEFINED(NAME), \
|
||||
.opt_desc = OPAL_DATATYPE_INIT_DESC_PREDEFINED(NAME), \
|
||||
.btypes = OPAL_DATATYPE_INIT_BTYPES_ARRAY(NAME) \
|
||||
}
|
||||
|
||||
#define OPAL_DATATYPE_INITIALIZER_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_LOOP, LOOP, FLAGS )
|
||||
@ -427,110 +388,24 @@ struct opal_datatype_t;
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT16(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( FLOAT16, FLAGS )
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Until we figure out the whole logic behing the _Complex type, disable it. It only exists
|
||||
* in C99 (i.e. __STDC_VERSION__ >= 199901L) but [evidently] not all compilers correctly
|
||||
* export the __STDC_VERSION__.
|
||||
* http://predef.sourceforge.net/prestd.html for more info.
|
||||
*/
|
||||
|
||||
#define OPAL_USE_FLOAT__COMPLEX HAVE_FLOAT__COMPLEX
|
||||
#define OPAL_USE_DOUBLE__COMPLEX HAVE_DOUBLE__COMPLEX
|
||||
#define OPAL_USE_LONG_DOUBLE__COMPLEX HAVE_LONG_DOUBLE__COMPLEX
|
||||
|
||||
#if OPAL_USE_FLOAT__COMPLEX && (SIZEOF_FLOAT__COMPLEX == 8)
|
||||
#define OPAL_DATATYPE_INITIALIZER_COMPLEX8(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( float _Complex, OPAL_ALIGNMENT_FLOAT_COMPLEX, COMPLEX8, (FLAGS) )
|
||||
#if HAVE_FLOAT__COMPLEX
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT_COMPLEX(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( float _Complex, OPAL_ALIGNMENT_FLOAT_COMPLEX, FLOAT_COMPLEX, FLAGS )
|
||||
#else
|
||||
|
||||
#if SIZEOF_FLOAT == 4
|
||||
typedef struct {
|
||||
float r;
|
||||
float i;
|
||||
} opal_complex_float_t;
|
||||
|
||||
#define OPAL_DATATYPE_INITIALIZER_COMPLEX8( FLAGS ) \
|
||||
{ \
|
||||
OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
OPAL_DATATYPE_FLAG_BASIC | (FLAGS) /*flag*/, \
|
||||
OPAL_DATATYPE_COMPLEX8 /*id*/, \
|
||||
(((uint32_t)1)<<(OPAL_DATATYPE_ ## FLOAT4)) /*bdt_used*/, \
|
||||
sizeof(opal_complex_float_t) /*size*/, \
|
||||
0 /*true_lb*/, sizeof(opal_complex_float_t) /*true_ub*/, 0 /*lb*/, sizeof(opal_complex_float_t) /*ub*/, \
|
||||
OPAL_ALIGNMENT_FLOAT /*align*/, \
|
||||
2 /*nbElems*/, \
|
||||
OPAL_DATATYPE_INIT_NAME(COMPLEX8) /*name*/, \
|
||||
OPAL_DATATYPE_INIT_DESC_PREDEFINED(COMPLEX8) /*desc*/, \
|
||||
OPAL_DATATYPE_INIT_DESC_PREDEFINED(COMPLEX8) /*opt_desc*/, \
|
||||
{Z15, 2, } /*btypes*/ \
|
||||
}
|
||||
#else
|
||||
#define OPAL_DATATYPE_INITIALIZER_COMPLEX8(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( COMPLEX8, FLAGS )
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT_COMPLEX(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( FLOAT_COMPLEX, FLAGS)
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_FLOAT__COMPLEX */
|
||||
|
||||
#if OPAL_USE_DOUBLE__COMPLEX && (SIZEOF_DOUBLE__COMPLEX == 16)
|
||||
#define OPAL_DATATYPE_INITIALIZER_COMPLEX16(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( double _Complex, OPAL_ALIGNMENT_DOUBLE_COMPLEX, COMPLEX16, (FLAGS) )
|
||||
#if HAVE_DOUBLE__COMPLEX
|
||||
#define OPAL_DATATYPE_INITIALIZER_DOUBLE_COMPLEX(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( double _Complex, OPAL_ALIGNMENT_DOUBLE_COMPLEX, DOUBLE_COMPLEX, FLAGS )
|
||||
#else
|
||||
|
||||
#if SIZEOF_DOUBLE == 8
|
||||
typedef struct {
|
||||
double r;
|
||||
double i;
|
||||
} opal_complex_double_t;
|
||||
|
||||
#define OPAL_DATATYPE_INITIALIZER_COMPLEX16( FLAGS ) \
|
||||
{ \
|
||||
OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
OPAL_DATATYPE_FLAG_BASIC | (FLAGS) /*flag*/, \
|
||||
OPAL_DATATYPE_COMPLEX16 /*id*/, \
|
||||
(((uint32_t)1)<<(OPAL_DATATYPE_ ## FLOAT8)) /*bdt_used*/, \
|
||||
sizeof(opal_complex_double_t) /*size*/, \
|
||||
0 /*true_lb*/, sizeof(opal_complex_double_t) /*true_ub*/, 0 /*lb*/, sizeof(opal_complex_double_t) /*ub*/, \
|
||||
OPAL_ALIGNMENT_DOUBLE /*align*/, \
|
||||
2 /*nbElems*/, \
|
||||
OPAL_DATATYPE_INIT_NAME(COMPLEX16) /*name*/, \
|
||||
OPAL_DATATYPE_INIT_DESC_PREDEFINED(COMPLEX16) /*desc*/, \
|
||||
OPAL_DATATYPE_INIT_DESC_PREDEFINED(COMPLEX16) /*opt_desc*/, \
|
||||
{Z15, 2, } /*btypes*/ \
|
||||
}
|
||||
#else
|
||||
#define OPAL_DATATYPE_INITIALIZER_COMPLEX16(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( COMPLEX16, FLAGS )
|
||||
#define OPAL_DATATYPE_INITIALIZER_DOUBLE_COMPLEX(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( DOUBLE_COMPLEX, FLAGS)
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_DOUBLE__COMPLEX */
|
||||
|
||||
#if OPAL_USE_LONG_DOUBLE__COMPLEX && (SIZEOF_LONG_DOUBLE__COMPLEX == 32)
|
||||
#define OPAL_DATATYPE_INITIALIZER_COMPLEX32(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( long double _Complex, OPAL_ALIGNMENT_LONG_DOUBLE_COMPLEX, COMPLEX32, (FLAGS) )
|
||||
#if HAVE_LONG_DOUBLE__COMPLEX
|
||||
#define OPAL_DATATYPE_INITIALIZER_LONG_DOUBLE_COMPLEX(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( long double _Complex, OPAL_ALIGNMENT_LONG_DOUBLE_COMPLEX, LONG_DOUBLE_COMPLEX, FLAGS )
|
||||
#else
|
||||
|
||||
#if HAVE_LONG_DOUBLE && (SIZEOF_LONG_DOUBLE == 16)
|
||||
typedef struct {
|
||||
long double r;
|
||||
long double i;
|
||||
} opal_complex_long_double_t;
|
||||
|
||||
#define OPAL_DATATYPE_INITIALIZER_COMPLEX32( FLAGS ) \
|
||||
{ \
|
||||
OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
|
||||
OPAL_DATATYPE_FLAG_BASIC | (FLAGS) /*flag*/, \
|
||||
OPAL_DATATYPE_COMPLEX32 /*id*/, \
|
||||
(((uint32_t)1)<<(OPAL_DATATYPE_ ## FLOAT16)) /*bdt_used*/, \
|
||||
sizeof(opal_complex_long_double_t) /*size*/, \
|
||||
0 /*true_lb*/, sizeof(opal_complex_long_double_t) /*true_ub*/, 0 /*lb*/, sizeof(opal_complex_long_double_t) /*ub*/, \
|
||||
OPAL_ALIGNMENT_LONG_DOUBLE /*align*/, \
|
||||
2 /*nbElems*/, \
|
||||
OPAL_DATATYPE_INIT_NAME(COMPLEX32) /*name*/, \
|
||||
OPAL_DATATYPE_INIT_DESC_PREDEFINED(COMPLEX32) /*desc*/, \
|
||||
OPAL_DATATYPE_INIT_DESC_PREDEFINED(COMPLEX32) /*opt_desc*/, \
|
||||
{Z15, 2, } /*btypes*/ \
|
||||
}
|
||||
#else
|
||||
#define OPAL_DATATYPE_INITIALIZER_COMPLEX32(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( COMPLEX32, FLAGS )
|
||||
#define OPAL_DATATYPE_INITIALIZER_LONG_DOUBLE_COMPLEX(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( LONG_DOUBLE_COMPLEX, FLAGS)
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_LONG_DOUBLE__COMPLEX */
|
||||
|
||||
#define OPAL_DATATYPE_INITIALIZER_BOOL(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( _Bool, OPAL_ALIGNMENT_BOOL, BOOL, FLAGS )
|
||||
|
||||
#if OPAL_ALIGNMENT_WCHAR != 0
|
||||
@ -539,7 +414,6 @@ typedef struct {
|
||||
#define OPAL_DATATYPE_INITIALIZER_WCHAR(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( WCHAR, FLAGS )
|
||||
#endif
|
||||
|
||||
|
||||
#define BASIC_DDT_FROM_ELEM( ELEM ) (opal_datatype_basicDatatypes[(ELEM).elem.common.type])
|
||||
|
||||
#define SAVE_STACK( PSTACK, INDEX, TYPE, COUNT, DISP) \
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
@ -13,6 +13,8 @@
|
||||
* Copyright (c) 2007 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 (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -66,74 +68,73 @@ OPAL_DECLSPEC const opal_datatype_t opal_datatype_float4 = OPAL_DATATYPE_IN
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_float8 = OPAL_DATATYPE_INITIALIZER_FLOAT8(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_float12 = OPAL_DATATYPE_INITIALIZER_FLOAT12(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_float16 = OPAL_DATATYPE_INITIALIZER_FLOAT16(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_complex8 = OPAL_DATATYPE_INITIALIZER_COMPLEX8(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_complex16 = OPAL_DATATYPE_INITIALIZER_COMPLEX16(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_complex32 = OPAL_DATATYPE_INITIALIZER_COMPLEX32(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_float_complex = OPAL_DATATYPE_INITIALIZER_FLOAT_COMPLEX(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_double_complex = OPAL_DATATYPE_INITIALIZER_DOUBLE_COMPLEX(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_long_double_complex = OPAL_DATATYPE_INITIALIZER_LONG_DOUBLE_COMPLEX(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_bool = OPAL_DATATYPE_INITIALIZER_BOOL(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_wchar = OPAL_DATATYPE_INITIALIZER_WCHAR(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_unavailable = OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED(UNAVAILABLE, 0);
|
||||
|
||||
OPAL_DECLSPEC dt_elem_desc_t opal_datatype_predefined_elem_desc[2 * OPAL_DATATYPE_MAX_PREDEFINED];
|
||||
|
||||
/* NOTE: The order of this array *MUST* match the order in opal_datatype_basicDatatypes */
|
||||
/*
|
||||
* NOTE: The order of this array *MUST* match the order in opal_datatype_basicDatatypes
|
||||
* (use of designated initializers should relax this restrictions some)
|
||||
*/
|
||||
OPAL_DECLSPEC const size_t opal_datatype_local_sizes[OPAL_DATATYPE_MAX_PREDEFINED] =
|
||||
{
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1, /* sizeof (int8_t) */
|
||||
2, /* sizeof (int16_t) */
|
||||
4, /* sizeof (int32_t) */
|
||||
8, /* sizeof (int64_t) */
|
||||
16, /* sizeof (int128_t) */
|
||||
1, /* sizeof (uint8_t) */
|
||||
2, /* sizeof (uint16_t) */
|
||||
4, /* sizeof (uint32_t) */
|
||||
8, /* sizeof (uint64_t) */
|
||||
16, /* sizeof (uint128_t) */
|
||||
2, /* sizeof (float2) */
|
||||
4, /* sizeof (float4) */
|
||||
8, /* sizeof (float8) */
|
||||
12, /* sizeof (float12) */
|
||||
16, /* sizeof (float16) */
|
||||
8, /* 2 * sizeof(float4) */
|
||||
16, /* 2 * sizeof(float8) */
|
||||
32, /* 2 * sizeof(float16) */
|
||||
sizeof (_Bool),
|
||||
sizeof (wchar_t),
|
||||
0 /* unavailable */
|
||||
[OPAL_DATATYPE_INT1] = sizeof(int8_t),
|
||||
[OPAL_DATATYPE_INT2] = sizeof(int16_t),
|
||||
[OPAL_DATATYPE_INT4] = sizeof(int32_t),
|
||||
[OPAL_DATATYPE_INT8] = sizeof(int64_t),
|
||||
[OPAL_DATATYPE_INT16] = 16, /* sizeof (int128_t) */
|
||||
[OPAL_DATATYPE_UINT1] = sizeof(uint8_t),
|
||||
[OPAL_DATATYPE_UINT2] = sizeof(uint16_t),
|
||||
[OPAL_DATATYPE_UINT4] = sizeof(uint32_t),
|
||||
[OPAL_DATATYPE_UINT8] = sizeof(uint64_t),
|
||||
[OPAL_DATATYPE_UINT16] = 16, /* sizeof (uint128_t) */
|
||||
[OPAL_DATATYPE_FLOAT2] = 2, /* sizeof (float2) */
|
||||
[OPAL_DATATYPE_FLOAT4] = 4, /* sizeof (float4) */
|
||||
[OPAL_DATATYPE_FLOAT8] = 8, /* sizeof (float8) */
|
||||
[OPAL_DATATYPE_FLOAT12] = 12, /* sizeof (float12) */
|
||||
[OPAL_DATATYPE_FLOAT16] = 16, /* sizeof (float16) */
|
||||
[OPAL_DATATYPE_FLOAT_COMPLEX] = sizeof(float _Complex),
|
||||
[OPAL_DATATYPE_DOUBLE_COMPLEX] = sizeof(double _Complex),
|
||||
[OPAL_DATATYPE_LONG_DOUBLE_COMPLEX] = sizeof(long double _Complex),
|
||||
[OPAL_DATATYPE_BOOL] = sizeof (_Bool),
|
||||
[OPAL_DATATYPE_WCHAR] = sizeof (wchar_t),
|
||||
};
|
||||
|
||||
/*
|
||||
* NOTE: The order of this array *MUST* match what is listed in datatype.h
|
||||
* (use of designated initializers should relax this restrictions some)
|
||||
*/
|
||||
OPAL_DECLSPEC const opal_datatype_t* opal_datatype_basicDatatypes[OPAL_DATATYPE_MAX_PREDEFINED] = {
|
||||
&opal_datatype_loop,
|
||||
&opal_datatype_end_loop,
|
||||
&opal_datatype_lb,
|
||||
&opal_datatype_ub,
|
||||
&opal_datatype_int1,
|
||||
&opal_datatype_int2,
|
||||
&opal_datatype_int4,
|
||||
&opal_datatype_int8,
|
||||
&opal_datatype_int16, /* Yes, double-machine word integers are available */
|
||||
&opal_datatype_uint1,
|
||||
&opal_datatype_uint2,
|
||||
&opal_datatype_uint4,
|
||||
&opal_datatype_uint8,
|
||||
&opal_datatype_uint16, /* Yes, double-machine word integers are available */
|
||||
&opal_datatype_float2,
|
||||
&opal_datatype_float4,
|
||||
&opal_datatype_float8,
|
||||
&opal_datatype_float12,
|
||||
&opal_datatype_float16,
|
||||
&opal_datatype_complex8,
|
||||
&opal_datatype_complex16,
|
||||
&opal_datatype_complex32,
|
||||
&opal_datatype_bool,
|
||||
&opal_datatype_wchar,
|
||||
&opal_datatype_unavailable
|
||||
[OPAL_DATATYPE_LOOP] = &opal_datatype_loop,
|
||||
[OPAL_DATATYPE_END_LOOP] = &opal_datatype_end_loop,
|
||||
[OPAL_DATATYPE_LB] = &opal_datatype_lb,
|
||||
[OPAL_DATATYPE_UB] = &opal_datatype_ub,
|
||||
[OPAL_DATATYPE_INT1] = &opal_datatype_int1,
|
||||
[OPAL_DATATYPE_INT2] = &opal_datatype_int2,
|
||||
[OPAL_DATATYPE_INT4] = &opal_datatype_int4,
|
||||
[OPAL_DATATYPE_INT8] = &opal_datatype_int8,
|
||||
[OPAL_DATATYPE_INT16] = &opal_datatype_int16, /* Yes, double-machine word integers are available */
|
||||
[OPAL_DATATYPE_UINT1] = &opal_datatype_uint1,
|
||||
[OPAL_DATATYPE_UINT2] = &opal_datatype_uint2,
|
||||
[OPAL_DATATYPE_UINT4] = &opal_datatype_uint4,
|
||||
[OPAL_DATATYPE_UINT8] = &opal_datatype_uint8,
|
||||
[OPAL_DATATYPE_UINT16] = &opal_datatype_uint16, /* Yes, double-machine word integers are available */
|
||||
[OPAL_DATATYPE_FLOAT2] = &opal_datatype_float2,
|
||||
[OPAL_DATATYPE_FLOAT4] = &opal_datatype_float4,
|
||||
[OPAL_DATATYPE_FLOAT8] = &opal_datatype_float8,
|
||||
[OPAL_DATATYPE_FLOAT12] = &opal_datatype_float12,
|
||||
[OPAL_DATATYPE_FLOAT16] = &opal_datatype_float16,
|
||||
[OPAL_DATATYPE_FLOAT_COMPLEX] = &opal_datatype_float_complex,
|
||||
[OPAL_DATATYPE_DOUBLE_COMPLEX] = &opal_datatype_double_complex,
|
||||
[OPAL_DATATYPE_LONG_DOUBLE_COMPLEX] = &opal_datatype_long_double_complex,
|
||||
[OPAL_DATATYPE_BOOL] = &opal_datatype_bool,
|
||||
[OPAL_DATATYPE_WCHAR] = &opal_datatype_wchar,
|
||||
[OPAL_DATATYPE_UNAVAILABLE] = &opal_datatype_unavailable,
|
||||
};
|
||||
|
||||
|
||||
@ -218,30 +219,6 @@ int32_t opal_datatype_init( void )
|
||||
datatype->desc.desc[1].end_loop.size = datatype->size;
|
||||
}
|
||||
|
||||
#if !(OPAL_USE_FLOAT__COMPLEX && (SIZEOF_FLOAT__COMPLEX == 8)) && (SIZEOF_FLOAT == 4)
|
||||
datatype = opal_datatype_basicDatatypes[OPAL_DATATYPE_COMPLEX8];
|
||||
|
||||
datatype->desc.desc[0].elem.common.type = OPAL_DATATYPE_FLOAT4;
|
||||
datatype->desc.desc[0].elem.count = 2;
|
||||
datatype->desc.desc[0].elem.extent = SIZEOF_FLOAT;
|
||||
#endif
|
||||
|
||||
#if !(OPAL_USE_DOUBLE__COMPLEX && (SIZEOF_DOUBLE__COMPLEX == 16)) && (SIZEOF_DOUBLE == 8)
|
||||
datatype = opal_datatype_basicDatatypes[OPAL_DATATYPE_COMPLEX16];
|
||||
|
||||
datatype->desc.desc[0].elem.common.type = OPAL_DATATYPE_FLOAT8;
|
||||
datatype->desc.desc[0].elem.count = 2;
|
||||
datatype->desc.desc[0].elem.extent = SIZEOF_DOUBLE;
|
||||
#endif
|
||||
|
||||
#if !(OPAL_USE_LONG_DOUBLE__COMPLEX && (SIZEOF_LONG_DOUBLE__COMPLEX == 32)) && (HAVE_LONG_DOUBLE && (SIZEOF_LONG_DOUBLE == 16))
|
||||
datatype = opal_datatype_basicDatatypes[OPAL_DATATYPE_COMPLEX32];
|
||||
|
||||
datatype->desc.desc[0].elem.common.type = OPAL_DATATYPE_FLOAT16;
|
||||
datatype->desc.desc[0].elem.count = 2;
|
||||
datatype->desc.desc[0].elem.extent = SIZEOF_LONG_DOUBLE;
|
||||
#endif
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user