@@ -258,7 +258,7 @@ static size_t mca_btl_uct_tl_modex_size(mca_btl_uct_tl_t *tl)
258258
259259static size_t mca_btl_uct_module_modex_size (mca_btl_uct_module_t * module )
260260{
261- size_t modex_size = 4 + strlen (module -> md_name ) + 1 ;
261+ size_t modex_size = 4 + strlen (module -> md -> md_name ) + 1 ;
262262
263263 if (module -> rdma_tl ) {
264264 modex_size += mca_btl_uct_tl_modex_size (module -> rdma_tl );
@@ -307,14 +307,14 @@ static size_t mca_btl_uct_tl_modex_pack(mca_btl_uct_module_t *module, mca_btl_uc
307307
308308static uint8_t * mca_btl_uct_modex_pack (mca_btl_uct_module_t * module , uint8_t * modex_data )
309309{
310- size_t name_len = strlen (module -> md_name );
310+ size_t name_len = strlen (module -> md -> md_name );
311311
312312 /* pack the size */
313313 * ((uint32_t * ) modex_data ) = (uint32_t ) mca_btl_uct_module_modex_size (module );
314314
315315 modex_data += 4 ;
316316
317- strcpy ((char * ) modex_data , module -> md_name );
317+ strcpy ((char * ) modex_data , module -> md -> md_name );
318318 modex_data += name_len + 1 ;
319319
320320 if (module -> rdma_tl ) {
@@ -366,7 +366,7 @@ static int mca_btl_uct_modex_send(void)
366366 return rc ;
367367}
368368
369- static mca_btl_uct_module_t * mca_btl_uct_alloc_module (const char * md_name , mca_btl_uct_md_t * md ,
369+ static mca_btl_uct_module_t * mca_btl_uct_alloc_module (mca_btl_uct_md_t * md ,
370370 size_t registration_size )
371371{
372372 mca_btl_uct_module_t * module ;
@@ -389,7 +389,6 @@ static mca_btl_uct_module_t *mca_btl_uct_alloc_module(const char *md_name, mca_b
389389 OBJ_CONSTRUCT (& module -> lock , opal_recursive_mutex_t );
390390
391391 module -> md = md ;
392- module -> md_name = strdup (md_name );
393392 module -> super .btl_registration_handle_size = registration_size ;
394393
395394 return module ;
@@ -463,25 +462,26 @@ static int mca_btl_uct_component_process_uct_md(uct_md_resource_desc_t *md_desc)
463462 }
464463
465464 md = OBJ_NEW (mca_btl_uct_md_t );
465+ md -> md_name = strdup (md_desc -> md_name );
466466
467467#if UCT_API >= UCT_VERSION (1 , 7 )
468468 ucs_status = uct_md_config_read (component , NULL , NULL , & uct_config );
469469 if (UCS_OK != ucs_status ) {
470470 BTL_VERBOSE (("uct_md_config_read failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
471471 return OPAL_ERR_NOT_AVAILABLE ;
472472 }
473- ucs_status = uct_md_open (component , md_desc -> md_name , uct_config , & md -> uct_md );
473+ ucs_status = uct_md_open (component , md -> md_name , uct_config , & md -> uct_md );
474474 if (UCS_OK != ucs_status ) {
475475 BTL_VERBOSE (("uct_md_open failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
476476 return OPAL_ERR_NOT_AVAILABLE ;
477477 }
478478#else
479- ucs_status = uct_md_config_read (md_desc -> md_name , NULL , NULL , & uct_config );
479+ ucs_status = uct_md_config_read (md -> md_name , NULL , NULL , & uct_config );
480480 if (UCS_OK != ucs_status ) {
481481 BTL_VERBOSE (("uct_md_config_read failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
482482 return OPAL_ERR_NOT_AVAILABLE ;
483483 }
484- ucs_status = uct_md_open (md_desc -> md_name , uct_config , & md -> uct_md );
484+ ucs_status = uct_md_open (md -> md_name , uct_config , & md -> uct_md );
485485 if (UCS_OK != ucs_status ) {
486486 BTL_VERBOSE (("uct_md_open failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
487487 return OPAL_ERR_NOT_AVAILABLE ;
@@ -500,7 +500,7 @@ static int mca_btl_uct_component_process_uct_md(uct_md_resource_desc_t *md_desc)
500500 return OPAL_ERR_NOT_AVAILABLE ;
501501 }
502502
503- module = mca_btl_uct_alloc_module (md_desc -> md_name , md , md_attr .rkey_packed_size );
503+ module = mca_btl_uct_alloc_module (md , md_attr .rkey_packed_size );
504504 if (NULL == module ) {
505505 uct_release_tl_resource_list (tl_desc );
506506 return OPAL_ERR_OUT_OF_RESOURCE ;
@@ -517,7 +517,7 @@ static int mca_btl_uct_component_process_uct_md(uct_md_resource_desc_t *md_desc)
517517 OBJ_RELEASE (md );
518518
519519 if (NULL == module -> am_tl && NULL == module -> rdma_tl && (NULL == module -> conn_tl || !consider_for_connection_module )) {
520- BTL_VERBOSE (("uct memory domain %s does not have any appropriate tls" , md_desc -> md_name ));
520+ BTL_VERBOSE (("uct memory domain %s does not have any appropriate tls" , md -> md_name ));
521521 mca_btl_uct_finalize (& module -> super );
522522 return OPAL_ERR_NOT_AVAILABLE ;
523523 }
@@ -534,7 +534,7 @@ static int mca_btl_uct_component_process_uct_md(uct_md_resource_desc_t *md_desc)
534534 /* NTH: a registration cache shouldn't be necessary when using UCT but there are measurable
535535 * performance benefits to using rcache/grdma instead of assuming UCT will do the right
536536 * thing. */
537- (void ) opal_asprintf (& tmp , "uct.%s" , module -> md_name );
537+ (void ) opal_asprintf (& tmp , "uct.%s" , md -> md_name );
538538
539539 rcache_resources .cache_name = tmp ;
540540 rcache_resources .reg_data = (void * ) module ;
@@ -553,7 +553,7 @@ static int mca_btl_uct_component_process_uct_md(uct_md_resource_desc_t *md_desc)
553553 }
554554 } else {
555555 if (NULL == mca_btl_uct_component .conn_module ) {
556- BTL_VERBOSE (("memory domain %s may be used for connections" , md_desc -> md_name ));
556+ BTL_VERBOSE (("memory domain %s may be used for connections" , md -> md_name ));
557557 mca_btl_uct_component .conn_module = module ;
558558 } else {
559559 mca_btl_uct_finalize (& module -> super );
@@ -635,7 +635,7 @@ static void mca_btl_uct_component_validate_modules(void) {
635635 && NULL == module -> conn_tl ) {
636636 /* module can not be used */
637637 BTL_VERBOSE (("module for memory domain %s can not be used due to missing connection transport" ,
638- module -> md_name ));
638+ module -> md -> md_name ));
639639 mca_btl_uct_finalize (& mca_btl_uct_component .modules [i ]-> super );
640640 mca_btl_uct_component .modules [i ] = NULL ;
641641 }
0 commit comments