This source file includes following definitions.
- mca_bml_base_inited
- mca_bml_base_init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include "ompi_config.h"
25 #include "ompi/mca/bml/base/base.h"
26 #include "opal/mca/base/base.h"
27
28 #include "ompi/mca/mca.h"
29 #include "opal/runtime/opal.h"
30
31 mca_bml_base_module_t mca_bml = {
32 NULL,
33 NULL,
34 NULL,
35 NULL,
36 NULL,
37 NULL,
38 NULL,
39 NULL,
40 NULL,
41 NULL
42 };
43 mca_bml_base_component_t mca_bml_component = {{0}};
44
45 static bool init_called = false;
46
47 bool
48 mca_bml_base_inited(void)
49 {
50 return init_called;
51 }
52
53 int mca_bml_base_init( bool enable_progress_threads,
54 bool enable_mpi_threads) {
55 mca_bml_base_component_t *component = NULL, *best_component = NULL;
56 mca_bml_base_module_t *module = NULL, *best_module = NULL;
57 int priority = 0, best_priority = -1;
58 mca_base_component_list_item_t *cli = NULL;
59
60 if (init_called) {
61 return OPAL_SUCCESS;
62 }
63
64 init_called = true;
65
66 OPAL_LIST_FOREACH(cli, &ompi_bml_base_framework.framework_components, mca_base_component_list_item_t) {
67 component = (mca_bml_base_component_t*) cli->cli_component;
68 if(NULL == component->bml_init) {
69 opal_output_verbose( 10, ompi_bml_base_framework.framework_output,
70 "select: no init function; ignoring component %s",
71 component->bml_version.mca_component_name );
72 continue;
73 }
74 module = component->bml_init(&priority,
75 enable_progress_threads,
76 enable_mpi_threads);
77
78 if(NULL == module) {
79 continue;
80 }
81 if(priority > best_priority) {
82 best_priority = priority;
83 best_component = component;
84 best_module = module;
85 }
86
87 }
88 if(NULL == best_module) {
89 return OMPI_SUCCESS;
90 }
91
92 mca_bml_component = *best_component;
93 mca_bml = *best_module;
94 return mca_base_framework_components_close(&ompi_bml_base_framework,
95 (mca_base_component_t*) best_component);
96 }