This source file includes following definitions.
- orte_dt_compare_std_cntr
- orte_dt_compare_job
- orte_dt_compare_node
- orte_dt_compare_proc
- orte_dt_compare_app_context
- orte_dt_compare_exit_code
- orte_dt_compare_node_state
- orte_dt_compare_proc_state
- orte_dt_compare_job_state
- orte_dt_compare_map
- orte_dt_compare_tags
- orte_dt_compare_daemon_cmd
- orte_dt_compare_iof_tag
- orte_dt_compare_attr
- orte_dt_compare_sig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #include "orte_config.h"
21
22 #include <string.h>
23
24 #include <sys/types.h>
25
26 #include "orte/mca/grpcomm/grpcomm.h"
27
28 #include "orte/runtime/data_type_support/orte_dt_support.h"
29
30 int orte_dt_compare_std_cntr(orte_std_cntr_t *value1, orte_std_cntr_t *value2, opal_data_type_t type)
31 {
32 if (*value1 > *value2) return OPAL_VALUE1_GREATER;
33
34 if (*value2 > *value1) return OPAL_VALUE2_GREATER;
35
36 return OPAL_EQUAL;
37 }
38
39
40
41
42 int orte_dt_compare_job(orte_job_t *value1, orte_job_t *value2, opal_data_type_t type)
43 {
44
45 if (value1->jobid > value2->jobid) return OPAL_VALUE1_GREATER;
46 if (value1->jobid < value2->jobid) return OPAL_VALUE2_GREATER;
47
48 return OPAL_EQUAL;
49 }
50
51
52
53
54 int orte_dt_compare_node(orte_node_t *value1, orte_node_t *value2, opal_data_type_t type)
55 {
56 int test;
57
58
59 test = strcmp(value1->name, value2->name);
60 if (0 == test) return OPAL_EQUAL;
61 if (0 < test) return OPAL_VALUE2_GREATER;
62
63 return OPAL_VALUE1_GREATER;
64 }
65
66
67
68
69 int orte_dt_compare_proc(orte_proc_t *value1, orte_proc_t *value2, opal_data_type_t type)
70 {
71 orte_ns_cmp_bitmask_t mask;
72
73
74 mask = ORTE_NS_CMP_VPID;
75
76 return orte_util_compare_name_fields(mask, &value1->name, &value2->name);
77 }
78
79
80
81
82 int orte_dt_compare_app_context(orte_app_context_t *value1, orte_app_context_t *value2, opal_data_type_t type)
83 {
84 if (value1->idx > value2->idx) return OPAL_VALUE1_GREATER;
85 if (value2->idx > value1->idx) return OPAL_VALUE2_GREATER;
86
87 return OPAL_EQUAL;
88 }
89
90
91
92
93 int orte_dt_compare_exit_code(orte_exit_code_t *value1,
94 orte_exit_code_t *value2,
95 opal_data_type_t type)
96 {
97 if (*value1 > *value2) return OPAL_VALUE1_GREATER;
98
99 if (*value2 > *value1) return OPAL_VALUE2_GREATER;
100
101 return OPAL_EQUAL;
102 }
103
104
105
106
107 int orte_dt_compare_node_state(orte_node_state_t *value1,
108 orte_node_state_t *value2,
109 orte_node_state_t type)
110 {
111 if (*value1 > *value2) return OPAL_VALUE1_GREATER;
112
113 if (*value2 > *value1) return OPAL_VALUE2_GREATER;
114
115 return OPAL_EQUAL;
116 }
117
118
119
120
121 int orte_dt_compare_proc_state(orte_proc_state_t *value1,
122 orte_proc_state_t *value2,
123 orte_proc_state_t type)
124 {
125 if (*value1 > *value2) return OPAL_VALUE1_GREATER;
126
127 if (*value2 > *value1) return OPAL_VALUE2_GREATER;
128
129 return OPAL_EQUAL;
130 }
131
132
133
134
135 int orte_dt_compare_job_state(orte_job_state_t *value1,
136 orte_job_state_t *value2,
137 orte_job_state_t type)
138 {
139 if (*value1 > *value2) return OPAL_VALUE1_GREATER;
140
141 if (*value2 > *value1) return OPAL_VALUE2_GREATER;
142
143 return OPAL_EQUAL;
144 }
145
146
147
148
149 int orte_dt_compare_map(orte_job_map_t *value1, orte_job_map_t *value2, opal_data_type_t type)
150 {
151 return OPAL_EQUAL;
152 }
153
154
155
156
157 int orte_dt_compare_tags(orte_rml_tag_t *value1, orte_rml_tag_t *value2, opal_data_type_t type)
158 {
159 if (*value1 > *value2) {
160 return OPAL_VALUE1_GREATER;
161 } else if (*value1 < *value2) {
162 return OPAL_VALUE2_GREATER;
163 } else {
164 return OPAL_EQUAL;
165 }
166 }
167
168
169 int orte_dt_compare_daemon_cmd(orte_daemon_cmd_flag_t *value1, orte_daemon_cmd_flag_t *value2, opal_data_type_t type)
170 {
171 if (*value1 > *value2) return OPAL_VALUE1_GREATER;
172
173 if (*value2 > *value1) return OPAL_VALUE2_GREATER;
174
175 return OPAL_EQUAL;
176 }
177
178
179 int orte_dt_compare_iof_tag(orte_iof_tag_t *value1, orte_iof_tag_t *value2, opal_data_type_t type)
180 {
181 if (*value1 > *value2) return OPAL_VALUE1_GREATER;
182
183 if (*value2 > *value1) return OPAL_VALUE2_GREATER;
184
185 return OPAL_EQUAL;
186 }
187
188
189 int orte_dt_compare_attr(orte_attribute_t *value1, orte_attribute_t *value2, opal_data_type_t type)
190 {
191 if (value1->key > value2->key) {
192 return OPAL_VALUE1_GREATER;
193 }
194 if (value2->key > value1->key) {
195 return OPAL_VALUE2_GREATER;
196 }
197
198 return OPAL_EQUAL;
199 }
200
201
202 int orte_dt_compare_sig(orte_grpcomm_signature_t *value1, orte_grpcomm_signature_t *value2, opal_data_type_t type)
203 {
204 if (value1->sz > value2->sz) {
205 return OPAL_VALUE1_GREATER;
206 }
207 if (value2->sz > value1->sz) {
208 return OPAL_VALUE2_GREATER;
209 }
210
211 if (0 == memcmp(value1->signature, value2->signature, value1->sz*sizeof(orte_process_name_t))) {
212 return OPAL_EQUAL;
213 }
214 return OPAL_VALUE2_GREATER;
215 }