From d0cd752e33e09d826f38dbaf722624890dbe0f08 Mon Sep 17 00:00:00 2001 From: Tim Woodall Date: Tue, 18 Oct 2005 14:26:12 +0000 Subject: [PATCH] - don't track the sequence number when the endpoint is a data sink, its not needed and there could be multiple sources each w/ their own sequence. - if a write doesn't complete, need to check for non-blocking case.. This commit was SVN r7795. --- orte/mca/iof/base/iof_base_endpoint.c | 9 ++++----- orte/mca/iof/base/iof_base_endpoint.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/orte/mca/iof/base/iof_base_endpoint.c b/orte/mca/iof/base/iof_base_endpoint.c index 5d1e8b376a..122f88ab8e 100644 --- a/orte/mca/iof/base/iof_base_endpoint.c +++ b/orte/mca/iof/base/iof_base_endpoint.c @@ -162,6 +162,8 @@ static void orte_iof_base_endpoint_write_handler(int sd, short flags, void *user if(rc < 0) { if(errno == EAGAIN) break; + if(errno == EINTR) + continue; orte_iof_base_endpoint_closed(endpoint); OPAL_THREAD_UNLOCK(&orte_iof_base.iof_lock); return; @@ -173,7 +175,6 @@ static void orte_iof_base_endpoint_write_handler(int sd, short flags, void *user } opal_list_remove_item(&endpoint->ep_frags, &frag->super); OPAL_THREAD_UNLOCK(&orte_iof_base.iof_lock); - orte_iof_base_endpoint_ack(endpoint, frag->frag_hdr.hdr_msg.msg_seq + frag->frag_hdr.hdr_msg.msg_len); orte_iof_base_frag_ack(frag); OPAL_THREAD_LOCK(&orte_iof_base.iof_lock); } @@ -392,7 +393,6 @@ int orte_iof_base_endpoint_forward( } OPAL_THREAD_LOCK(&orte_iof_base.iof_lock); - endpoint->ep_seq = hdr->msg_seq + hdr->msg_len; frag->frag_owner = endpoint; frag->frag_src = *src; frag->frag_hdr.hdr_msg = *hdr; @@ -400,7 +400,7 @@ int orte_iof_base_endpoint_forward( /* try to write w/out copying data */ if(opal_list_get_size(&endpoint->ep_frags) == 0) { rc = write(endpoint->ep_fd,data,len); - if(rc < 0) { + if(rc < 0 && (errno != EAGAIN && errno != EINTR)) { orte_iof_base_endpoint_closed(endpoint); OPAL_THREAD_UNLOCK(&orte_iof_base.iof_lock); return ORTE_SUCCESS; @@ -419,9 +419,7 @@ int orte_iof_base_endpoint_forward( OPAL_THREAD_UNLOCK(&orte_iof_base.iof_lock); } else { OPAL_THREAD_UNLOCK(&orte_iof_base.iof_lock); - /* acknowledge fragment */ - orte_iof_base_endpoint_ack(endpoint, frag->frag_hdr.hdr_msg.msg_seq + frag->frag_hdr.hdr_msg.msg_len); orte_iof_base_frag_ack(frag); } return ORTE_SUCCESS; @@ -434,6 +432,7 @@ int orte_iof_base_endpoint_forward( * is now open, re-enable forwarding. */ + int orte_iof_base_endpoint_ack( orte_iof_base_endpoint_t* endpoint, uint32_t seq) diff --git a/orte/mca/iof/base/iof_base_endpoint.h b/orte/mca/iof/base/iof_base_endpoint.h index 146609caf8..7ec98296fe 100644 --- a/orte/mca/iof/base/iof_base_endpoint.h +++ b/orte/mca/iof/base/iof_base_endpoint.h @@ -38,7 +38,7 @@ OBJ_CLASS_DECLARATION(orte_iof_base_endpoint_t); */ #define ORTE_IOF_BASE_SEQDIFF(s1,s2) \ - ((s1 > s2) ? (s1 - s2) : (s1 + (ULONG_MAX - s2))) + ((s1 >= s2) ? (s1 - s2) : (s1 + (ULONG_MAX - s2))) /**