OpenMPI  0.1.1
base.h File Reference

This framework is for the selection and assignment of "op" modules to intrinsic MPI_Op objects. More...

#include "ompi_config.h"
#include "opal/class/opal_list.h"
#include "opal/mca/mca.h"
#include "ompi/mca/op/op.h"

Go to the source code of this file.

Data Structures

struct  ompi_op_base_selected_module_t
 

Typedefs

typedef BEGIN_C_DECLS struct
ompi_op_base_selected_module_t 
ompi_op_base_selected_module_t
 

Functions

OMPI_DECLSPEC int ompi_op_base_open (void)
 Open the op framework.
 
OMPI_DECLSPEC int ompi_op_base_find_available (bool enable_progress_threads, bool enable_mpi_threads)
 Find all available op components.
 
int ompi_op_base_op_select (struct ompi_op_t *op)
 Select an available component for a new intrinsice MPI_Op (this function is not used for user-defined MPI_Ops!). More...
 
OMPI_DECLSPEC int ompi_op_base_op_unselect (struct ompi_op_t *op)
 Finalize all op modules on a specific (intrinsic) MPI_Op. More...
 
OMPI_DECLSPEC int ompi_op_base_close (void)
 Close the op framework.
 

Variables

OMPI_DECLSPEC int ompi_op_base_output
 Verbose output stream for this framework.
 
OMPI_DECLSPEC opal_list_t ompi_op_base_components_opened
 List of all opened components; created when the op framework is initialized and destroyed when we reduce the list to all available op components.
 
OMPI_DECLSPEC bool ompi_op_base_components_opened_valid
 Indicator as to whether the list of opened op components is valid or not.
 
OMPI_DECLSPEC opal_list_t ompi_op_base_components_available
 List of all available components.
 
OMPI_DECLSPEC bool ompi_op_base_components_available_valid
 Indicator as to whether the list of available op components is valid or not.
 

Detailed Description

This framework is for the selection and assignment of "op" modules to intrinsic MPI_Op objects.

This framework is not used for user-defined MPI_Op objects.

The main idea is to let intrinsic MPI_Ops be able to utilize functions from multiple op modules, based on the (datatype, operation) tuple. Hence, it is possible for specialized hardware to be utilized for datatypes and operations that are supported.

Function Documentation

int ompi_op_base_op_select ( struct ompi_op_t op)

Select an available component for a new intrinsice MPI_Op (this function is not used for user-defined MPI_Ops!).

Parameters
opMPI_Op that the component will be selected for.
Returns
OMPI_SUCCESS Upon success.
OMPI_ERROR Upon failure.

Note that the types of the parameters have "struct" in them (e.g., ompi_op_t" vs. a plain "ompi_op_t") to avoid an include file loop. All similar types (e.g., "struct ompi_op_t *", "ompi_op_t *", and "MPI_Op") are all typedef'ed to be the same, so the fact that we use struct here in the prototype is ok.

This function is invoked when a new MPI_Op is created and op components need to be selected for it.

References ompi_op_t::intrinsic, ompi_op_t::o_3buff_intrinsic, ompi_op_t::o_f_to_c_index, ompi_op_t::o_func, ompi_op_t::o_name, OBJ_RELEASE, OBJ_RETAIN, ompi_op_base_components_available, ompi_op_base_output, OMPI_OP_BASE_TYPE_MAX, opal_list_remove_first(), opal_output_verbose(), ompi_op_base_module_1_0_0_t::opm_enable, and ompi_op_base_module_1_0_0_t::opm_fns.

OMPI_DECLSPEC int ompi_op_base_op_unselect ( struct ompi_op_t op)

Finalize all op modules on a specific (intrinsic) MPI_Op.

Parameters
opThe op that is being destroyed.
Return values
OMPI_SUCCESSAlways.

Note that the type of the parameter is only a "struct ompi_op_t" (vs. a plain "ompi_op_t") to avoid an include file loop. The types "struct ompi_op_t *", "ompi_op_t *", and "MPI_Op" are all typedef'ed to be the same, so the fact that we use struct here in the prototype is ok.

This function is invoked near the beginning of the destruction of an op. It finalizes the op modules associated with the MPI_Op (e.g., allowing the component to clean up and free any resources allocated for that MPI_Op) by calling the destructor on each object.