@@ -327,19 +327,20 @@ int orte_rml_ofi_recv_handler(struct fi_cq_data_entry *wc, uint8_t conduit_id)
327
327
static void send_msg (int fd , short args , void * cbdata )
328
328
{
329
329
orte_rml_send_request_t * req = (orte_rml_send_request_t * )cbdata ;
330
- orte_process_name_t * peer = & (req -> send .dst );
331
- orte_rml_tag_t tag = req -> send .tag ;
332
- char * dest_ep_name ;
333
- size_t dest_ep_namelen = 0 ;
334
- int ret = OPAL_ERROR ;
330
+ orte_process_name_t * peer = & (req -> send .dst );
331
+ orte_rml_tag_t tag = req -> send .tag ;
332
+ char * dest_ep_name ;
333
+ size_t dest_ep_namelen = 0 ;
334
+ int ret = OPAL_ERROR ;
335
335
uint32_t total_packets ;
336
- fi_addr_t dest_fi_addr ;
337
- orte_rml_send_t * snd ;
338
- orte_rml_ofi_request_t * ofi_send_req = OBJ_NEW ( orte_rml_ofi_request_t );
339
- uint8_t conduit_id = req -> conduit_id ;
336
+ fi_addr_t dest_fi_addr ;
337
+ orte_rml_send_t * snd ;
338
+ orte_rml_ofi_request_t * ofi_send_req = OBJ_NEW ( orte_rml_ofi_request_t );
339
+ uint8_t conduit_id = req -> conduit_id ;
340
340
orte_rml_ofi_send_pkt_t * ofi_msg_pkt ;
341
341
size_t datalen_per_pkt , hdrsize , data_in_pkt ; // the length of data in per packet excluding the header size
342
342
343
+
343
344
snd = OBJ_NEW (orte_rml_send_t );
344
345
snd -> dst = * peer ;
345
346
snd -> origin = * ORTE_PROC_MY_NAME ;
@@ -367,20 +368,29 @@ static void send_msg(int fd, short args, void *cbdata)
367
368
{
368
369
case FI_SOCKADDR_IN :
369
370
OPAL_MODEX_RECV_STRING (ret , OPAL_RML_OFI_FI_SOCKADDR_IN , peer , (char * * ) & dest_ep_name , & dest_ep_namelen );
371
+ /*print the sockaddr - port and s_addr */
372
+ struct sockaddr_in * ep_sockaddr = (struct sockaddr_in * ) dest_ep_name ;
373
+ opal_output_verbose (10 ,orte_rml_base_framework .framework_output ,
374
+ "%s obtained for peer %s port = 0x%printinx, InternetAddr = %s " ,
375
+ ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),ORTE_NAME_PRINT (peer ),ntohs (ep_sockaddr -> sin_port ),
376
+ inet_ntoa (ep_sockaddr -> sin_addr ));
370
377
break ;
371
378
case FI_ADDR_PSMX :
372
379
OPAL_MODEX_RECV_STRING (ret , OPAL_RML_OFI_FI_ADDR_PSMX , peer , (char * * ) & dest_ep_name , & dest_ep_namelen );
373
380
break ;
381
+ default :
382
+ /* we shouldn't be getting here as only above are supported and address sent
383
+ * to PMIX (OPAL_MODEX_SEND) in orte_component_init() */
384
+ opal_output_verbose (1 , orte_rml_base_framework .framework_output ,
385
+ "%s Error: Unhandled address format type in ofi_send_msg" , ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ));
386
+ snd -> status = ORTE_ERR_ADDRESSEE_UNKNOWN ;
387
+ ORTE_RML_SEND_COMPLETE (snd );
388
+ return ;
374
389
}
375
- opal_output_verbose (10 , orte_rml_base_framework .framework_output ,
390
+ opal_output_verbose (50 , orte_rml_base_framework .framework_output ,
376
391
"%s Return value from OPAL_MODEX_RECV_STRING - %d, length returned - %d" ,
377
392
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ), ret , dest_ep_namelen );
378
- /*print the sockaddr - port and s_addr */
379
- struct sockaddr_in * ep_sockaddr = (struct sockaddr_in * ) dest_ep_name ;
380
- opal_output_verbose (1 ,orte_rml_base_framework .framework_output ,
381
- "%s obtained for peer %s port = 0x%x, InternetAddr = 0x%x " ,
382
- ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),ORTE_NAME_PRINT (peer ),ep_sockaddr -> sin_port ,
383
- ep_sockaddr -> sin_addr .s_addr );
393
+
384
394
385
395
if ( OPAL_SUCCESS == ret ) {
386
396
opal_output_verbose (10 , orte_rml_base_framework .framework_output ,
@@ -395,8 +405,8 @@ static void send_msg(int fd, short args, void *cbdata)
395
405
/* call the send-callback fn with error and return, also return failure status */
396
406
snd -> status = ORTE_ERR_ADDRESSEE_UNKNOWN ;
397
407
ORTE_RML_SEND_COMPLETE (snd );
398
- snd = NULL ;
399
408
//OBJ_RELEASE( ofi_send_req);
409
+ return ;
400
410
}
401
411
402
412
} else {
@@ -408,8 +418,8 @@ static void send_msg(int fd, short args, void *cbdata)
408
418
/* call the send-callback fn with error and return, also return failure status */
409
419
snd -> status = ORTE_ERR_ADDRESSEE_UNKNOWN ;
410
420
ORTE_RML_SEND_COMPLETE (snd );
411
- snd = NULL ;
412
421
//OBJ_RELEASE( ofi_send_req);
422
+ return ;
413
423
}
414
424
415
425
ofi_send_req -> send = snd ;
@@ -562,7 +572,7 @@ int orte_rml_ofi_send_transport_nb(int conduit_id,
562
572
ORTE_NAME_PRINT (peer ), tag );
563
573
564
574
565
- if ( (0 > conduit_id ) || ( conduit_id > orte_rml_ofi .conduit_open_num ) ) {
575
+ if ( (0 > conduit_id ) || ( conduit_id >= orte_rml_ofi .conduit_open_num ) ) {
566
576
/* Invalid conduit ID provided */
567
577
ORTE_ERROR_LOG (ORTE_ERR_BAD_PARAM );
568
578
return ORTE_ERR_BAD_PARAM ;
@@ -614,7 +624,7 @@ int orte_rml_ofi_send_buffer_transport_nb(int conduit_id,
614
624
ORTE_NAME_PRINT (peer ), tag );
615
625
616
626
617
- if ( (0 > conduit_id ) || ( conduit_id > orte_rml_ofi .conduit_open_num ) ) {
627
+ if ( (0 > conduit_id ) || ( conduit_id >= orte_rml_ofi .conduit_open_num ) ) {
618
628
/* Invalid conduit ID provided */
619
629
ORTE_ERROR_LOG (ORTE_ERR_BAD_PARAM );
620
630
return ORTE_ERR_BAD_PARAM ;
0 commit comments