From 106beff7441db5b28108f29023eb0589b7d3511b Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Wed, 1 Aug 2007 18:59:37 +0000 Subject: [PATCH] Ahem. Apparently we should be checking for ORTE_EQUAL upon return from orte_ns.compare_fields(), not 0 (yes, they're the same [today], but it is much better to check for symbolic names...). This commit was SVN r15731. --- orte/mca/iof/base/iof_base_endpoint.c | 8 +++--- orte/mca/iof/svc/iof_svc_proxy.c | 2 +- orte/mca/iof/svc/iof_svc_pub.c | 12 ++++---- orte/mca/iof/svc/iof_svc_sub.c | 40 ++++++++++++++------------- 4 files changed, 32 insertions(+), 30 deletions(-) diff --git a/orte/mca/iof/base/iof_base_endpoint.c b/orte/mca/iof/base/iof_base_endpoint.c index 7a19bca1e3..3ac20db462 100644 --- a/orte/mca/iof/base/iof_base_endpoint.c +++ b/orte/mca/iof/base/iof_base_endpoint.c @@ -348,8 +348,8 @@ static orte_iof_base_endpoint_t* orte_iof_base_endpoint_lookup( item != opal_list_get_end(&orte_iof_base.iof_endpoints); item = opal_list_get_next(item)) { orte_iof_base_endpoint_t* endpoint = (orte_iof_base_endpoint_t*)item; - if(orte_ns.compare_fields(ORTE_NS_CMP_ALL,proc,&endpoint->ep_origin) == 0 && - endpoint->ep_tag == tag && endpoint->ep_mode == mode) { + if (ORTE_EQUAL == orte_ns.compare_fields(ORTE_NS_CMP_ALL,proc,&endpoint->ep_origin) && + endpoint->ep_tag == tag && endpoint->ep_mode == mode) { OBJ_RETAIN(endpoint); return endpoint; } @@ -494,7 +494,7 @@ int orte_iof_base_endpoint_delete( while(item != opal_list_get_end(&orte_iof_base.iof_endpoints)) { opal_list_item_t* next = opal_list_get_next(item); orte_iof_base_endpoint_t* endpoint = (orte_iof_base_endpoint_t*)item; - if (orte_ns.compare_fields(mask,proc,&endpoint->ep_origin) == 0) { + if (ORTE_EQUAL == orte_ns.compare_fields(mask,proc,&endpoint->ep_origin)) { if (endpoint->ep_tag == tag || ORTE_IOF_ANY == endpoint->ep_tag || ORTE_IOF_ANY == tag) { @@ -568,7 +568,7 @@ orte_iof_base_endpoint_t* orte_iof_base_endpoint_match( item != opal_list_get_end(&orte_iof_base.iof_endpoints); item = opal_list_get_next(item)) { orte_iof_base_endpoint_t* endpoint = (orte_iof_base_endpoint_t*)item; - if(orte_ns.compare_fields(target_mask,target_name,&endpoint->ep_origin) == 0) { + if(ORTE_EQUAL == orte_ns.compare_fields(target_mask,target_name,&endpoint->ep_origin)) { if(endpoint->ep_tag == target_tag || endpoint->ep_tag == ORTE_IOF_ANY || target_tag == ORTE_IOF_ANY) { diff --git a/orte/mca/iof/svc/iof_svc_proxy.c b/orte/mca/iof/svc/iof_svc_proxy.c index e9186c2782..afae1df672 100644 --- a/orte/mca/iof/svc/iof_svc_proxy.c +++ b/orte/mca/iof/svc/iof_svc_proxy.c @@ -173,7 +173,7 @@ static void orte_iof_svc_proxy_msg( /* if the subscription origin doesn't match the message's origin, skip this subscription */ - if(0 == orte_ns.compare_fields(sub->origin_mask,&sub->origin_name,&hdr->msg_origin)) { + if (ORTE_EQUAL == orte_ns.compare_fields(sub->origin_mask,&sub->origin_name,&hdr->msg_origin)) { opal_output(orte_iof_base.iof_output, "sub MATCH: origin %s, msg origin %s, msg proxy %s orte_iof_svc_proxy_msg: tag %d sequence %d, len %d", ORTE_NAME_PRINT(&sub->origin_name), ORTE_NAME_PRINT(&hdr->msg_origin), diff --git a/orte/mca/iof/svc/iof_svc_pub.c b/orte/mca/iof/svc/iof_svc_pub.c index 62c6ac8020..09ff2aabbc 100644 --- a/orte/mca/iof/svc/iof_svc_pub.c +++ b/orte/mca/iof/svc/iof_svc_pub.c @@ -36,8 +36,8 @@ int orte_iof_svc_pub_create( item != opal_list_get_end(&mca_iof_svc_component.svc_published); item = opal_list_get_next(item)) { pub = (orte_iof_svc_pub_t*)item; - if(orte_ns.compare_fields(pub_mask,pub_name,&pub->pub_name) == 0 && - orte_ns.compare_fields(ORTE_NS_CMP_ALL,pub_proxy,&pub->pub_proxy) == 0 && + if(ORTE_EQUAL == orte_ns.compare_fields(pub_mask,pub_name,&pub->pub_name) && + ORTE_EQUAL == orte_ns.compare_fields(ORTE_NS_CMP_ALL,pub_proxy,&pub->pub_proxy) && pub_tag == pub->pub_tag) { OPAL_THREAD_UNLOCK(&mca_iof_svc_component.svc_lock); return ORTE_SUCCESS; @@ -89,8 +89,8 @@ orte_iof_svc_pub_t* orte_iof_svc_pub_lookup( item != opal_list_get_end(&mca_iof_svc_component.svc_published); item = opal_list_get_next(item)) { orte_iof_svc_pub_t* pub = (orte_iof_svc_pub_t*)item; - if (orte_ns.compare_fields(ORTE_NS_CMP_ALL, &pub->pub_name,pub_name) == 0 && - orte_ns.compare_fields(ORTE_NS_CMP_ALL, &pub->pub_proxy,pub_proxy) == 0 && + if (ORTE_EQUAL == orte_ns.compare_fields(ORTE_NS_CMP_ALL, &pub->pub_name,pub_name) && + ORTE_EQUAL == orte_ns.compare_fields(ORTE_NS_CMP_ALL, &pub->pub_proxy,pub_proxy) && pub->pub_mask == pub_mask && pub->pub_tag == pub_tag) { return pub; @@ -150,8 +150,8 @@ void orte_iof_svc_pub_delete_all( opal_list_item_t* p_next = opal_list_get_next(p_item); orte_iof_svc_pub_t* pub = (orte_iof_svc_pub_t*)p_item; - if (orte_ns.compare_fields(ORTE_NS_CMP_ALL, &pub->pub_name,name) == 0 || - orte_ns.compare_fields(ORTE_NS_CMP_ALL, &pub->pub_proxy,name) == 0) { + if (ORTE_EQUAL == orte_ns.compare_fields(ORTE_NS_CMP_ALL, &pub->pub_name,name) || + ORTE_EQUAL == orte_ns.compare_fields(ORTE_NS_CMP_ALL, &pub->pub_proxy,name)) { opal_list_item_t* s_item; for(s_item = opal_list_get_first(&mca_iof_svc_component.svc_subscribed); diff --git a/orte/mca/iof/svc/iof_svc_sub.c b/orte/mca/iof/svc/iof_svc_sub.c index 803015aee7..1a486ead77 100644 --- a/orte/mca/iof/svc/iof_svc_sub.c +++ b/orte/mca/iof/svc/iof_svc_sub.c @@ -85,10 +85,10 @@ int orte_iof_svc_sub_create( item = opal_list_get_next(item)) { sub = (orte_iof_svc_sub_t*)item; if (sub->origin_mask == origin_mask && - orte_ns.compare_fields(sub->origin_mask,&sub->origin_name,origin_name) == 0 && + ORTE_EQUAL == orte_ns.compare_fields(sub->origin_mask,&sub->origin_name,origin_name) && sub->origin_tag == origin_tag && sub->target_mask == target_mask && - orte_ns.compare_fields(sub->target_mask,&sub->target_name,target_name) == 0 && + ORTE_EQUAL == orte_ns.compare_fields(sub->target_mask,&sub->target_name,target_name) && sub->target_tag == target_tag) { OPAL_THREAD_UNLOCK(&mca_iof_svc_component.svc_lock); return ORTE_SUCCESS; @@ -197,8 +197,9 @@ void orte_iof_svc_sub_ack( /* If the subscription origin/tag doesn't match the ACK origin/tag, skip it */ - if (orte_ns.compare_fields(sub->origin_mask, - &sub->origin_name, &hdr->msg_origin) != 0 || + if (ORTE_EQUAL != orte_ns.compare_fields(sub->origin_mask, + &sub->origin_name, + &hdr->msg_origin) || sub->origin_tag != hdr->msg_tag) { continue; } @@ -220,8 +221,9 @@ void orte_iof_svc_sub_ack( coming from this process, then update the seq_min calculation */ if (NULL != sub->sub_endpoint && - 0 == orte_ns.compare_fields(ORTE_NS_CMP_ALL, - orte_process_info.my_name, peer)) { + ORTE_EQUAL == orte_ns.compare_fields(ORTE_NS_CMP_ALL, + orte_process_info.my_name, + peer)) { if (do_close) { /* JMS what to do here? Need to set sub->sub_endpoint to NULL. Have similar leak for do_close for @@ -255,8 +257,8 @@ void orte_iof_svc_sub_ack( /* If the publication origin or publication proxy matches the ACK'ing proxy, save the ACK'ed byte count for this *origin* (not the proxy). */ - if (orte_ns.compare_fields(pub->pub_mask,&pub->pub_name,peer) == 0 || - orte_ns.compare_fields(ORTE_NS_CMP_ALL,&pub->pub_proxy,peer) == 0) { + if (ORTE_EQUAL == orte_ns.compare_fields(pub->pub_mask,&pub->pub_name,peer) || + ORTE_EQUAL == orte_ns.compare_fields(ORTE_NS_CMP_ALL,&pub->pub_proxy,peer)) { opal_output(orte_iof_base.iof_output, "ack: found matching pub"); /* If we're closing, then remove this proc from @@ -311,12 +313,12 @@ void orte_iof_svc_sub_ack( if (seq_min == hdr->msg_seq+hdr->msg_len) { /* If the original message was initiated from this process, then the ACK delivery is local. */ - if (0 == orte_ns.compare_fields(ORTE_NS_CMP_ALL, - orte_process_info.my_name, - &hdr->msg_origin) || - 0 == orte_ns.compare_fields(ORTE_NS_CMP_ALL, - orte_process_info.my_name, - &hdr->msg_proxy)) { + if (ORTE_EQUAL == orte_ns.compare_fields(ORTE_NS_CMP_ALL, + orte_process_info.my_name, + &hdr->msg_origin) || + ORTE_EQUAL == orte_ns.compare_fields(ORTE_NS_CMP_ALL, + orte_process_info.my_name, + &hdr->msg_proxy)) { orte_iof_base_endpoint_t* endpoint; endpoint = orte_iof_base_endpoint_match(&hdr->msg_origin, ORTE_NS_CMP_ALL, @@ -381,10 +383,10 @@ int orte_iof_svc_sub_delete( opal_list_item_t* next = opal_list_get_next(item); orte_iof_svc_sub_t* sub = (orte_iof_svc_sub_t*)item; if (sub->origin_mask == origin_mask && - orte_ns.compare_fields(sub->origin_mask,&sub->origin_name,origin_name) == 0 && + ORTE_EQUAL == orte_ns.compare_fields(sub->origin_mask,&sub->origin_name,origin_name) && sub->origin_tag == origin_tag && sub->target_mask == target_mask && - orte_ns.compare_fields(sub->target_mask,&sub->target_name,target_name) == 0 && + ORTE_EQUAL == orte_ns.compare_fields(sub->target_mask,&sub->target_name,target_name) && sub->target_tag == target_tag) { opal_list_remove_item(&mca_iof_svc_component.svc_subscribed, item); OBJ_RELEASE(item); @@ -406,9 +408,9 @@ int orte_iof_svc_sub_delete_all( opal_list_item_t* next = opal_list_get_next(item); orte_iof_svc_sub_t* sub = (orte_iof_svc_sub_t*)item; if ((sub->origin_mask == ORTE_NS_CMP_ALL && - orte_ns.compare_fields(ORTE_NS_CMP_ALL,&sub->origin_name,name) == 0) || + ORTE_EQUAL == orte_ns.compare_fields(ORTE_NS_CMP_ALL,&sub->origin_name,name)) || (sub->target_mask == ORTE_NS_CMP_ALL && - orte_ns.compare_fields(ORTE_NS_CMP_ALL,&sub->target_name,name) == 0)) { + ORTE_EQUAL == orte_ns.compare_fields(ORTE_NS_CMP_ALL,&sub->target_name,name))) { opal_list_remove_item(&mca_iof_svc_component.svc_subscribed, item); OBJ_RELEASE(item); } @@ -534,7 +536,7 @@ bool orte_iof_svc_fwd_match( orte_iof_svc_sub_t* sub, orte_iof_svc_pub_t* pub) { - if (orte_ns.compare_fields(sub->target_mask,&sub->target_name,&pub->pub_name) == 0 && + if (ORTE_EQUAL == orte_ns.compare_fields(sub->target_mask,&sub->target_name,&pub->pub_name) && sub->origin_tag == pub->pub_tag) { return true; } else {