This source file includes following definitions.
- pmix_ptl_base_select
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #include <src/include/pmix_config.h>
21 #include <pmix_common.h>
22
23 #include <string.h>
24
25 #include "src/mca/mca.h"
26 #include "src/mca/base/base.h"
27 #include "src/util/error.h"
28 #include "src/util/show_help.h"
29
30 #include "src/mca/ptl/base/base.h"
31
32 static bool selected = false;
33
34
35
36 int pmix_ptl_base_select(void)
37 {
38 pmix_mca_base_component_list_item_t *cli = NULL;
39 pmix_ptl_base_component_t *component = NULL;
40 pmix_ptl_base_active_t *newactive, *active;
41 pmix_mca_base_module_t *mod;
42 int pri;
43 bool inserted;
44
45 if (selected) {
46
47 return PMIX_SUCCESS;
48 }
49 selected = true;
50
51
52 PMIX_LIST_FOREACH(cli, &pmix_ptl_base_framework.framework_components, pmix_mca_base_component_list_item_t) {
53 component = (pmix_ptl_base_component_t *) cli->cli_component;
54
55 pmix_output_verbose(5, pmix_ptl_base_framework.framework_output,
56 "mca:ptl:select: checking available component %s",
57 component->base.pmix_mca_component_name);
58
59
60 if (PMIX_SUCCESS != component->base.pmix_mca_query_component(&mod, &pri)) {
61 continue;
62 }
63
64
65 newactive = PMIX_NEW(pmix_ptl_base_active_t);
66 newactive->pri = component->priority;
67 newactive->component = component;
68 newactive->module = (pmix_ptl_module_t*)mod;
69
70
71 inserted = false;
72 PMIX_LIST_FOREACH(active, &pmix_ptl_globals.actives, pmix_ptl_base_active_t) {
73 if (newactive->pri > active->pri) {
74 pmix_list_insert_pos(&pmix_ptl_globals.actives,
75 &active->super, &newactive->super);
76 inserted = true;
77 break;
78 }
79 }
80 if (!inserted) {
81
82 pmix_list_append(&pmix_ptl_globals.actives, &newactive->super);
83 }
84 }
85
86
87 if (0 == pmix_list_get_size(&pmix_ptl_globals.actives)) {
88 pmix_show_help("help-pmix-runtime.txt", "no-plugins", true, "PTL");
89 return PMIX_ERR_SILENT;
90 }
91
92 if (4 < pmix_output_get_verbosity(pmix_ptl_base_framework.framework_output)) {
93 pmix_output(0, "Final PTL priorities");
94
95 PMIX_LIST_FOREACH(active, &pmix_ptl_globals.actives, pmix_ptl_base_active_t) {
96 pmix_output(0, "\tPTL: %s Priority: %d",
97 active->component->base.pmix_mca_component_name, active->pri);
98 }
99 }
100
101 return PMIX_SUCCESS;;
102 }