OpenMPI
0.1.1
|
MPI_Op back-end operation framework. More...
#include "ompi_config.h"
#include "opal/class/opal_object.h"
#include "opal/mca/mca.h"
#include "ompi/types.h"
Go to the source code of this file.
Data Structures | |
struct | ompi_op_base_component_1_0_0_t |
Op component interface. More... | |
struct | ompi_op_base_module_1_0_0_t |
Module struct. More... | |
struct | ompi_op_base_op_fns_1_0_0_t |
Struct that is used in op.h to hold all the function pointers and pointers to the corresopnding modules (so that we can properly RETAIN/RELEASE them) More... | |
struct | ompi_op_base_op_3buff_fns_1_0_0_t |
Struct that is used in op.h to hold all the function pointers and pointers to the corresopnding modules (so that we can properly RETAIN/RELEASE them) More... | |
Macros | |
#define | OMPI_OP_BASE_VERSION_1_0_0 |
Typedefs | |
typedef struct ompi_op_base_module_1_0_0_t | ompi_op_base_module_t |
typedef void(* | ompi_op_base_handler_fn_1_0_0_t )(void *, void *, int *, struct ompi_datatype_t **, struct ompi_op_base_module_1_0_0_t *) |
Typedef for 2-buffer op functions. More... | |
typedef ompi_op_base_handler_fn_1_0_0_t | ompi_op_base_handler_fn_t |
typedef void(* | ompi_op_base_3buff_handler_fn_1_0_0_t )(void *, void *, void *, int *, struct ompi_datatype_t **, struct ompi_op_base_module_1_0_0_t *) |
typedef ompi_op_base_3buff_handler_fn_1_0_0_t | ompi_op_base_3buff_handler_fn_t |
typedef int(* | ompi_op_base_component_init_query_fn_t )(bool enable_progress_threads, bool enable_mpi_threads) |
Op component initialization. More... | |
typedef struct ompi_op_base_module_1_0_0_t *(* | ompi_op_base_component_op_query_1_0_0_fn_t )(struct ompi_op_t *op, int *priority) |
Query whether a component is available for a specific MPI_Op. More... | |
typedef struct ompi_op_base_component_1_0_0_t | ompi_op_base_component_1_0_0_t |
Op component interface. More... | |
typedef struct ompi_op_base_component_1_0_0_t | ompi_op_base_component_t |
Per guidence in mca.h, use the unversioned struct name if you just want to always keep up with the most recent version of the interace. More... | |
typedef int(* | ompi_op_base_module_enable_1_0_0_fn_t )(struct ompi_op_base_module_1_0_0_t *module, struct ompi_op_t *op) |
Module initialization function. More... | |
typedef struct ompi_op_base_module_1_0_0_t | ompi_op_base_module_1_0_0_t |
Module struct. | |
typedef struct ompi_op_base_op_fns_1_0_0_t | ompi_op_base_op_fns_1_0_0_t |
Struct that is used in op.h to hold all the function pointers and pointers to the corresopnding modules (so that we can properly RETAIN/RELEASE them) | |
typedef ompi_op_base_op_fns_1_0_0_t | ompi_op_base_op_fns_t |
typedef struct ompi_op_base_op_3buff_fns_1_0_0_t | ompi_op_base_op_3buff_fns_1_0_0_t |
Struct that is used in op.h to hold all the function pointers and pointers to the corresopnding modules (so that we can properly RETAIN/RELEASE them) | |
typedef ompi_op_base_op_3buff_fns_1_0_0_t | ompi_op_base_op_3buff_fns_t |
Functions | |
OMPI_DECLSPEC | OBJ_CLASS_DECLARATION (ompi_op_base_module_t) |
Declare the module as a class, unversioned. | |
MPI_Op back-end operation framework.
This framework allows component-izing the back-end operations of MPI_Op in order to use specialized hardware (e.g., mathematical accelerators). In short: each MPI_Op contains a table of function pointers; one for implementing the operation on each predefined datatype.
The MPI interface provides error checking and error handler invocation, but the op components provide all other functionality.
Component selection is done on a per-MPI_Op basis when each MPI_Op is created. All MPI_Ops go through the selection process, even user-defined MPI_Ops – although it is expected that most (all?) op components will only be able to handle the predefined MPI_Ops.
The general sequence of usage for the op framework is:
Note that a module may only have some non-NULL function pointers (i.e., for the functions that it can support). For example, some modules may only support operations on single-precision floating point datatypes. These modules would provide function pointers for these datatypes and NULL for all the rest. The op framework will mix-n-match function pointers between modules to obtain a full set of non-NULL function pointers for a given MPI_Op (note that the op base provides a complete set of functions for the MPI_Op, usually a simple C loop around the operation, such as "+=" – so even if there is no specialized op component available, there will always be a full set of MPI_Op function pointers). The op framework will OBJ_RETAIN an op module once for each function pointer where it is used on a given MPI_Op.
Note that this scheme can result in up to N different modules being used for a single MPI_Op, one per needed datatype function.
#define OMPI_OP_BASE_VERSION_1_0_0 |
typedef struct ompi_op_base_component_1_0_0_t ompi_op_base_component_1_0_0_t |
Op component interface.
Component interface for the op framework. A public instance of this structure, called mca_op_[component_name]_component, must exist in any op component.
typedef int(* ompi_op_base_component_init_query_fn_t)(bool enable_progress_threads, bool enable_mpi_threads) |
Op component initialization.
Initialize the given op component. This function should initialize any component-level. data. It will be called exactly once during MPI_INIT.
[in] | enable_progress_threads | True if the component needs to support progress threads |
[in] | enable_mpi_threads | True if the component needs to support MPI_THREAD_MULTIPLE |
OMPI_SUCCESS | Component successfully initialized |
OMPI_ERROR | An unspecified error occurred |
typedef struct ompi_op_base_module_1_0_0_t*(* ompi_op_base_component_op_query_1_0_0_fn_t)(struct ompi_op_t *op, int *priority) |
Query whether a component is available for a specific MPI_Op.
If the component is available, an object should be allocated and returned (with refcount at 1). The module will not be used for reduction operations until module_enable() is called on the module, but may be destroyed (via OBJ_RELEASE) either before or after module_enable() is called. If the module needs to release resources obtained during query(), it should do so in the module destructor.
A component may provide NULL to this function to indicate it does not wish to run or return an error during module_enable().
[in] | op | The MPI_Op being created |
[out] | priority | Priority setting for component on this op |
typedef struct ompi_op_base_component_1_0_0_t ompi_op_base_component_t |
Per guidence in mca.h, use the unversioned struct name if you just want to always keep up with the most recent version of the interace.
typedef void(* ompi_op_base_handler_fn_1_0_0_t)(void *, void *, int *, struct ompi_datatype_t **, struct ompi_op_base_module_1_0_0_t *) |
Typedef for 2-buffer op functions.
We don't use MPI_User_function because this would create a confusing dependency loop between this file and mpi.h. So this is repeated code, but it's better this way (and this typedef will never change, so there's not much of a maintenance worry).
typedef int(* ompi_op_base_module_enable_1_0_0_fn_t)(struct ompi_op_base_module_1_0_0_t *module, struct ompi_op_t *op) |
Module initialization function.
Should return OPAL_SUCCESS if everything goes ok. This function can be NULL in the module struct if the module doesn't need to do anything between the component query function and being invoked for MPI_Op operations.
anonymous enum |
Corresponding to the types that we can reduce over.
See MPI-1:4.9.2, p114-115 and MPI-2:4.15, p76-77
anonymous enum |
Fortran handles; must be [manually set to be] equivalent to the values in mpif.h.