OpenMPI  0.1.1
base.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3  * University Research and Technology
4  * Corporation. All rights reserved.
5  * Copyright (c) 2004-2006 The University of Tennessee and The University
6  * of Tennessee Research Foundation. All rights
7  * reserved.
8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9  * University of Stuttgart. All rights reserved.
10  * Copyright (c) 2004-2005 The Regents of the University of California.
11  * All rights reserved.
12  * Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
13  * Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
14  * $COPYRIGHT$
15  *
16  * Additional copyrights may follow
17  *
18  * $HEADER$
19  */
20 /**
21  * @file
22  *
23  * This framework is for the selection and assignment of "op" modules
24  * to intrinsic MPI_Op objects. This framework is not used for
25  * user-defined MPI_Op objects.
26  *
27  * The main idea is to let intrinsic MPI_Ops be able to utilize
28  * functions from multiple op modules, based on the (datatype,
29  * operation) tuple. Hence, it is possible for specialized hardware
30  * to be utilized for datatypes and operations that are supported.
31  */
32 
33 #ifndef MCA_OP_BASE_H
34 #define MCA_OP_BASE_H
35 
36 #include "ompi_config.h"
37 #include "opal/class/opal_list.h"
38 #include "opal/mca/mca.h"
39 #include "ompi/mca/op/op.h"
40 
41 BEGIN_C_DECLS
42 
44  opal_list_item_t super;
45  ompi_op_base_component_t *op_component;
46  ompi_op_base_module_t *op_module;
48 
49 
50 /**
51  * Open the op framework.
52  */
53 OMPI_DECLSPEC int ompi_op_base_open(void);
54 
55 /**
56  * Find all available op components.
57  */
58 OMPI_DECLSPEC int ompi_op_base_find_available(bool enable_progress_threads,
59  bool enable_mpi_threads);
60 
61 /**
62  * Select an available component for a new intrinsice MPI_Op (this
63  * function is *not* used for user-defined MPI_Ops!).
64  *
65  * @param op MPI_Op that the component will be selected for.
66  *
67  * @return OMPI_SUCCESS Upon success.
68  * @return OMPI_ERROR Upon failure.
69  *
70  * Note that the types of the parameters have "struct" in them (e.g.,
71  * ompi_op_t" vs. a plain "ompi_op_t") to avoid an include file loop.
72  * All similar types (e.g., "struct ompi_op_t *", "ompi_op_t *", and
73  * "MPI_Op") are all typedef'ed to be the same, so the fact that we
74  * use struct here in the prototype is ok.
75  *
76  * This function is invoked when a new MPI_Op is created and
77  * op components need to be selected for it.
78  */
79 int ompi_op_base_op_select(struct ompi_op_t *op);
80 
81 /**
82  * Finalize all op modules on a specific (intrinsic) MPI_Op.
83  *
84  * @param op The op that is being destroyed.
85  *
86  * @retval OMPI_SUCCESS Always.
87  *
88  * Note that the type of the parameter is only a "struct ompi_op_t"
89  * (vs. a plain "ompi_op_t") to avoid an include file loop. The types
90  * "struct ompi_op_t *", "ompi_op_t *", and "MPI_Op" are all
91  * typedef'ed to be the same, so the fact that we use struct here in
92  * the prototype is ok.
93  *
94  * This function is invoked near the beginning of the destruction of
95  * an op. It finalizes the op modules associated with the MPI_Op
96  * (e.g., allowing the component to clean up and free any resources
97  * allocated for that MPI_Op) by calling the destructor on each
98  * object.
99  */
100 OMPI_DECLSPEC int ompi_op_base_op_unselect(struct ompi_op_t *op);
101 
102 /**
103  * Close the op framework
104  */
105 OMPI_DECLSPEC int ompi_op_base_close(void);
106 
107 
108 /**
109  * Verbose output stream for this framework
110  */
111 OMPI_DECLSPEC extern int ompi_op_base_output;
112 
113 /**
114  * List of all opened components; created when the op framework is
115  * initialized and destroyed when we reduce the list to all available
116  * op components.
117  */
118 OMPI_DECLSPEC extern opal_list_t ompi_op_base_components_opened;
119 
120 /**
121  * Indicator as to whether the list of opened op components is valid
122  * or not.
123  */
124 OMPI_DECLSPEC extern bool ompi_op_base_components_opened_valid;
125 
126 /**
127  * List of all available components.
128  */
130 
131 /**
132  * Indicator as to whether the list of available op components is
133  * valid or not.
134  */
135 OMPI_DECLSPEC extern bool ompi_op_base_components_available_valid;
136 
137 END_C_DECLS
138 #endif /* MCA_OP_BASE_H */
Module struct.
Definition: op.h:355
Op component interface.
Definition: op.h:324
OMPI_DECLSPEC int ompi_op_base_find_available(bool enable_progress_threads, bool enable_mpi_threads)
Find all available op components.
Definition: op_base_find_available.c:69
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
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...
Definition: op_base_op_select.c:88
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 red...
Definition: op_base_open.c:50
OMPI_DECLSPEC int ompi_op_base_op_unselect(struct ompi_op_t *op)
Finalize all op modules on a specific (intrinsic) MPI_Op.
OMPI_DECLSPEC opal_list_t ompi_op_base_components_available
List of all available components.
Definition: op_base_find_available.c:44
Top-level interface for all MCA components.
Definition: opal_list.h:98
Definition: base.h:43
OMPI_DECLSPEC int ompi_op_base_close(void)
Close the op framework.
Definition: op_base_close.c:30
OMPI_DECLSPEC int ompi_op_base_open(void)
Open the op framework.
Definition: op_base_open.c:77
Definition: opal_list.h:147
OMPI_DECLSPEC bool ompi_op_base_components_available_valid
Indicator as to whether the list of available op components is valid or not.
Definition: op_base_find_available.c:43
OMPI_DECLSPEC bool ompi_op_base_components_opened_valid
Indicator as to whether the list of opened op components is valid or not.
Definition: op_base_open.c:49
Back-end type of MPI_Op.
Definition: op.h:100
MPI_Op back-end operation framework.
OMPI_DECLSPEC int ompi_op_base_output
Verbose output stream for this framework.
Definition: op_base_open.c:48