Skip to content

Commit 2217f52

Browse files
committed
Signed-off-by: Anandhi S Jayakumar <[email protected]>
Sending the ethernet address only in the get_contact_info, rest will be sent through modex modified: ../orte/mca/rml/ofi/rml_ofi.h modified: ../orte/mca/rml/ofi/rml_ofi_component.c
1 parent 4d945bd commit 2217f52

File tree

2 files changed

+13
-42
lines changed

2 files changed

+13
-42
lines changed

orte/mca/rml/ofi/rml_ofi.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
#define MULTI_BUF_SIZE_FACTOR 128
4444
#define MIN_MULTI_BUF_SIZE (1024 * 1024)
4545

46-
#define SOCKADDR "ofi-sockaddr"
47-
#define PSMXADDR "ofi-psmxaddr"
46+
#define OFIADDR "ofiaddr"
4847

4948
#define CLOSE_FID(fd) \
5049
do { \

orte/mca/rml/ofi/rml_ofi_component.c

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,53 +1070,31 @@ static char* ofi_get_contact_info(void)
10701070
{
10711071
char *turi, *final=NULL, *tmp, *addrtype;
10721072
int rc=ORTE_SUCCESS, cur_ofi_prov=0;
1073-
size_t len;
10741073
struct sockaddr_in* ep_sockaddr;
10751074

10761075
/* start with our process name */
10771076
if (ORTE_SUCCESS != (rc = orte_util_convert_process_name_to_string(&final, ORTE_PROC_MY_NAME))) {
10781077
/* [TODO] ORTE_ERROR_LOG(rc);*/
10791078
return final;
10801079
}
1081-
len = strlen(final);
10821080

1083-
/* The returned string will be of format - "<process-name>;ofi-socket:<sin_family,sin_addr,sin_port>;ofi-<provider2>:<prov2epname>" */
1081+
/* The returned string will be of format - "<process-name>;ofi-addr:<sin_family,sin_addr,sin_port>;" */
1082+
/* we are sending only the ethernet address */
10841083
for( cur_ofi_prov=0; cur_ofi_prov < orte_rml_ofi.ofi_prov_open_num ; cur_ofi_prov++ ) {
1085-
switch ( orte_rml_ofi.ofi_prov[cur_ofi_prov].fabric_info->addr_format) {
1086-
case FI_SOCKADDR_IN :
1087-
ep_sockaddr = (struct sockaddr_in*)orte_rml_ofi.ofi_prov[cur_ofi_prov].ep_name;
1088-
asprintf(&addrtype, SOCKADDR);
1089-
asprintf(&turi,"%d,%s,%d",ep_sockaddr->sin_family,inet_ntoa(ep_sockaddr->sin_addr),ntohs(ep_sockaddr->sin_port));
1090-
1091-
break;
1092-
case FI_ADDR_PSMX :
1093-
asprintf(&addrtype, PSMXADDR);
1094-
/* [TBD] The ep_name has to be converted to PSMX specific address format struct for printing
1095-
copy the endpoint name as is to length specified - this fails in sprintf as the ep_name is a
1096-
binary content
1097-
turi = calloc(orte_rml_ofi.ofi_prov[cur_ofi_prov].epnamelen + 1, sizeof(char));
1098-
memcpy( turi, orte_rml_ofi.ofi_prov[cur_ofi_prov].ep_name, orte_rml_ofi.ofi_prov[cur_ofi_prov].epnamelen);
1099-
turi[ (orte_rml_ofi.ofi_prov[cur_ofi_prov].epnamelen + 1) ] = '\0';*/
1100-
asprintf(&turi, "psmx addr");
1101-
break;
1102-
default:
1103-
opal_output_verbose(1,orte_rml_base_framework.framework_output,
1104-
"%s:%d ERROR: Cannot register address, Unhandled addr_format - %d",
1105-
__FILE__,__LINE__,orte_rml_ofi.ofi_prov[cur_ofi_prov].fabric_info->addr_format);
1106-
/*abort this current transport, but check next transport */
1107-
continue;
1108-
}
1084+
if ( FI_SOCKADDR_IN == orte_rml_ofi.ofi_prov[cur_ofi_prov].fabric_info->addr_format) {
1085+
ep_sockaddr = (struct sockaddr_in*)orte_rml_ofi.ofi_prov[cur_ofi_prov].ep_name;
1086+
asprintf(&addrtype, OFIADDR);
1087+
asprintf(&turi,"%d,%s,%d",ep_sockaddr->sin_family,inet_ntoa(ep_sockaddr->sin_addr),ntohs(ep_sockaddr->sin_port));
11091088
opal_output_verbose(20,orte_rml_base_framework.framework_output,
1110-
"%s - cur_ofi_prov = %d, addrtype = %s ", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),cur_ofi_prov,addrtype);
1089+
"%s - cur_ofi_prov = %d, addrtype = %s ", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),cur_ofi_prov,addrtype);
11111090
/* Add to the final string - the ofi addrtype and the epname */
11121091
asprintf(&tmp, "%s;%s:%s", final,addrtype, turi);
11131092

11141093
free(addrtype);
11151094
free(turi);
11161095
free(final);
1117-
final = tmp;
1118-
len = strlen(final);
1119-
1096+
final = tmp;
1097+
}
11201098
}
11211099
opal_output_verbose(10,orte_rml_base_framework.framework_output,
11221100
"[%s] get_contact_info returns string - %s ", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),final);
@@ -1216,22 +1194,16 @@ static void process_uri( char *uri)
12161194
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
12171195
continue;
12181196
}
1219-
/* Handle the specific OFI address types in the uri - SOCKADDR(ofi-socket), PSMXADDR etc */
1220-
if (0 == strncmp(ofiuri, SOCKADDR, strlen(SOCKADDR)) ) {
1197+
/* Handle the OFI address types in the uri - OFIADDR(ofiaddr) */
1198+
if (0 == strncmp(ofiuri, OFIADDR, strlen(OFIADDR)) ) {
12211199
/* allocate and initialise the peer object to be inserted in hashtable */
12221200
pr->socket_ep_len = sizeof(struct sockaddr_in);
12231201
ep_sockaddr = malloc( sizeof ( struct sockaddr_in) );
12241202
/* ofiuri for socket provider is of format - ofi-socket:<sin_family,sin_addr,sin_port> */
12251203
convert_to_sockaddr(ofiuri, ep_sockaddr);
12261204
pr->socket_ep = (void *)ep_sockaddr;
12271205
tot_found++;
1228-
} else if ( 0 == strncmp(ofiuri, PSMXADDR, strlen(PSMXADDR)) ){
1229-
pr->psmx_ep_len = strlen(ofiuri) - strlen(PSMXADDR) -1;
1230-
pr->psmx_ep = calloc ( pr->psmx_ep_len , sizeof(char) );
1231-
ep_name = ofiuri + strlen(PSMXADDR) + 1;
1232-
memcpy( pr->psmx_ep, ep_name, pr->psmx_ep_len );
1233-
tot_found++;
1234-
}
1206+
}
12351207
free( ofiuri);
12361208
}
12371209
/* if atleast one OFI address is known for peer insert it */

0 commit comments

Comments
 (0)