55
55
#include "ompi/mca/btl/base/btl_base_error.h"
56
56
#include "ompi/mca/rte/rte.h"
57
57
58
- #include "btl_tcp_endpoint.h"
58
+ #include "btl_tcp_endpoint.h"
59
59
#include "btl_tcp_proc.h"
60
60
#include "btl_tcp_frag.h"
61
61
@@ -160,7 +160,7 @@ void mca_btl_tcp_endpoint_dump(mca_btl_base_endpoint_t* btl_endpoint, const char
160
160
#endif
161
161
162
162
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)" ,
164
164
strerror (opal_socket_errno ), opal_socket_errno ));
165
165
}
166
166
@@ -176,7 +176,7 @@ void mca_btl_tcp_endpoint_dump(mca_btl_base_endpoint_t* btl_endpoint, const char
176
176
#if defined(SO_RCVBUF )
177
177
obtlen = sizeof (rcvbuf );
178
178
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)" ,
180
180
strerror (opal_socket_errno ), opal_socket_errno ));
181
181
}
182
182
#else
@@ -185,15 +185,15 @@ void mca_btl_tcp_endpoint_dump(mca_btl_base_endpoint_t* btl_endpoint, const char
185
185
#if defined(TCP_NODELAY )
186
186
obtlen = sizeof (nodelay );
187
187
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)" ,
189
189
strerror (opal_socket_errno ), opal_socket_errno ));
190
190
}
191
191
#else
192
192
nodelay = 0 ;
193
193
#endif
194
194
}
195
195
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" ,
197
197
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ), msg , (void * )btl_endpoint , src , dst , nodelay , sndbuf , rcvbuf , flags );
198
198
199
199
switch (btl_endpoint -> endpoint_state ) {
@@ -222,7 +222,7 @@ void mca_btl_tcp_endpoint_dump(mca_btl_base_endpoint_t* btl_endpoint, const char
222
222
#endif /* MCA_BTL_TCP_ENDPOINT_CACHE */
223
223
(void * )btl_endpoint -> endpoint_send_frag , (void * )btl_endpoint -> endpoint_recv_frag );
224
224
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 );
226
226
item = opal_list_get_next (item )) {
227
227
mca_btl_tcp_dump_frag ( (mca_btl_tcp_frag_t * )item , " | send" );
228
228
}
@@ -239,9 +239,9 @@ static inline void mca_btl_tcp2_endpoint_event_init(mca_btl_base_endpoint_t* btl
239
239
btl_endpoint -> endpoint_cache_pos = btl_endpoint -> endpoint_cache ;
240
240
#endif /* MCA_BTL_TCP_ENDPOINT_CACHE */
241
241
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 ,
245
245
mca_btl_tcp_endpoint_recv_handler ,
246
246
btl_endpoint );
247
247
/**
@@ -250,9 +250,9 @@ static inline void mca_btl_tcp2_endpoint_event_init(mca_btl_base_endpoint_t* btl
250
250
* will be fired only once, and when the endpoint is marked as
251
251
* CONNECTED the event should be recreated with the correct flags.
252
252
*/
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 ,
256
256
mca_btl_tcp_endpoint_send_handler ,
257
257
btl_endpoint );
258
258
}
@@ -291,11 +291,6 @@ int mca_btl_tcp2_endpoint_send(mca_btl_base_endpoint_t* btl_endpoint, mca_btl_tc
291
291
} else {
292
292
btl_endpoint -> endpoint_send_frag = frag ;
293
293
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 */
299
294
MCA_BTL_TCP_ACTIVATE_EVENT (& btl_endpoint -> endpoint_send_event , 0 );
300
295
}
301
296
} else {
@@ -376,7 +371,7 @@ bool mca_btl_tcp2_endpoint_accept(mca_btl_base_endpoint_t* btl_endpoint,
376
371
OPAL_THREAD_LOCK (& btl_endpoint -> endpoint_recv_lock );
377
372
OPAL_THREAD_LOCK (& btl_endpoint -> endpoint_send_lock );
378
373
379
- cmpval = ompi_rte_compare_name_fields (OMPI_RTE_CMP_ALL ,
374
+ cmpval = ompi_rte_compare_name_fields (OMPI_RTE_CMP_ALL ,
380
375
& endpoint_proc -> proc_ompi -> proc_name ,
381
376
this_proc );
382
377
if ((btl_endpoint -> endpoint_sd < 0 ) ||
@@ -394,10 +389,6 @@ bool mca_btl_tcp2_endpoint_accept(mca_btl_base_endpoint_t* btl_endpoint,
394
389
/* NOT NEEDED if we remove the PERSISTENT flag when we create the
395
390
* first recv_event.
396
391
*/
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 */
401
392
opal_event_add (& btl_endpoint -> endpoint_recv_event , 0 ); /* TODO */
402
393
mca_btl_tcp_endpoint_connected (btl_endpoint );
403
394
#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
452
443
btl_endpoint -> endpoint_retries = 0 ;
453
444
454
445
/* 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 ,
457
448
OPAL_EV_WRITE | OPAL_EV_PERSIST ,
458
449
mca_btl_tcp_endpoint_send_handler ,
459
450
btl_endpoint );
@@ -463,10 +454,6 @@ static void mca_btl_tcp2_endpoint_connected(mca_btl_base_endpoint_t* btl_endpoin
463
454
btl_endpoint -> endpoint_send_frag = (mca_btl_tcp_frag_t * )
464
455
opal_list_remove_first (& btl_endpoint -> endpoint_frags );
465
456
}
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 */
470
457
opal_event_add (& btl_endpoint -> endpoint_send_event , 0 );
471
458
}
472
459
}
@@ -618,10 +605,6 @@ static int mca_btl_tcp2_endpoint_start_connect(mca_btl_base_endpoint_t* btl_endp
618
605
/* non-blocking so wait for completion */
619
606
if (opal_socket_errno == EINPROGRESS || opal_socket_errno == EWOULDBLOCK ) {
620
607
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 */
625
608
MCA_BTL_TCP_ACTIVATE_EVENT (& btl_endpoint -> endpoint_send_event , 0 );
626
609
return OMPI_SUCCESS ;
627
610
}
@@ -641,10 +624,6 @@ static int mca_btl_tcp2_endpoint_start_connect(mca_btl_base_endpoint_t* btl_endp
641
624
/* send our globally unique process identifier to the endpoint */
642
625
if ((rc = mca_btl_tcp2_endpoint_send_connect_ack (btl_endpoint )) == OMPI_SUCCESS ) {
643
626
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 */
648
627
MCA_BTL_TCP_ACTIVATE_EVENT (& btl_endpoint -> endpoint_recv_event , 0 );
649
628
} else {
650
629
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_
667
646
mca_btl_tcp2_proc_tosocks (btl_endpoint -> endpoint_addr , & endpoint_addr );
668
647
669
648
/* 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 */
674
649
opal_event_del (& btl_endpoint -> endpoint_send_event );
675
650
676
651
/* check connect completion status */
@@ -682,10 +657,6 @@ static void mca_btl_tcp2_endpoint_complete_connect(mca_btl_base_endpoint_t* btl_
682
657
return ;
683
658
}
684
659
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 */
689
660
opal_event_add (& btl_endpoint -> endpoint_send_event , 0 );
690
661
return ;
691
662
}
@@ -699,10 +670,6 @@ static void mca_btl_tcp2_endpoint_complete_connect(mca_btl_base_endpoint_t* btl_
699
670
700
671
if (mca_btl_tcp2_endpoint_send_connect_ack (btl_endpoint ) == OMPI_SUCCESS ) {
701
672
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 */
706
673
opal_event_add (& btl_endpoint -> endpoint_recv_event , 0 );
707
674
} else {
708
675
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)
752
719
data_still_pending_on_endpoint :
753
720
if (NULL == frag ) {
754
721
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 ) {
757
724
MCA_BTL_TCP_FRAG_ALLOC_MAX (frag );
758
725
} else {
759
726
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)
771
738
btl_endpoint -> endpoint_recv_frag = frag ;
772
739
} else {
773
740
btl_endpoint -> endpoint_recv_frag = NULL ;
774
-
741
+
775
742
TODO_MCA_BTL_TCP_RECV_TRIGGER_CB (frag );
776
743
777
744
#if MCA_BTL_TCP_ENDPOINT_CACHE
@@ -853,19 +820,11 @@ static void mca_btl_tcp2_endpoint_send_handler(int sd, short flags, void* user)
853
820
854
821
/* if no more data to send unregister the send notifications */
855
822
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 */
860
823
opal_event_del (& btl_endpoint -> endpoint_send_event );
861
824
}
862
825
break ;
863
826
default :
864
827
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 */
869
828
opal_event_del (& btl_endpoint -> endpoint_send_event );
870
829
break ;
871
830
}
0 commit comments