5555#include "ompi/mca/btl/base/btl_base_error.h"
5656#include "ompi/mca/rte/rte.h"
5757
58- #include "btl_tcp_endpoint.h"
58+ #include "btl_tcp_endpoint.h"
5959#include "btl_tcp_proc.h"
6060#include "btl_tcp_frag.h"
6161
@@ -160,7 +160,7 @@ void mca_btl_tcp_endpoint_dump(mca_btl_base_endpoint_t* btl_endpoint, const char
160160#endif
161161
162162 if ((flags = fcntl (btl_endpoint -> endpoint_sd , F_GETFL , 0 )) < 0 ) {
163- BTL_ERROR (("fcntl(F_GETFL) failed: %s (%d)" ,
163+ BTL_ERROR (("fcntl(F_GETFL) failed: %s (%d)" ,
164164 strerror (opal_socket_errno ), opal_socket_errno ));
165165 }
166166
@@ -176,7 +176,7 @@ void mca_btl_tcp_endpoint_dump(mca_btl_base_endpoint_t* btl_endpoint, const char
176176#if defined(SO_RCVBUF )
177177 obtlen = sizeof (rcvbuf );
178178 if (getsockopt (btl_endpoint -> endpoint_sd , SOL_SOCKET , SO_RCVBUF , (char * )& rcvbuf , & obtlen ) < 0 ) {
179- BTL_ERROR (("SO_RCVBUF option: %s (%d)" ,
179+ BTL_ERROR (("SO_RCVBUF option: %s (%d)" ,
180180 strerror (opal_socket_errno ), opal_socket_errno ));
181181 }
182182#else
@@ -185,15 +185,15 @@ void mca_btl_tcp_endpoint_dump(mca_btl_base_endpoint_t* btl_endpoint, const char
185185#if defined(TCP_NODELAY )
186186 obtlen = sizeof (nodelay );
187187 if (getsockopt (btl_endpoint -> endpoint_sd , IPPROTO_TCP , TCP_NODELAY , (char * )& nodelay , & obtlen ) < 0 ) {
188- BTL_ERROR (("TCP_NODELAY option: %s (%d)" ,
188+ BTL_ERROR (("TCP_NODELAY option: %s (%d)" ,
189189 strerror (opal_socket_errno ), opal_socket_errno ));
190190 }
191191#else
192192 nodelay = 0 ;
193193#endif
194194 }
195195
196- mca_btl_base_err ("%s %s: endpoint %p src %s - dst %s nodelay %d sndbuf %d rcvbuf %d flags %08x\n" ,
196+ mca_btl_base_err ("%s %s: endpoint %p src %s - dst %s nodelay %d sndbuf %d rcvbuf %d flags %08x\n" ,
197197 ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ), msg , (void * )btl_endpoint , src , dst , nodelay , sndbuf , rcvbuf , flags );
198198
199199 switch (btl_endpoint -> endpoint_state ) {
@@ -222,7 +222,7 @@ void mca_btl_tcp_endpoint_dump(mca_btl_base_endpoint_t* btl_endpoint, const char
222222#endif /* MCA_BTL_TCP_ENDPOINT_CACHE */
223223 (void * )btl_endpoint -> endpoint_send_frag , (void * )btl_endpoint -> endpoint_recv_frag );
224224 for (item = opal_list_get_first (& btl_endpoint -> endpoint_frags );
225- item != opal_list_get_end (& btl_endpoint -> endpoint_frags );
225+ item != opal_list_get_end (& btl_endpoint -> endpoint_frags );
226226 item = opal_list_get_next (item )) {
227227 mca_btl_tcp_dump_frag ( (mca_btl_tcp_frag_t * )item , " | send" );
228228 }
@@ -239,9 +239,9 @@ static inline void mca_btl_tcp2_endpoint_event_init(mca_btl_base_endpoint_t* btl
239239 btl_endpoint -> endpoint_cache_pos = btl_endpoint -> endpoint_cache ;
240240#endif /* MCA_BTL_TCP_ENDPOINT_CACHE */
241241
242- opal_event_set (mca_btl_tcp_event_base , & btl_endpoint -> endpoint_recv_event ,
243- btl_endpoint -> endpoint_sd ,
244- OPAL_EV_READ |OPAL_EV_PERSIST ,
242+ opal_event_set (mca_btl_tcp_event_base , & btl_endpoint -> endpoint_recv_event ,
243+ btl_endpoint -> endpoint_sd ,
244+ OPAL_EV_READ |OPAL_EV_PERSIST ,
245245 mca_btl_tcp_endpoint_recv_handler ,
246246 btl_endpoint );
247247 /**
@@ -250,9 +250,9 @@ static inline void mca_btl_tcp2_endpoint_event_init(mca_btl_base_endpoint_t* btl
250250 * will be fired only once, and when the endpoint is marked as
251251 * CONNECTED the event should be recreated with the correct flags.
252252 */
253- opal_event_set (mca_btl_tcp_event_base , & btl_endpoint -> endpoint_send_event ,
254- btl_endpoint -> endpoint_sd ,
255- OPAL_EV_WRITE ,
253+ opal_event_set (mca_btl_tcp_event_base , & btl_endpoint -> endpoint_send_event ,
254+ btl_endpoint -> endpoint_sd ,
255+ OPAL_EV_WRITE ,
256256 mca_btl_tcp_endpoint_send_handler ,
257257 btl_endpoint );
258258}
@@ -291,11 +291,6 @@ int mca_btl_tcp2_endpoint_send(mca_btl_base_endpoint_t* btl_endpoint, mca_btl_tc
291291 } else {
292292 btl_endpoint -> endpoint_send_frag = frag ;
293293 frag -> base .des_flags |= MCA_BTL_DES_SEND_ALWAYS_CALLBACK ;
294- #define GB_DEFINED 0
295- #if GB_DEFINED
296- opal_output (0 , "%s:%d add the send event on socket %d\n" ,
297- __FILE__ , __LINE__ , btl_endpoint -> endpoint_sd ); /* GB */
298- #endif /* GB_DEFINED */
299294 MCA_BTL_TCP_ACTIVATE_EVENT (& btl_endpoint -> endpoint_send_event , 0 );
300295 }
301296 } else {
@@ -376,7 +371,7 @@ bool mca_btl_tcp2_endpoint_accept(mca_btl_base_endpoint_t* btl_endpoint,
376371 OPAL_THREAD_LOCK (& btl_endpoint -> endpoint_recv_lock );
377372 OPAL_THREAD_LOCK (& btl_endpoint -> endpoint_send_lock );
378373
379- cmpval = ompi_rte_compare_name_fields (OMPI_RTE_CMP_ALL ,
374+ cmpval = ompi_rte_compare_name_fields (OMPI_RTE_CMP_ALL ,
380375 & endpoint_proc -> proc_ompi -> proc_name ,
381376 this_proc );
382377 if ((btl_endpoint -> endpoint_sd < 0 ) ||
@@ -394,10 +389,6 @@ bool mca_btl_tcp2_endpoint_accept(mca_btl_base_endpoint_t* btl_endpoint,
394389 /* NOT NEEDED if we remove the PERSISTENT flag when we create the
395390 * first recv_event.
396391 */
397- #if GB_DEFINED
398- opal_output (0 , "%s:%d add the recv event on socket %d\n" ,
399- __FILE__ , __LINE__ , btl_endpoint -> endpoint_sd ); /* GB */
400- #endif /* GB_DEFINED */
401392 opal_event_add (& btl_endpoint -> endpoint_recv_event , 0 ); /* TODO */
402393 mca_btl_tcp_endpoint_connected (btl_endpoint );
403394#if OPAL_ENABLE_DEBUG && WANT_PEER_DUMP
@@ -452,8 +443,8 @@ static void mca_btl_tcp2_endpoint_connected(mca_btl_base_endpoint_t* btl_endpoin
452443 btl_endpoint -> endpoint_retries = 0 ;
453444
454445 /* Create the send event in a persistent manner. */
455- opal_event_set (mca_btl_tcp_event_base , & btl_endpoint -> endpoint_send_event ,
456- btl_endpoint -> endpoint_sd ,
446+ opal_event_set (mca_btl_tcp_event_base , & btl_endpoint -> endpoint_send_event ,
447+ btl_endpoint -> endpoint_sd ,
457448 OPAL_EV_WRITE | OPAL_EV_PERSIST ,
458449 mca_btl_tcp_endpoint_send_handler ,
459450 btl_endpoint );
@@ -463,10 +454,6 @@ static void mca_btl_tcp2_endpoint_connected(mca_btl_base_endpoint_t* btl_endpoin
463454 btl_endpoint -> endpoint_send_frag = (mca_btl_tcp_frag_t * )
464455 opal_list_remove_first (& btl_endpoint -> endpoint_frags );
465456 }
466- #if GB_DEFINED
467- opal_output (0 , "%s:%d add the send event on socket %d\n" ,
468- __FILE__ , __LINE__ , btl_endpoint -> endpoint_sd ); /* GB */
469- #endif /* GB_DEFINED */
470457 opal_event_add (& btl_endpoint -> endpoint_send_event , 0 );
471458 }
472459}
@@ -618,10 +605,6 @@ static int mca_btl_tcp2_endpoint_start_connect(mca_btl_base_endpoint_t* btl_endp
618605 /* non-blocking so wait for completion */
619606 if (opal_socket_errno == EINPROGRESS || opal_socket_errno == EWOULDBLOCK ) {
620607 btl_endpoint -> endpoint_state = MCA_BTL_TCP_CONNECTING ;
621- #if GB_DEFINED
622- opal_output (0 , "%s:%d add the send event on socket %d\n" ,
623- __FILE__ , __LINE__ , btl_endpoint -> endpoint_sd ); /* GB */
624- #endif /* GB_DEFINED */
625608 MCA_BTL_TCP_ACTIVATE_EVENT (& btl_endpoint -> endpoint_send_event , 0 );
626609 return OMPI_SUCCESS ;
627610 }
@@ -641,10 +624,6 @@ static int mca_btl_tcp2_endpoint_start_connect(mca_btl_base_endpoint_t* btl_endp
641624 /* send our globally unique process identifier to the endpoint */
642625 if ((rc = mca_btl_tcp2_endpoint_send_connect_ack (btl_endpoint )) == OMPI_SUCCESS ) {
643626 btl_endpoint -> endpoint_state = MCA_BTL_TCP_CONNECT_ACK ;
644- #if GB_DEFINED
645- opal_output (0 , "%s:%d add the recv event on socket %d\n" ,
646- __FILE__ , __LINE__ , btl_endpoint -> endpoint_sd ); /* GB */
647- #endif /* GB_DEFINED */
648627 MCA_BTL_TCP_ACTIVATE_EVENT (& btl_endpoint -> endpoint_recv_event , 0 );
649628 } else {
650629 mca_btl_tcp2_endpoint_close (btl_endpoint );
@@ -667,10 +646,6 @@ static void mca_btl_tcp2_endpoint_complete_connect(mca_btl_base_endpoint_t* btl_
667646 mca_btl_tcp2_proc_tosocks (btl_endpoint -> endpoint_addr , & endpoint_addr );
668647
669648 /* unregister from receiving event notifications */
670- #if GB_DEFINED
671- opal_output (0 , "%s:%d remove the send event on socket %d\n" ,
672- __FILE__ , __LINE__ , btl_endpoint -> endpoint_sd ); /* GB */
673- #endif /* GB_DEFINED */
674649 opal_event_del (& btl_endpoint -> endpoint_send_event );
675650
676651 /* check connect completion status */
@@ -682,10 +657,6 @@ static void mca_btl_tcp2_endpoint_complete_connect(mca_btl_base_endpoint_t* btl_
682657 return ;
683658 }
684659 if (so_error == EINPROGRESS || so_error == EWOULDBLOCK ) {
685- #if GB_DEFINED
686- opal_output (0 , "%s:%d add the send event on socket %d\n" ,
687- __FILE__ , __LINE__ , btl_endpoint -> endpoint_sd ); /* GB */
688- #endif /* GB_DEFINED */
689660 opal_event_add (& btl_endpoint -> endpoint_send_event , 0 );
690661 return ;
691662 }
@@ -699,10 +670,6 @@ static void mca_btl_tcp2_endpoint_complete_connect(mca_btl_base_endpoint_t* btl_
699670
700671 if (mca_btl_tcp2_endpoint_send_connect_ack (btl_endpoint ) == OMPI_SUCCESS ) {
701672 btl_endpoint -> endpoint_state = MCA_BTL_TCP_CONNECT_ACK ;
702- #if GB_DEFINED
703- opal_output (0 , "%s:%d add the recv event on socket %d\n" ,
704- __FILE__ , __LINE__ , btl_endpoint -> endpoint_sd ); /* GB */
705- #endif /* GB_DEFINED */
706673 opal_event_add (& btl_endpoint -> endpoint_recv_event , 0 );
707674 } else {
708675 mca_btl_tcp2_endpoint_close (btl_endpoint );
@@ -752,8 +719,8 @@ static void mca_btl_tcp2_endpoint_recv_handler(int sd, short flags, void* user)
752719 data_still_pending_on_endpoint :
753720 if (NULL == frag ) {
754721
755- if (mca_btl_tcp_module .super .btl_max_send_size >
756- mca_btl_tcp_module .super .btl_eager_limit ) {
722+ if (mca_btl_tcp_module .super .btl_max_send_size >
723+ mca_btl_tcp_module .super .btl_eager_limit ) {
757724 MCA_BTL_TCP_FRAG_ALLOC_MAX (frag );
758725 } else {
759726 MCA_BTL_TCP_FRAG_ALLOC_EAGER (frag );
@@ -771,7 +738,7 @@ static void mca_btl_tcp2_endpoint_recv_handler(int sd, short flags, void* user)
771738 btl_endpoint -> endpoint_recv_frag = frag ;
772739 } else {
773740 btl_endpoint -> endpoint_recv_frag = NULL ;
774-
741+
775742 TODO_MCA_BTL_TCP_RECV_TRIGGER_CB (frag );
776743
777744#if MCA_BTL_TCP_ENDPOINT_CACHE
@@ -853,19 +820,11 @@ static void mca_btl_tcp2_endpoint_send_handler(int sd, short flags, void* user)
853820
854821 /* if no more data to send unregister the send notifications */
855822 if (NULL == btl_endpoint -> endpoint_send_frag ) {
856- #if GB_DEFINED
857- opal_output (0 , "%s:%d remove the send event on socket %d\n" ,
858- __FILE__ , __LINE__ , sd ); /* GB */
859- #endif /* GB_DEFINED */
860823 opal_event_del (& btl_endpoint -> endpoint_send_event );
861824 }
862825 break ;
863826 default :
864827 BTL_ERROR (("invalid connection state (%d)" , btl_endpoint -> endpoint_state ));
865- #if GB_DEFINED
866- opal_output (0 , "%s:%d remove the send event on socket %d\n" ,
867- __FILE__ , __LINE__ , sd ); /* GB */
868- #endif /* GB_DEFINED */
869828 opal_event_del (& btl_endpoint -> endpoint_send_event );
870829 break ;
871830 }
0 commit comments