|
12 | 12 | * All rights reserved.
|
13 | 13 | * Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
14 | 14 | * reserved.
|
15 |
| - * Copyright (c) 2015-2016 Intel, Inc. All rights reserved. |
| 15 | + * Copyright (c) 2015-2017 Intel, Inc. All rights reserved. |
16 | 16 | * $COPYRIGHT$
|
17 | 17 | *
|
18 | 18 | * Additional copyrights may follow
|
@@ -117,12 +117,57 @@ void orte_rml_base_post_recv(int sd, short args, void *cbdata)
|
117 | 117 | OBJ_RELEASE(req);
|
118 | 118 | }
|
119 | 119 |
|
120 |
| -void orte_rml_base_complete_recv_msg (orte_rml_recv_t **recv_msg) |
| 120 | +static void msg_match_recv(orte_rml_posted_recv_t *rcv, bool get_all) |
| 121 | +{ |
| 122 | + opal_list_item_t *item, *next; |
| 123 | + orte_rml_recv_t *msg; |
| 124 | + orte_ns_cmp_bitmask_t mask = ORTE_NS_CMP_ALL | ORTE_NS_CMP_WILD; |
| 125 | + |
| 126 | + /* scan thru the list of unmatched recvd messages and |
| 127 | + * see if any matches this spec - if so, push the first |
| 128 | + * into the recvd msg queue and look no further |
| 129 | + */ |
| 130 | + item = opal_list_get_first(&orte_rml_base.unmatched_msgs); |
| 131 | + while (item != opal_list_get_end(&orte_rml_base.unmatched_msgs)) { |
| 132 | + next = opal_list_get_next(item); |
| 133 | + msg = (orte_rml_recv_t*)item; |
| 134 | + opal_output_verbose(5, orte_rml_base_framework.framework_output, |
| 135 | + "%s checking recv for %s against unmatched msg from %s", |
| 136 | + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), |
| 137 | + ORTE_NAME_PRINT(&rcv->peer), |
| 138 | + ORTE_NAME_PRINT(&msg->sender)); |
| 139 | + |
| 140 | + /* since names could include wildcards, must use |
| 141 | + * the more generalized comparison function |
| 142 | + */ |
| 143 | + if (OPAL_EQUAL == orte_util_compare_name_fields(mask, &msg->sender, &rcv->peer) && |
| 144 | + msg->tag == rcv->tag) { |
| 145 | + ORTE_RML_ACTIVATE_MESSAGE(msg); |
| 146 | + opal_list_remove_item(&orte_rml_base.unmatched_msgs, item); |
| 147 | + if (!get_all) { |
| 148 | + break; |
| 149 | + } |
| 150 | + } |
| 151 | + item = next; |
| 152 | + } |
| 153 | +} |
| 154 | + |
| 155 | +void orte_rml_base_process_msg(int fd, short flags, void *cbdata) |
121 | 156 | {
|
| 157 | + orte_rml_recv_t *msg = (orte_rml_recv_t*)cbdata; |
122 | 158 | orte_rml_posted_recv_t *post;
|
123 | 159 | orte_ns_cmp_bitmask_t mask = ORTE_NS_CMP_ALL | ORTE_NS_CMP_WILD;
|
124 | 160 | opal_buffer_t buf;
|
125 |
| - orte_rml_recv_t *msg = *recv_msg; |
| 161 | + |
| 162 | + OPAL_OUTPUT_VERBOSE((5, orte_rml_base_framework.framework_output, |
| 163 | + "%s message received from %s for tag %d", |
| 164 | + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), |
| 165 | + ORTE_NAME_PRINT(&msg->sender), |
| 166 | + msg->tag)); |
| 167 | + |
| 168 | + OPAL_TIMING_EVENT((&tm_rml,"from %s %d bytes", |
| 169 | + ORTE_NAME_PRINT(&msg->sender), msg->iov.iov_len)); |
| 170 | + |
126 | 171 | /* see if we have a waiting recv for this message */
|
127 | 172 | OPAL_LIST_FOREACH(post, &orte_rml_base.posted_recvs, orte_rml_posted_recv_t) {
|
128 | 173 | /* since names could include wildcards, must use
|
@@ -184,52 +229,3 @@ void orte_rml_base_complete_recv_msg (orte_rml_recv_t **recv_msg)
|
184 | 229 | msg->tag));
|
185 | 230 | opal_list_append(&orte_rml_base.unmatched_msgs, &msg->super);
|
186 | 231 | }
|
187 |
| - |
188 |
| -static void msg_match_recv(orte_rml_posted_recv_t *rcv, bool get_all) |
189 |
| -{ |
190 |
| - opal_list_item_t *item, *next; |
191 |
| - orte_rml_recv_t *msg; |
192 |
| - orte_ns_cmp_bitmask_t mask = ORTE_NS_CMP_ALL | ORTE_NS_CMP_WILD; |
193 |
| - |
194 |
| - /* scan thru the list of unmatched recvd messages and |
195 |
| - * see if any matches this spec - if so, push the first |
196 |
| - * into the recvd msg queue and look no further |
197 |
| - */ |
198 |
| - item = opal_list_get_first(&orte_rml_base.unmatched_msgs); |
199 |
| - while (item != opal_list_get_end(&orte_rml_base.unmatched_msgs)) { |
200 |
| - next = opal_list_get_next(item); |
201 |
| - msg = (orte_rml_recv_t*)item; |
202 |
| - opal_output_verbose(5, orte_rml_base_framework.framework_output, |
203 |
| - "%s checking recv for %s against unmatched msg from %s", |
204 |
| - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), |
205 |
| - ORTE_NAME_PRINT(&rcv->peer), |
206 |
| - ORTE_NAME_PRINT(&msg->sender)); |
207 |
| - |
208 |
| - /* since names could include wildcards, must use |
209 |
| - * the more generalized comparison function |
210 |
| - */ |
211 |
| - if (OPAL_EQUAL == orte_util_compare_name_fields(mask, &msg->sender, &rcv->peer) && |
212 |
| - msg->tag == rcv->tag) { |
213 |
| - ORTE_RML_ACTIVATE_MESSAGE(msg); |
214 |
| - opal_list_remove_item(&orte_rml_base.unmatched_msgs, item); |
215 |
| - if (!get_all) { |
216 |
| - break; |
217 |
| - } |
218 |
| - } |
219 |
| - item = next; |
220 |
| - } |
221 |
| -} |
222 |
| - |
223 |
| -void orte_rml_base_process_msg(int fd, short flags, void *cbdata) |
224 |
| -{ |
225 |
| - orte_rml_recv_t *msg = (orte_rml_recv_t*)cbdata; |
226 |
| - OPAL_OUTPUT_VERBOSE((5, orte_rml_base_framework.framework_output, |
227 |
| - "%s message received from %s for tag %d", |
228 |
| - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), |
229 |
| - ORTE_NAME_PRINT(&msg->sender), |
230 |
| - msg->tag)); |
231 |
| - |
232 |
| - OPAL_TIMING_EVENT((&tm_rml,"from %s %d bytes", |
233 |
| - ORTE_NAME_PRINT(&msg->sender), msg->iov.iov_len)); |
234 |
| - orte_rml_base_complete_recv_msg(&msg); |
235 |
| -} |
0 commit comments