From 8e9c71282d74ec8c6af542bd8914a78cb0f3e50e Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 26 Jul 2007 18:46:46 +0000 Subject: [PATCH] Add a bunch more [conditional] debugging output. This commit was SVN r15643. --- orte/mca/iof/base/iof_base_endpoint.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/orte/mca/iof/base/iof_base_endpoint.c b/orte/mca/iof/base/iof_base_endpoint.c index 3adde36cfd..7e2565d924 100644 --- a/orte/mca/iof/base/iof_base_endpoint.c +++ b/orte/mca/iof/base/iof_base_endpoint.c @@ -180,6 +180,7 @@ static void orte_iof_base_endpoint_read_handler(int fd, short flags, void *cbdat } /* Error on the connection */ + opal_output(orte_iof_base.iof_output, "iof_base_endpoint: read handler, error on read"); orte_iof_base_endpoint_closed(endpoint); /* Fall through to send 0 byte message to other side indicating that the endpoint is now closed. */ @@ -188,6 +189,7 @@ static void orte_iof_base_endpoint_read_handler(int fd, short flags, void *cbdat /* peer has closed connection (will fall through to send a 0 byte message, therefore telling the RML side that the fd side has closed its connection) */ + opal_output(orte_iof_base.iof_output, "iof_base_endpoint: read handler, peer closed fd"); orte_iof_base_endpoint_closed(endpoint); } @@ -212,7 +214,7 @@ static void orte_iof_base_endpoint_read_handler(int fd, short flags, void *cbdat /* if window size has been exceeded - disable forwarding */ endpoint->ep_seq += frag->frag_len; - if(ORTE_IOF_BASE_SEQDIFF(endpoint->ep_seq,endpoint->ep_ack) > orte_iof_base.iof_window_size) { + if (ORTE_IOF_BASE_SEQDIFF(endpoint->ep_seq,endpoint->ep_ack) > orte_iof_base.iof_window_size) { opal_output(orte_iof_base.iof_output, "iof_base_endpoint read handler: window exceeded -- reading disabled"); opal_event_del(&endpoint->ep_event); } @@ -223,6 +225,7 @@ static void orte_iof_base_endpoint_read_handler(int fd, short flags, void *cbdat OBJ_RETAIN(endpoint); /* start non-blocking RML call to forward received data */ + opal_output(orte_iof_base.iof_output, "iof_base_endpoint read handler: sending data to svc"); rc = orte_rml.send_nb( orte_iof_base.iof_service, frag->frag_iov, @@ -254,6 +257,7 @@ static void orte_iof_base_endpoint_write_handler(int sd, short flags, void *user /* close connection on zero byte message */ if(frag->frag_len == 0) { + opal_output(orte_iof_base.iof_output, "iof_base_endpoint: write handler, peer closed fd"); orte_iof_base_endpoint_closed(endpoint); OPAL_THREAD_UNLOCK(&orte_iof_base.iof_lock); return; @@ -272,6 +276,7 @@ static void orte_iof_base_endpoint_write_handler(int sd, short flags, void *user /* All other errors -- to include sigpipe -- mean that Something Bad happened and we should abort in despair. */ + opal_output(orte_iof_base.iof_output, "iof_base_endpoint: write handler, error on fd"); orte_iof_base_endpoint_closed(endpoint); /* Send a ACK-AND-CLOSE back to the service so that it @@ -515,6 +520,10 @@ void orte_iof_base_endpoint_closed(orte_iof_base_endpoint_t* endpoint) written down the fd (because the process on the other side of the fd is no longer there -- we're just about to close the fd). */ + opal_output(orte_iof_base.iof_output, + "orte_iof_base_endpoint_closed: mode %s, origin [%ld,%ld,%ld], tag %d", + (ORTE_IOF_SOURCE == endpoint->ep_mode) ? "SOURCE" : "SINK", + ORTE_NAME_ARGS(&endpoint->ep_origin), endpoint->ep_tag); if (ORTE_IOF_SINK == endpoint->ep_mode) { while (NULL != opal_list_remove_first(&(endpoint->ep_sink_frags))){ continue; @@ -629,6 +638,7 @@ int orte_iof_base_endpoint_forward( (ACKs are based on fragment length; an ACK of 0 bytes would do nothing) */ ORTE_IOF_BASE_FRAG_RETURN(frag); + opal_output(orte_iof_base.iof_output, "iof_base_endpoint: forward: peer closed fd"); orte_iof_base_endpoint_closed(endpoint); OPAL_THREAD_UNLOCK(&orte_iof_base.iof_lock); return ORTE_SUCCESS; @@ -636,6 +646,7 @@ int orte_iof_base_endpoint_forward( rc = write(endpoint->ep_fd,data,len); if(rc < 0) { if (errno != EAGAIN && errno != EINTR) { + opal_output(orte_iof_base.iof_output, "iof_base_endpoint: forward: write error"); orte_iof_base_endpoint_closed(endpoint); /* Send a ACK-AND-CLOSE back to the service so