From 3e2c51dea8e84371a1caa0821bf20ce45418cb16 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Sat, 11 Mar 2006 03:09:24 +0000 Subject: [PATCH] * fix some silly commenting done by a previous developer that are good for a laugh but probably not good for usability ;) This commit was SVN r9253. --- ompi/mca/btl/tcp/btl_tcp_component.c | 14 ++++++-------- ompi/mca/btl/tcp/btl_tcp_endpoint.c | 18 +++++++----------- ompi/mca/btl/tcp/btl_tcp_frag.c | 23 +++++++++++++++++++++++ orte/mca/oob/tcp/oob_tcp.c | 13 +++++-------- orte/mca/oob/tcp/oob_tcp_msg.c | 6 ++++++ orte/mca/oob/tcp/oob_tcp_peer.c | 15 ++++++--------- orte/mca/oob/tcp/oob_tcp_ping.c | 6 ++++++ 7 files changed, 59 insertions(+), 36 deletions(-) diff --git a/ompi/mca/btl/tcp/btl_tcp_component.c b/ompi/mca/btl/tcp/btl_tcp_component.c index afa322bcd4..782254210f 100644 --- a/ompi/mca/btl/tcp/btl_tcp_component.c +++ b/ompi/mca/btl/tcp/btl_tcp_component.c @@ -14,9 +14,15 @@ * Additional copyrights may follow * * $HEADER$ + * + * In windows, many of the socket functions return an EWOULDBLOCK + * instead of \ things like EAGAIN, EINPROGRESS, etc. It has been + * verified that this will \ not conflict with other error codes that + * are returned by these functions \ under UNIX/Linux environments */ #include "ompi_config.h" + #include "orte/orte_socket_errno.h" #ifdef HAVE_UNISTD_H #include @@ -60,13 +66,6 @@ #include "ompi/datatype/convertor.h" -#define IMPORTANT_WINDOWS_COMMENT() \ - /* In windows, many of the socket functions return an EWOULDBLOCK instead of \ - things like EAGAIN, EINPROGRESS, etc. It has been verified that this will \ - not conflict with other error codes that are returned by these functions \ - under UNIX/Linux environments */ - - mca_btl_tcp_component_t mca_btl_tcp_component = { { /* First, the mca_base_component_t struct containing meta information @@ -557,7 +556,6 @@ static void mca_btl_tcp_component_accept(void) mca_btl_tcp_event_t *event; int sd = accept(mca_btl_tcp_component.tcp_listen_sd, (struct sockaddr*)&addr, &addrlen); if(sd < 0) { - IMPORTANT_WINDOWS_COMMENT(); if(ompi_socket_errno == EINTR) continue; if(ompi_socket_errno != EAGAIN || ompi_socket_errno != EWOULDBLOCK) diff --git a/ompi/mca/btl/tcp/btl_tcp_endpoint.c b/ompi/mca/btl/tcp/btl_tcp_endpoint.c index 50820050b0..5addb5dae5 100644 --- a/ompi/mca/btl/tcp/btl_tcp_endpoint.c +++ b/ompi/mca/btl/tcp/btl_tcp_endpoint.c @@ -14,10 +14,15 @@ * Additional copyrights may follow * * $HEADER$ + * + * In windows, many of the socket functions return an EWOULDBLOCK + * instead of \ things like EAGAIN, EINPROGRESS, etc. It has been + * verified that this will \ not conflict with other error codes that + * are returned by these functions \ under UNIX/Linux environments */ - #include "ompi_config.h" + #include #include #ifdef HAVE_UNISTD_H @@ -45,6 +50,7 @@ #ifdef HAVE_TIME_H #include #endif /* HAVE_TIME_H */ + #include "ompi/types.h" #include "ompi/mca/btl/base/btl_base_error.h" #include "btl_tcp.h" @@ -104,12 +110,6 @@ OBJ_CLASS_INSTANCE( mca_btl_tcp_endpoint_destruct); -#define IMPORTANT_WINDOWS_COMMENT() \ - /* In windows, many of the socket functions return an EWOULDBLOCK instead of \ - things like EAGAIN, EINPROGRESS, etc. It has been verified that this will \ - not conflict with other error codes that are returned by these functions \ - under UNIX/Linux environments */ - static void mca_btl_tcp_endpoint_construct(mca_btl_base_endpoint_t* btl_endpoint); static void mca_btl_tcp_endpoint_destruct(mca_btl_base_endpoint_t* btl_endpoint); static int mca_btl_tcp_endpoint_start_connect(mca_btl_base_endpoint_t*); @@ -254,7 +254,6 @@ static int mca_btl_tcp_endpoint_send_blocking(mca_btl_base_endpoint_t* btl_endpo while(cnt < size) { int retval = send(btl_endpoint->endpoint_sd, (const char *)ptr+cnt, size-cnt, 0); if(retval < 0) { - IMPORTANT_WINDOWS_COMMENT(); if(ompi_socket_errno != EINTR && ompi_socket_errno != EAGAIN && ompi_socket_errno != EWOULDBLOCK) { BTL_ERROR(("send() failed with errno=%d",ompi_socket_errno)); mca_btl_tcp_endpoint_close(btl_endpoint); @@ -412,7 +411,6 @@ static int mca_btl_tcp_endpoint_recv_blocking(mca_btl_base_endpoint_t* btl_endpo /* socket is non-blocking so handle errors */ if(retval < 0) { - IMPORTANT_WINDOWS_COMMENT(); if(ompi_socket_errno != EINTR && ompi_socket_errno != EAGAIN && ompi_socket_errno != EWOULDBLOCK) { BTL_ERROR(("recv() failed with errno=%d",ompi_socket_errno)); mca_btl_tcp_endpoint_close(btl_endpoint); @@ -525,7 +523,6 @@ static int mca_btl_tcp_endpoint_start_connect(mca_btl_base_endpoint_t* btl_endpo endpoint_addr.sin_port = btl_endpoint->endpoint_addr->addr_port; if(connect(btl_endpoint->endpoint_sd, (struct sockaddr*)&endpoint_addr, sizeof(endpoint_addr)) < 0) { /* non-blocking so wait for completion */ - IMPORTANT_WINDOWS_COMMENT(); if(ompi_socket_errno == EINPROGRESS || ompi_socket_errno == EWOULDBLOCK) { btl_endpoint->endpoint_state = MCA_BTL_TCP_CONNECTING; opal_event_add(&btl_endpoint->endpoint_send_event, 0); @@ -567,7 +564,6 @@ static void mca_btl_tcp_endpoint_complete_connect(mca_btl_base_endpoint_t* btl_e mca_btl_tcp_endpoint_close(btl_endpoint); return; } - IMPORTANT_WINDOWS_COMMENT(); if(so_error == EINPROGRESS || so_error == EWOULDBLOCK) { opal_event_add(&btl_endpoint->endpoint_send_event, 0); return; diff --git a/ompi/mca/btl/tcp/btl_tcp_frag.c b/ompi/mca/btl/tcp/btl_tcp_frag.c index 4a973b6c45..aad99afd39 100644 --- a/ompi/mca/btl/tcp/btl_tcp_frag.c +++ b/ompi/mca/btl/tcp/btl_tcp_frag.c @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + * + * In windows, many of the socket functions return an EWOULDBLOCK + * instead of \ things like EAGAIN, EINPROGRESS, etc. It has been + * verified that this will \ not conflict with other error codes that + * are returned by these functions \ under UNIX/Linux environments + */ + #include "ompi_config.h" #ifdef HAVE_SYS_TYPES_H diff --git a/orte/mca/oob/tcp/oob_tcp.c b/orte/mca/oob/tcp/oob_tcp.c index 8581e0ab4d..ef733d986a 100644 --- a/orte/mca/oob/tcp/oob_tcp.c +++ b/orte/mca/oob/tcp/oob_tcp.c @@ -14,6 +14,11 @@ * Additional copyrights may follow * * $HEADER$ + * + * In windows, many of the socket functions return an EWOULDBLOCK + * instead of \ things like EAGAIN, EINPROGRESS, etc. It has been + * verified that this will \ not conflict with other error codes that + * are returned by these functions \ under UNIX/Linux environments */ #include "orte_config.h" @@ -43,12 +48,6 @@ #include "orte/mca/gpr/gpr.h" #include "ompi/constants.h" -#define IMPORTANT_WINDOWS_COMMENT() \ - /* In windows, many of the socket functions return an EWOULDBLOCK instead of \ - things like EAGAIN, EINPROGRESS, etc. It has been verified that this will \ - not conflict with other error codes that are returned by these functions \ - under UNIX/Linux environments */ - /* * Data structure for accepting connections. */ @@ -259,7 +258,6 @@ static void mca_oob_tcp_accept(void) sd = accept(mca_oob_tcp_component.tcp_listen_sd, (struct sockaddr*)&addr, &addrlen); if(sd < 0) { - IMPORTANT_WINDOWS_COMMENT(); if(ompi_socket_errno == EINTR) continue; if(ompi_socket_errno != EAGAIN || ompi_socket_errno != EWOULDBLOCK) @@ -370,7 +368,6 @@ static void mca_oob_tcp_recv_probe(int sd, mca_oob_tcp_hdr_t* hdr) while(cnt < sizeof(mca_oob_tcp_hdr_t)) { int retval = send(sd, (char *)ptr+cnt, sizeof(mca_oob_tcp_hdr_t)-cnt, 0); if(retval < 0) { - IMPORTANT_WINDOWS_COMMENT(); if(ompi_socket_errno != EINTR && ompi_socket_errno != EAGAIN && ompi_socket_errno != EWOULDBLOCK) { opal_output(0, "[%lu,%lu,%lu]-[%lu,%lu,%lu] mca_oob_tcp_peer_recv_probe: send() failed with errno=%d\n", ORTE_NAME_ARGS(orte_process_info.my_name), diff --git a/orte/mca/oob/tcp/oob_tcp_msg.c b/orte/mca/oob/tcp/oob_tcp_msg.c index ec38eedf15..a60a1f0a96 100644 --- a/orte/mca/oob/tcp/oob_tcp_msg.c +++ b/orte/mca/oob/tcp/oob_tcp_msg.c @@ -14,7 +14,13 @@ * Additional copyrights may follow * * $HEADER$ + * + * In windows, many of the socket functions return an EWOULDBLOCK + * instead of \ things like EAGAIN, EINPROGRESS, etc. It has been + * verified that this will \ not conflict with other error codes that + * are returned by these functions \ under UNIX/Linux environments */ + #include "orte_config.h" #include "orte/orte_socket_errno.h" diff --git a/orte/mca/oob/tcp/oob_tcp_peer.c b/orte/mca/oob/tcp/oob_tcp_peer.c index b31e2b8e75..cd24241501 100644 --- a/orte/mca/oob/tcp/oob_tcp_peer.c +++ b/orte/mca/oob/tcp/oob_tcp_peer.c @@ -14,7 +14,13 @@ * Additional copyrights may follow * * $HEADER$ + * + * In windows, many of the socket functions return an EWOULDBLOCK + * instead of \ things like EAGAIN, EINPROGRESS, etc. It has been + * verified that this will \ not conflict with other error codes that + * are returned by these functions \ under UNIX/Linux environments */ + #include "orte_config.h" #ifdef HAVE_UNISTD_H #include @@ -48,12 +54,6 @@ #include "oob_tcp.h" #include "oob_tcp_peer.h" -#define IMPORTANT_WINDOWS_COMMENT() \ - /* In windows, many of the socket functions return an EWOULDBLOCK instead of \ - things like EAGAIN, EINPROGRESS, etc. It has been verified that this will \ - not conflict with other error codes that are returned by these functions \ - under UNIX/Linux environments */ - static int mca_oob_tcp_peer_start_connect(mca_oob_tcp_peer_t* peer); static int mca_oob_tcp_peer_event_init(mca_oob_tcp_peer_t* peer); static void mca_oob_tcp_peer_connected(mca_oob_tcp_peer_t* peer); @@ -345,7 +345,6 @@ static int mca_oob_tcp_peer_start_connect(mca_oob_tcp_peer_t* peer) /* start the connect - will likely fail with EINPROGRESS */ if(connect(peer->peer_sd, (struct sockaddr*)&inaddr, sizeof(inaddr)) < 0) { /* non-blocking so wait for completion */ - IMPORTANT_WINDOWS_COMMENT(); if(ompi_socket_errno == EINPROGRESS || ompi_socket_errno == EWOULDBLOCK) { opal_event_add(&peer->peer_send_event, 0); /* Waiting for completion in the middle of the list ?! Let's just hope we try with the @@ -611,7 +610,6 @@ static int mca_oob_tcp_peer_recv_blocking(mca_oob_tcp_peer_t* peer, void* data, /* socket is non-blocking so handle errors */ if(retval < 0) { - IMPORTANT_WINDOWS_COMMENT(); if(ompi_socket_errno != EINTR && ompi_socket_errno != EAGAIN && ompi_socket_errno != EWOULDBLOCK) { opal_output(0, "[%lu,%lu,%lu]-[%lu,%lu,%lu] mca_oob_tcp_peer_recv_blocking: recv() failed with errno=%d\n", ORTE_NAME_ARGS(orte_process_info.my_name), @@ -638,7 +636,6 @@ static int mca_oob_tcp_peer_send_blocking(mca_oob_tcp_peer_t* peer, void* data, while(cnt < size) { int retval = send(peer->peer_sd, (char *)ptr+cnt, size-cnt, 0); if(retval < 0) { - IMPORTANT_WINDOWS_COMMENT(); if(ompi_socket_errno != EINTR && ompi_socket_errno != EAGAIN && ompi_socket_errno != EWOULDBLOCK) { opal_output(0, "[%lu,%lu,%lu]-[%lu,%lu,%lu] mca_oob_tcp_peer_send_blocking: send() failed with errno=%d\n", ORTE_NAME_ARGS(orte_process_info.my_name), diff --git a/orte/mca/oob/tcp/oob_tcp_ping.c b/orte/mca/oob/tcp/oob_tcp_ping.c index f00beb23c5..d335006f31 100644 --- a/orte/mca/oob/tcp/oob_tcp_ping.c +++ b/orte/mca/oob/tcp/oob_tcp_ping.c @@ -14,7 +14,13 @@ * Additional copyrights may follow * * $HEADER$ + * + * In windows, many of the socket functions return an EWOULDBLOCK + * instead of \ things like EAGAIN, EINPROGRESS, etc. It has been + * verified that this will \ not conflict with other error codes that + * are returned by these functions \ under UNIX/Linux environments */ + #include "orte_config.h" #ifdef HAVE_UNISTD_H #include