This source file includes following definitions.
- ompi_op_base_find_available
- init_query
- init_query_1_0_0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #include "ompi_config.h"
21
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25
26 #include "mpi.h"
27
28 #include "opal/class/opal_list.h"
29 #include "opal/util/output.h"
30 #include "ompi/mca/mca.h"
31 #include "opal/mca/base/base.h"
32 #include "opal/mca/base/mca_base_component_repository.h"
33
34
35 #include "ompi/constants.h"
36 #include "ompi/mca/op/op.h"
37 #include "ompi/mca/op/base/base.h"
38
39
40
41
42 static int init_query(const mca_base_component_t * ls,
43 bool enable_progress_threads,
44 bool enable_mpi_threads);
45 static int init_query_1_0_0(const mca_base_component_t * ls,
46 bool enable_progress_threads,
47 bool enable_mpi_threads);
48
49
50
51
52
53
54
55
56
57
58
59 int ompi_op_base_find_available(bool enable_progress_threads,
60 bool enable_mpi_threads)
61 {
62 mca_base_component_list_item_t *cli, *next;
63
64
65
66
67 OPAL_LIST_FOREACH_SAFE(cli, next, &ompi_op_base_framework.framework_components, mca_base_component_list_item_t) {
68 const mca_base_component_t *component = cli->cli_component;
69
70
71
72
73 if (OMPI_SUCCESS != init_query(component,
74 enable_progress_threads,
75 enable_mpi_threads)) {
76
77
78 opal_list_remove_item(&ompi_op_base_framework.framework_components, &cli->super);
79 mca_base_component_close(component, ompi_op_base_framework.framework_output);
80 OBJ_RELEASE(cli);
81 }
82 }
83
84
85
86
87 return OMPI_SUCCESS;
88 }
89
90
91
92
93
94
95 static int init_query(const mca_base_component_t * c,
96 bool enable_progress_threads, bool enable_mpi_threads)
97 {
98 int ret;
99
100 opal_output_verbose(10, ompi_op_base_framework.framework_output,
101 "op:find_available: querying op component %s",
102 c->mca_component_name);
103
104
105
106
107 if (1 == c->mca_type_major_version &&
108 0 == c->mca_type_minor_version &&
109 0 == c->mca_type_release_version) {
110 ret = init_query_1_0_0(c, enable_progress_threads,
111 enable_mpi_threads);
112 } else {
113
114
115 opal_output_verbose(10, ompi_op_base_framework.framework_output,
116 "op:find_available: unrecognized op API version (%d.%d.%d, ignored)",
117 c->mca_type_major_version,
118 c->mca_type_minor_version,
119 c->mca_type_release_version);
120 return OMPI_ERROR;
121 }
122
123
124
125 if (OMPI_SUCCESS != ret) {
126 opal_output_verbose(10, ompi_op_base_framework.framework_output,
127 "op:find_available: op component %s is not available",
128 c->mca_component_name);
129 } else {
130 opal_output_verbose(10, ompi_op_base_framework.framework_output,
131 "op:find_available: op component %s is available",
132 c->mca_component_name);
133 }
134
135
136
137 return ret;
138 }
139
140
141
142
143
144 static int init_query_1_0_0(const mca_base_component_t * component,
145 bool enable_progress_threads,
146 bool enable_mpi_threads)
147 {
148 ompi_op_base_component_1_0_0_t *op =
149 (ompi_op_base_component_1_0_0_t *) component;
150
151 return op->opc_init_query(enable_progress_threads,
152 enable_mpi_threads);
153 }