@@ -227,7 +227,6 @@ ompi_mtl_ofi_add_procs(struct mca_mtl_base_module_t *mtl,
227
227
size_t namelen ;
228
228
int count = 0 ;
229
229
char * ep_name = NULL ;
230
- char * ep_names = NULL ;
231
230
fi_addr_t * fi_addrs = NULL ;
232
231
mca_mtl_ofi_endpoint_t * endpoint = NULL ;
233
232
int num_peers_limit = (1 << ompi_mtl_ofi .num_bits_source_rank ) - 1 ;
@@ -246,15 +245,6 @@ ompi_mtl_ofi_add_procs(struct mca_mtl_base_module_t *mtl,
246
245
goto bail ;
247
246
}
248
247
249
- /**
250
- * Create array of EP names.
251
- */
252
- ep_names = malloc (nprocs * namelen );
253
- if (NULL == ep_names ) {
254
- ret = OMPI_ERROR ;
255
- goto bail ;
256
- }
257
-
258
248
/**
259
249
* Create array of fi_addrs.
260
250
*/
@@ -264,10 +254,10 @@ ompi_mtl_ofi_add_procs(struct mca_mtl_base_module_t *mtl,
264
254
goto bail ;
265
255
}
266
256
267
- /**
268
- * Retrieve the processes' EP names from modex.
269
- */
270
257
for (i = 0 ; i < nprocs ; ++ i ) {
258
+ /**
259
+ * Retrieve the processes' EP name from modex.
260
+ */
271
261
OFI_COMPAT_MODEX_RECV (ret ,
272
262
& mca_mtl_ofi_component .super .mtl_version ,
273
263
procs [i ],
@@ -281,19 +271,18 @@ ompi_mtl_ofi_add_procs(struct mca_mtl_base_module_t *mtl,
281
271
free (errhost );
282
272
goto bail ;
283
273
}
284
- memcpy (& ep_names [i * namelen ], ep_name , namelen );
285
- }
286
274
287
- /**
288
- * Map the EP names to fi_addrs.
289
- */
290
- count = fi_av_insert (ompi_mtl_ofi .av , ep_names , nprocs , fi_addrs , 0 , NULL );
291
- if ((count < 0 ) || (nprocs != (size_t )count )) {
292
- opal_output_verbose (1 , opal_common_ofi .output ,
293
- "%s:%d: fi_av_insert failed: %d\n" ,
294
- __FILE__ , __LINE__ , count );
295
- ret = OMPI_ERROR ;
296
- goto bail ;
275
+ /**
276
+ * Map the EP name to fi_addr.
277
+ */
278
+ count = fi_av_insert (ompi_mtl_ofi .av , ep_name , 1 , & fi_addrs [i ], 0 , NULL );
279
+ if ((count < 0 ) || (1 != (size_t )count )) {
280
+ opal_output_verbose (1 , opal_common_ofi .output ,
281
+ "%s:%d: fi_av_insert failed for address %s: %d\n" ,
282
+ __FILE__ , __LINE__ , ep_name , count );
283
+ ret = OMPI_ERROR ;
284
+ goto bail ;
285
+ }
297
286
}
298
287
299
288
/**
@@ -326,9 +315,6 @@ ompi_mtl_ofi_add_procs(struct mca_mtl_base_module_t *mtl,
326
315
if (fi_addrs )
327
316
free (fi_addrs );
328
317
329
- if (ep_names )
330
- free (ep_names );
331
-
332
318
return ret ;
333
319
}
334
320
0 commit comments