This source file includes following definitions.
- mca_sharedfp_base_find_available
- init_query
- init_query_2_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
25 #include "mpi.h"
26 #include "ompi/constants.h"
27 #include "opal/class/opal_list.h"
28 #include "opal/util/output.h"
29 #include "ompi/mca/mca.h"
30 #include "opal/mca/base/base.h"
31 #include "opal/mca/base/mca_base_component_repository.h"
32 #include "ompi/mca/sharedfp/sharedfp.h"
33 #include "ompi/mca/sharedfp/base/base.h"
34
35 static int init_query(const mca_base_component_t *m,
36 mca_base_component_list_item_t *entry,
37 bool enable_progress_threads,
38 bool enable_mpi_threads);
39 static int init_query_2_0_0(const mca_base_component_t *component,
40 mca_base_component_list_item_t *entry,
41 bool enable_progress_threads,
42 bool enable_mpi_threads);
43
44 int mca_sharedfp_base_find_available(bool enable_progress_threads,
45 bool enable_mpi_threads)
46 {
47 opal_list_item_t *item, *next;
48 mca_base_component_list_item_t *cli;
49
50
51
52
53
54 item = opal_list_get_first(&ompi_sharedfp_base_framework.framework_components);
55 while (item != opal_list_get_end(&ompi_sharedfp_base_framework.framework_components)) {
56 next = opal_list_get_next(item);
57 cli = (mca_base_component_list_item_t*)item;
58
59
60
61
62 if (OMPI_SUCCESS != init_query(cli->cli_component, cli,
63 enable_progress_threads,
64 enable_mpi_threads)) {
65
66
67
68 mca_base_component_repository_release(cli->cli_component);
69 OBJ_RELEASE(item);
70 }
71 item = next;
72 }
73
74
75 if (0 == opal_list_get_size(&ompi_sharedfp_base_framework.framework_components)) {
76 opal_output_verbose (10, ompi_sharedfp_base_framework.framework_output,
77 "sharedfp:find_available: no sharedfp components available!");
78 return OMPI_ERROR;
79 }
80
81
82 return OMPI_SUCCESS;
83 }
84
85
86 static int init_query(const mca_base_component_t *m,
87 mca_base_component_list_item_t *entry,
88 bool enable_progress_threads,
89 bool enable_mpi_threads)
90 {
91 int ret;
92
93 opal_output_verbose(10, ompi_sharedfp_base_framework.framework_output,
94 "sharedfp:find_available: querying sharedfp component %s",
95 m->mca_component_name);
96
97
98 if (2 == m->mca_type_major_version &&
99 0 == m->mca_type_minor_version &&
100 0 == m->mca_type_release_version) {
101 ret = init_query_2_0_0(m, entry, enable_progress_threads,
102 enable_mpi_threads);
103 } else {
104
105 opal_output_verbose(10, ompi_sharedfp_base_framework.framework_output,
106 "sharedfp:find_available:unrecognised sharedfp API version (%d.%d.%d)",
107 m->mca_type_major_version,
108 m->mca_type_minor_version,
109 m->mca_type_release_version);
110 return OMPI_ERROR;
111 }
112
113
114 if (OMPI_SUCCESS != ret) {
115 opal_output_verbose(10, ompi_sharedfp_base_framework.framework_output,
116 "sharedfp:find_available sharedfp component %s is not available",
117 m->mca_component_name);
118 if (NULL != m->mca_close_component) {
119 m->mca_close_component();
120 }
121 } else {
122 opal_output_verbose(10, ompi_sharedfp_base_framework.framework_output,
123 "sharedfp:find_avalable: sharedfp component %s is available",
124 m->mca_component_name);
125
126 }
127
128 return ret;
129 }
130
131
132 static int init_query_2_0_0(const mca_base_component_t *component,
133 mca_base_component_list_item_t *entry,
134 bool enable_progress_threads,
135 bool enable_mpi_threads)
136 {
137 mca_sharedfp_base_component_2_0_0_t *sharedfp =
138 (mca_sharedfp_base_component_2_0_0_t *) component;
139
140 return sharedfp->sharedfpm_init_query(enable_progress_threads,
141 enable_mpi_threads);
142 }