OpenMPI
0.1.1
|
Collective Communication Interface. More...
#include "ompi_config.h"
#include "mpi.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/crs/crs.h"
#include "opal/mca/crs/base/base.h"
Go to the source code of this file.
Data Structures | |
struct | mca_coll_base_component_2_0_0_t |
Collective component interface. More... | |
struct | mca_coll_base_module_2_0_0_t |
Collective module interface. More... | |
struct | mca_coll_base_comm_coll_t |
Collectives communicator cache structure. More... | |
Macros | |
#define | MCA_COLL_BASE_VERSION_2_0_0 |
Typedefs | |
typedef int(* | mca_coll_base_component_init_query_fn_t )(bool enable_progress_threads, bool enable_mpi_threads) |
Collective component initialization. More... | |
typedef struct mca_coll_base_module_2_0_0_t *(* | mca_coll_base_component_comm_query_2_0_0_fn_t )(struct ompi_communicator_t *comm, int *priority) |
Query whether a component is available for the given communicator. More... | |
typedef int(* | mca_coll_base_module_enable_1_1_0_fn_t )(struct mca_coll_base_module_2_0_0_t *module, struct ompi_communicator_t *comm) |
Enable module for collective communication. More... | |
typedef int(* | mca_coll_base_module_allgather_fn_t )(void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_allgatherv_fn_t )(void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int *rcounts, int *disps, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_allreduce_fn_t )(void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_alltoall_fn_t )(void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_alltoallv_fn_t )(void *sbuf, int *scounts, int *sdisps, struct ompi_datatype_t *sdtype, void *rbuf, int *rcounts, int *rdisps, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_alltoallw_fn_t )(void *sbuf, int *scounts, int *sdisps, struct ompi_datatype_t **sdtypes, void *rbuf, int *rcounts, int *rdisps, struct ompi_datatype_t **rdtypes, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_barrier_fn_t )(struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_bcast_fn_t )(void *buff, int count, struct ompi_datatype_t *datatype, int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_exscan_fn_t )(void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_gather_fn_t )(void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_gatherv_fn_t )(void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int *rcounts, int *disps, struct ompi_datatype_t *rdtype, int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_reduce_fn_t )(void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_reduce_scatter_fn_t )(void *sbuf, void *rbuf, int *rcounts, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_scan_fn_t )(void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype, struct ompi_op_t *op, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_scatter_fn_t )(void *sbuf, int scount, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_scatterv_fn_t )(void *sbuf, int *scounts, int *disps, struct ompi_datatype_t *sdtype, void *rbuf, int rcount, struct ompi_datatype_t *rdtype, int root, struct ompi_communicator_t *comm, struct mca_coll_base_module_2_0_0_t *module) |
typedef int(* | mca_coll_base_module_ft_event_fn_t )(int state) |
Fault Tolerance Awareness function. More... | |
typedef struct mca_coll_base_component_2_0_0_t | mca_coll_base_component_2_0_0_t |
typedef struct mca_coll_base_component_2_0_0_t | mca_coll_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 struct mca_coll_base_module_2_0_0_t | mca_coll_base_module_2_0_0_t |
typedef struct mca_coll_base_module_2_0_0_t | mca_coll_base_module_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 struct mca_coll_base_comm_coll_t | mca_coll_base_comm_coll_t |
Functions | |
OMPI_DECLSPEC | OBJ_CLASS_DECLARATION (mca_coll_base_module_t) |
Collective Communication Interface.
Interface for implementing the collective communication interface of MPI. The MPI interface provides error checking and error handler invocation, but the collective components provide all other functionality.
Component selection is done per commuicator, at Communicator construction time. mca_coll_base_comm_select() is used to create the list of components available to the compoenent collm_comm_query function, instantiating a module for each component that i usable, and sets the module collective function pointers. mca_coll_base_comm_select() then loops through the list of available components (via the instantiated module), and uses the module's coll_module_enable() function to enable the modules, and if successful, sets the communicator collective functions to the those supplied by the given module, keeping track of which module it is associated with.
The module destructors are called for each module used by the communicator, at communicator desctruction time.
This can result in up to N different components being used for a single communicator, one per needed collective function.
The interface is the same for inter- or intra-communicators, and components should be able to handle either style of communicator during initialization (although handling may include indicating the component is not available).
#define MCA_COLL_BASE_VERSION_2_0_0 |
typedef struct mca_coll_base_module_2_0_0_t*(* mca_coll_base_component_comm_query_2_0_0_fn_t)(struct ompi_communicator_t *comm, int *priority) |
Query whether a component is available for the given communicator.
Query whether the component is available for the given communicator. If the component is available, an object should be allocated and returned (with refcount at 1). The module will not be used for collective 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] | comm | The communicator being created |
[out] | priority | Priority setting for component on this communicator |
typedef int(* mca_coll_base_component_init_query_fn_t)(bool enable_progress_threads, bool enable_mpi_threads) |
Collective component initialization.
Initialize the given collective 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 mca_coll_base_component_2_0_0_t mca_coll_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 int(* mca_coll_base_module_enable_1_1_0_fn_t)(struct mca_coll_base_module_2_0_0_t *module, struct ompi_communicator_t *comm) |
Enable module for collective communication.
Enable the module for collective commuication. Modules are enabled in order from lowest to highest priority. At each component, collective functions with priority higher than the existing function are copied into the communicator's function table and the module's reference count is incremented. Replaced functions have their module's reference count decremented, so a component will go out of scope when it has been examined and is no longer used in any collective functions.
Because the function list is built on increasing priority, a component that needs functions from a lower priority component (say, a multi-cast barrier that might need a point-to-point barrier for resource exhaustion issues) can keep the function pointer and module pointer and increase the reference count of the module and use the module during execution.
When a module is not used for any interface functions and no higher-priority module has increased its refcount, it will have it's destructor triggered and the module will be destroyed.
in/out] | module Module created during comm_query() | |
[in] | comm | Communicator being created |
typedef int(* mca_coll_base_module_ft_event_fn_t)(int state) |
Fault Tolerance Awareness function.
Fault tolerance function – called when a process / job state change is noticed.
[in] | state | State change that triggered the function |
OMPI_SUCCESS | Component successfully selected |
OMPI_ERROR | An unspecified error occurred |
typedef struct mca_coll_base_module_2_0_0_t mca_coll_base_module_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.