31 #include "ompi_config.h"
39 #include "ompi/datatype/ompi_datatype.h"
40 #include "ompi/mpi/f77/fint_2_int.h"
60 MPI_Fint *, MPI_Fint *);
72 MPI_User_function * op);
78 #define OMPI_OP_FLAGS_INTRINSIC 0x0001
80 #define OMPI_OP_FLAGS_FORTRAN_FUNC 0x0002
82 #define OMPI_OP_FLAGS_CXX_FUNC 0x0004
88 #define OMPI_OP_FLAGS_ASSOC 0x0008
92 #define OMPI_OP_FLAGS_FLOAT_ASSOC 0x0010
94 #define OMPI_OP_FLAGS_COMMUTE 0x0020
154 #define PREDEFINED_OP_PAD (sizeof(void*) * 256)
192 OMPI_DECLSPEC
extern int ompi_op_ddt_map[OMPI_DATATYPE_MAX_PREDEFINED];
329 MPI_User_function * fn);
398 char **msg,
const char *func)
408 if (ompi_datatype_is_predefined(ddt)) {
413 "%s: the reduction operation %s is not defined on the %s datatype",
419 if (
'\0' != ddt->
name[0]) {
421 "%s: the reduction operation %s is not defined for non-intrinsic datatypes (attempted with datatype named \"%s\")",
425 "%s: the reduction operation %s is not defined for non-intrinsic datatypes",
468 void *target,
int count,
471 MPI_Fint f_dtype, f_count;
507 f_count = OMPI_INT_2_FINT(count);
516 op->
o_func.
c_fn(source, target, &count, &dtype);
544 void *source2,
void *target,
int o_f_to_c_index
Index in Fortran <-> C translation array.
Definition: op.h:111
Struct that is used in op.h to hold all the function pointers and pointers to the corresopnding modul...
Definition: op.h:400
uint32_t o_flags
Flags about the op.
Definition: op.h:108
struct opal_pointer_array_t * ompi_op_f_to_c_table
Table for Fortran <-> C op handle conversion.
Definition: op.c:34
static bool ompi_op_is_intrinsic(ompi_op_t *op)
Check to see if an op is intrinsic.
Definition: op.h:343
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_null
Global variable for MPI_OP_NULL.
Definition: op.c:61
dynamic pointer array
Definition: opal_pointer_array.h:45
Definition: ompi_datatype.h:68
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_op_base_module_t)
Declare the module as a class, unversioned.
Struct that is used in op.h to hold all the function pointers and pointers to the corresopnding modul...
Definition: op.h:388
#define OMPI_OP_FLAGS_FORTRAN_FUNC
Set if the callback function is in Fortran.
Definition: op.h:80
opal_object_t super
Parent class, for reference counting.
Definition: op.h:102
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_sum
Global variable for MPI_SUM.
Definition: op.c:64
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_prod
Global variable for MPI_PROD.
Definition: op.c:65
static void ompi_3buff_op_reduce(ompi_op_t *op, void *source1, void *source2, void *target, int count, ompi_datatype_t *dtype)
Perform a reduction operation.
Definition: op.h:543
ompi_op_t * ompi_op_create_user(bool commute, ompi_op_fortran_handler_fn_t func)
Create a ompi_op_t with a user-defined callback (vs.
Definition: op.c:260
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_min
Global variable for MPI_MIN.
Definition: op.c:63
#define OMPI_OP_FLAGS_FLOAT_ASSOC
Set if the callback function is associative for floating point operands (e.g., MPI_SUM will have ASSO...
Definition: op.h:92
char o_name[MPI_MAX_OBJECT_NAME]
Name, for debugging purposes.
Definition: op.h:105
static bool ompi_op_is_commute(ompi_op_t *op)
Check to see if an op is communative or not.
Definition: op.h:361
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_maxloc
Global variable for MPI_MAXLOC.
Definition: op.c:72
ompi_op_base_op_3buff_fns_t o_3buff_intrinsic
3-buffer functions, which is only for intrinsic ops.
Definition: op.h:140
struct ompi_op_t ompi_op_t
Convenience typedef.
Definition: op.h:146
union ompi_op_t::@129 o_func
Union holding (2-buffer functions):
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_lor
Global variable for MPI_LOR.
Definition: op.c:68
static bool ompi_op_is_valid(ompi_op_t *op, ompi_datatype_t *ddt, char **msg, const char *func)
Check to see if an op is valid on a given datatype.
Definition: op.h:397
void( ompi_op_cxx_handler_fn_t)(void *, void *, int *, struct ompi_datatype_t **, MPI_User_function *op)
Typedef for C++ op functions intercept (used for user-defined MPI::Ops).
Definition: op.h:70
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_land
Global variable for MPI_LAND.
Definition: op.c:66
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_minloc
Global variable for MPI_MINLOC.
Definition: op.c:73
#define OMPI_OP_FLAGS_CXX_FUNC
Set if the callback function is in C++.
Definition: op.h:82
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_max
Global variable for MPI_MAX.
Definition: op.c:62
OMPI_DECLSPEC int ompi_op_ddt_map[OMPI_DATATYPE_MAX_PREDEFINED]
Array to map ddt->id values to the corresponding position in the op function array.
Definition: op.c:79
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_lxor
Global variable for MPI_LXOR.
Definition: op.c:70
char name[MPI_MAX_OBJECT_NAME]
Externally visible name.
Definition: ompi_datatype.h:79
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_replace
Global variable for MPI_REPLACE.
Definition: op.c:74
int ompi_op_init(void)
Initialize the op interface.
Definition: op.c:91
Base object.
Definition: opal_object.h:182
static bool ompi_op_is_float_assoc(ompi_op_t *op)
Check to see if an op is floating point associative or not.
Definition: op.h:378
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_band
Global variable for MPI_BAND.
Definition: op.c:67
#define PREDEFINED_OP_PAD
Padded struct to maintain back compatibiltiy.
Definition: op.h:154
static void ompi_op_reduce(ompi_op_t *op, void *source, void *target, int count, ompi_datatype_t *dtype)
Perform a reduction operation.
Definition: op.h:467
struct ompi_op_t::@129::@130 cxx_data
C++ intercept function data – see lengthy comment in ompi/mpi/cxx/intercepts.cc::ompi_mpi_cxx_op_int...
ompi_op_fortran_handler_fn_t * fort_fn
Fortran handler function pointer.
Definition: op.h:126
#define OMPI_OP_FLAGS_INTRINSIC
Set if the MPI_Op is a built-in operation.
Definition: op.h:78
#define OMPI_OP_FLAGS_COMMUTE
Set if the callback function is communative.
Definition: op.h:94
int32_t d_f_to_c_index
Fortran index for this datatype.
Definition: ompi_datatype.h:73
int32_t id
OMPI-layers unique id of the type.
Definition: ompi_datatype.h:72
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_bor
Global variable for MPI_BOR.
Definition: op.c:69
OMPI_DECLSPEC ompi_predefined_op_t ompi_mpi_op_bxor
Global variable for MPI_BXOR.
Definition: op.c:71
BEGIN_C_DECLS typedef void() ompi_op_c_handler_fn_t(void *, void *, int *, struct ompi_datatype_t **)
Typedef for C op functions for user-defined MPI_Ops.
void( ompi_op_fortran_handler_fn_t)(void *, void *, MPI_Fint *, MPI_Fint *)
Typedef for fortran user-defined MPI_Ops.
Definition: op.h:59
A simple C-language object-oriented system with single inheritance and ownership-based memory managem...
OMPI_DECLSPEC void ompi_op_set_cxx_callback(ompi_op_t *op, MPI_User_function *fn)
Mark an MPI_Op as holding a C++ callback function, and cache that function in the MPI_Op...
Definition: op.c:307
Back-end type of MPI_Op.
Definition: op.h:100
ompi_op_base_op_fns_t intrinsic
Function/module pointers for intrinsic ops.
Definition: op.h:122
MPI_Op back-end operation framework.
int ompi_op_finalize(void)
Finalize the op interface.
Definition: op.c:229
ompi_op_c_handler_fn_t * c_fn
C handler function pointer.
Definition: op.h:124