This source file includes following definitions.
- pmix_preg_base_generate_node_regex
- pmix_preg_base_generate_ppn
- pmix_preg_base_parse_nodes
- pmix_preg_base_parse_procs
- pmix_preg_base_resolve_peers
- pmix_preg_base_resolve_nodes
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
22 #include <stdio.h>
23 #ifdef HAVE_UNISTD_H
24 #include <unistd.h>
25 #endif
26
27 #include "src/util/argv.h"
28 #include "src/util/error.h"
29 #include "src/include/pmix_globals.h"
30
31 #include "src/mca/preg/base/base.h"
32
33 pmix_status_t pmix_preg_base_generate_node_regex(const char *input,
34 char **regex)
35 {
36 pmix_preg_base_active_module_t *active;
37
38 PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) {
39 if (NULL != active->module->generate_node_regex) {
40 if (PMIX_SUCCESS == active->module->generate_node_regex(input, regex)) {
41 return PMIX_SUCCESS;
42 }
43 }
44 }
45
46 return PMIX_ERR_NOT_SUPPORTED;
47 }
48
49 pmix_status_t pmix_preg_base_generate_ppn(const char *input,
50 char **ppn)
51 {
52 pmix_preg_base_active_module_t *active;
53
54 PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) {
55 if (NULL != active->module->generate_ppn) {
56 if (PMIX_SUCCESS == active->module->generate_ppn(input, ppn)) {
57 return PMIX_SUCCESS;
58 }
59 }
60 }
61
62 return PMIX_ERR_NOT_SUPPORTED;
63 }
64
65 pmix_status_t pmix_preg_base_parse_nodes(const char *regexp,
66 char ***names)
67 {
68 pmix_preg_base_active_module_t *active;
69
70 PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) {
71 if (NULL != active->module->parse_nodes) {
72 if (PMIX_SUCCESS == active->module->parse_nodes(regexp, names)) {
73 return PMIX_SUCCESS;
74 }
75 }
76 }
77
78 return PMIX_ERR_NOT_SUPPORTED;
79 }
80
81 pmix_status_t pmix_preg_base_parse_procs(const char *regexp,
82 char ***procs)
83 {
84 pmix_preg_base_active_module_t *active;
85
86 PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) {
87 if (NULL != active->module->parse_procs) {
88 if (PMIX_SUCCESS == active->module->parse_procs(regexp, procs)) {
89 return PMIX_SUCCESS;
90 }
91 }
92 }
93
94 return PMIX_ERR_NOT_SUPPORTED;
95 }
96
97 pmix_status_t pmix_preg_base_resolve_peers(const char *nodename,
98 const char *nspace,
99 pmix_proc_t **procs, size_t *nprocs)
100 {
101 pmix_preg_base_active_module_t *active;
102
103 PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) {
104 if (NULL != active->module->resolve_peers) {
105 if (PMIX_SUCCESS == active->module->resolve_peers(nodename, nspace, procs, nprocs)) {
106 return PMIX_SUCCESS;
107 }
108 }
109 }
110
111 return PMIX_ERR_NOT_SUPPORTED;
112 }
113
114 pmix_status_t pmix_preg_base_resolve_nodes(const char *nspace,
115 char **nodelist)
116 {
117 pmix_preg_base_active_module_t *active;
118
119 PMIX_LIST_FOREACH(active, &pmix_preg_globals.actives, pmix_preg_base_active_module_t) {
120 if (NULL != active->module->resolve_nodes) {
121 if (PMIX_SUCCESS == active->module->resolve_nodes(nspace, nodelist)) {
122 return PMIX_SUCCESS;
123 }
124 }
125 }
126
127 return PMIX_ERR_NOT_SUPPORTED;
128 }