From 750ea30961d1df173641d9e4cee366e975e7fca5 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Fri, 18 Jul 2008 20:04:26 +0000 Subject: [PATCH] So apparently my clever fix in r18873 was not good -- apparently, we can have a pub_endpoint and a sub_endpoint that are not equal but go to the same place (fd). I didn't think that that was possible. :-\ So just use a bool to track whether we have forwarded the fragment at all; if we have, then don't forward to the sub_endpoint. IOF is going to be re-written for v1.4. This commit was SVN r18950. The following SVN revision numbers were found above: r18873 --> open-mpi/ompi@773c92a6ebbca81c69e1a16f719315ae03dd0a17 --- orte/mca/iof/svc/iof_svc_sub.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/orte/mca/iof/svc/iof_svc_sub.c b/orte/mca/iof/svc/iof_svc_sub.c index 26414f0e38..0c8a3810d1 100644 --- a/orte/mca/iof/svc/iof_svc_sub.c +++ b/orte/mca/iof/svc/iof_svc_sub.c @@ -457,6 +457,8 @@ int orte_iof_svc_sub_forward( bool *forward) { opal_list_item_t* item; + bool forwarded = false; + for(item = opal_list_get_first(&sub->sub_forward); item != opal_list_get_end(&sub->sub_forward); item = opal_list_get_next(item)) { @@ -480,16 +482,13 @@ int orte_iof_svc_sub_forward( STDIN from the HNP to a local VPID 0 is the only case where the message will find an endpoint with both a pub and sub on it, so we want to be sure to forward it only - *once*. Outside of this loop, we'll forward it to - sub->sub_endpoint. So if the pub->pub_endpoint is the - same as the sub->sub_endpoint, then skip it here -- - we'll forward it after this loop. Without this check, - we'd forward it twice (resulting in + *once*. So if we forward it here, then skip forwarding + to the sub_endpoint (after this loop). Without this + check, we'd forward it twice (resulting in https://svn.open-mpi.org/trac/ompi/ticket/1135). */ - if (pub->pub_endpoint != sub->sub_endpoint) { - opal_output_verbose(1, orte_iof_base.iof_output, "sub_forward: forwarding to pub local endpoint"); - rc = orte_iof_base_endpoint_forward(pub->pub_endpoint,src,hdr,data); - } + forwarded = true; + opal_output_verbose(1, orte_iof_base.iof_output, "sub_forward: forwarding to pub local endpoint"); + rc = orte_iof_base_endpoint_forward(pub->pub_endpoint,src,hdr,data); } else { /* forward */ orte_iof_base_frag_t* frag; @@ -517,7 +516,7 @@ int orte_iof_svc_sub_forward( } *forward = true; } - if (NULL != sub->sub_endpoint) { + if (NULL != sub->sub_endpoint && !forwarded) { opal_output_verbose(1, orte_iof_base.iof_output, "sub_forward: forwarding to sub local endpoint"); *forward = true; return orte_iof_base_endpoint_forward(sub->sub_endpoint,src,hdr,data);