10
10
#include "orte_config.h"
11
11
12
12
#include "opal/dss/dss_types.h"
13
+ #include "opal/util/net.h"
13
14
#include "opal/util/output.h"
14
15
#include "opal/mca/event/event.h"
15
16
@@ -369,7 +370,7 @@ int orte_rml_ofi_recv_handler(struct fi_cq_data_entry *wc, uint8_t ofi_prov_id)
369
370
/* populate_peer_ofi_addr
370
371
* [Desc] This fn does a PMIx Modex recv on "rml.ofi" key
371
372
* to get the ofi address blob of all providers on the peer.
372
- * Then it populates the array parameter peer_ofi_addr[]
373
+ * Then it populates the array parameter peer_ofi_addr[]
373
374
* with providername, ofi_ep_name and ofi_ep_namelen
374
375
* [in] peer -> peer address
375
376
* [out] peer_ofi_addr[] -> array to hold the provider details on the peer
@@ -451,18 +452,18 @@ static int populate_peer_ofi_addr(orte_process_name_t *peer, orte_rml_ofi_peer_t
451
452
}
452
453
453
454
454
- /* check_provider_in_peer(prov_name, peer_ofi_addr)
455
+ /* check_provider_in_peer(prov_name, peer_ofi_addr)
455
456
* [Desc] This fn checks for a match of prov_name in the peer_ofi_addr array
456
457
* and returns the index of the match or OPAL_ERROR if not found.
457
458
* The peer_ofi_addr array has all the ofi providers in peer.
458
459
* [in] prov_name -> The provider name we want to use to send this message to peer.
459
460
* [in] tot_prov -> total provider entries in array
460
461
* [in] peer_ofi_addr[] -> array of provider details on the peer
461
- * [in] local_ofi_prov_idx -> the index of local provider we are comparing with
462
+ * [in] local_ofi_prov_idx -> the index of local provider we are comparing with
462
463
* (index into orte_rml_ofi.ofi_prov[] array.
463
464
* [Return value] -> index that matches provider on success. OPAL_ERROR if no match found.
464
465
*/
465
- static int check_provider_in_peer ( char * prov_name , int tot_prov , orte_rml_ofi_peer_t * peer_ofi_addr , int local_ofi_prov_idx )
466
+ static int check_provider_in_peer ( char * prov_name , int tot_prov , orte_rml_ofi_peer_t * peer_ofi_addr , int local_ofi_prov_idx )
466
467
{
467
468
int idx ;
468
469
int ret = OPAL_ERROR ;
@@ -495,7 +496,7 @@ static int check_provider_in_peer( char *prov_name, int tot_prov, orte_rml_ofi_p
495
496
} else {
496
497
ret = idx ;
497
498
break ;
498
- }
499
+ }
499
500
}
500
501
}
501
502
return ret ;
@@ -519,7 +520,7 @@ static void send_msg(int fd, short args, void *cbdata)
519
520
orte_rml_ofi_peer_t * pr ;
520
521
uint64_t ui64 ;
521
522
struct sockaddr_in * ep_sockaddr ;
522
-
523
+
523
524
snd = OBJ_NEW (orte_rml_send_t );
524
525
snd -> dst = * peer ;
525
526
snd -> origin = * ORTE_PROC_MY_NAME ;
@@ -565,19 +566,19 @@ static void send_msg(int fd, short args, void *cbdata)
565
566
return ;
566
567
}
567
568
/* decide the provider we want to use from the list of providers in peer as per below order.
568
- * 1. if the user specified the transport for this conduit (even giving us a prioritized list of candidates),
569
- * then the one we selected is the _only_ one we will use. If the remote peer has a matching endpoint,
569
+ * 1. if the user specified the transport for this conduit (even giving us a prioritized list of candidates),
570
+ * then the one we selected is the _only_ one we will use. If the remote peer has a matching endpoint,
570
571
* then we use it - otherwise, we error out
571
- * 2. if the user did not specify a transport, then we look for matches against _all_ of
572
+ * 2. if the user did not specify a transport, then we look for matches against _all_ of
572
573
* our available transports, starting with fabric and then going to Ethernet, taking the first one that matches.
573
574
* 3. if we cannot find any match, then we error out
574
575
*/
575
576
if ( true == user_override () ) {
576
- /*case 1. User has specified the provider, find a match in peer for the current selected provider or error out*/
577
+ /*case 1. User has specified the provider, find a match in peer for the current selected provider or error out*/
577
578
opal_output_verbose (1 , orte_rml_base_framework .framework_output ,
578
579
"%s rml:ofi::send_msg() Case1. looking for a match for current provider" ,
579
580
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ));
580
- if ( OPAL_ERROR == ( peer_prov_id = check_provider_in_peer ( orte_rml_ofi .ofi_prov [ofi_prov_id ].fabric_info -> fabric_attr -> prov_name ,
581
+ if ( OPAL_ERROR == ( peer_prov_id = check_provider_in_peer ( orte_rml_ofi .ofi_prov [ofi_prov_id ].fabric_info -> fabric_attr -> prov_name ,
581
582
tot_peer_prov , peer_ofi_addr , ofi_prov_id ) )) {
582
583
opal_output_verbose (1 , orte_rml_base_framework .framework_output ,
583
584
"%s rml:ofi::send_msg() Peer is Unreachable - no common ofi provider " ,
@@ -595,8 +596,8 @@ static void send_msg(int fd, short args, void *cbdata)
595
596
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ));
596
597
for (int cur_prov_id = 0 ; cur_prov_id < orte_rml_ofi .ofi_prov_open_num && !peer_match_found ; cur_prov_id ++ ) {
597
598
if ( 0 != strcmp ( orte_rml_ofi .ofi_prov [cur_prov_id ].fabric_info -> fabric_attr -> prov_name , "sockets" ) ) {
598
- peer_prov_id = check_provider_in_peer ( orte_rml_ofi .ofi_prov [cur_prov_id ].fabric_info -> fabric_attr -> prov_name ,
599
- tot_peer_prov , peer_ofi_addr , cur_prov_id );
599
+ peer_prov_id = check_provider_in_peer ( orte_rml_ofi .ofi_prov [cur_prov_id ].fabric_info -> fabric_attr -> prov_name ,
600
+ tot_peer_prov , peer_ofi_addr , cur_prov_id );
600
601
if (OPAL_ERROR != peer_prov_id ) {
601
602
peer_match_found = true;
602
603
ofi_prov_id = cur_prov_id ;
@@ -609,7 +610,7 @@ static void send_msg(int fd, short args, void *cbdata)
609
610
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ));
610
611
for (int cur_prov_id = 0 ; cur_prov_id < orte_rml_ofi .ofi_prov_open_num && !peer_match_found ; cur_prov_id ++ ) {
611
612
if ( 0 == strcmp ( orte_rml_ofi .ofi_prov [cur_prov_id ].fabric_info -> fabric_attr -> prov_name , "sockets" ) ) {
612
- peer_prov_id = check_provider_in_peer ( orte_rml_ofi .ofi_prov [cur_prov_id ].fabric_info -> fabric_attr -> prov_name ,
613
+ peer_prov_id = check_provider_in_peer ( orte_rml_ofi .ofi_prov [cur_prov_id ].fabric_info -> fabric_attr -> prov_name ,
613
614
tot_peer_prov , peer_ofi_addr , cur_prov_id );
614
615
if (OPAL_ERROR != peer_prov_id ) {
615
616
peer_match_found = true;
@@ -628,15 +629,15 @@ static void send_msg(int fd, short args, void *cbdata)
628
629
return ;
629
630
}
630
631
}
631
- /* creating a copy of the chosen provider to put it in hashtable
632
- * as the ofi_peer_addr array is local */
632
+ /* creating a copy of the chosen provider to put it in hashtable
633
+ * as the ofi_peer_addr array is local */
633
634
pr = OBJ_NEW (orte_rml_ofi_peer_t );
634
635
pr -> ofi_ep_len = peer_ofi_addr [peer_prov_id ].ofi_ep_len ;
635
636
pr -> ofi_ep = malloc (pr -> ofi_ep_len );
636
637
memcpy (pr -> ofi_ep ,peer_ofi_addr [peer_prov_id ].ofi_ep ,pr -> ofi_ep_len );
637
638
pr -> ofi_prov_name = strdup (peer_ofi_addr [peer_prov_id ].ofi_prov_name );
638
639
pr -> src_prov_id = ofi_prov_id ;
639
- if (OPAL_SUCCESS !=
640
+ if (OPAL_SUCCESS !=
640
641
(rc = opal_hash_table_set_value_uint64 (& orte_rml_ofi .peers , ui64 , (void * )pr ))) {
641
642
opal_output_verbose (15 , orte_rml_base_framework .framework_output ,
642
643
"%s: ofi address insertion into hash table failed for peer %s " ,
@@ -653,7 +654,7 @@ static void send_msg(int fd, short args, void *cbdata)
653
654
opal_output_verbose (1 , orte_rml_base_framework .framework_output ,
654
655
"%s rml:ofi: OFI peer contact info got from hash table" ,
655
656
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ));
656
- dest_ep_name = pr -> ofi_ep ;
657
+ dest_ep_name = pr -> ofi_ep ;
657
658
dest_ep_namelen = pr -> ofi_ep_len ;
658
659
ofi_prov_id = pr -> src_prov_id ;
659
660
}
0 commit comments