@@ -258,7 +258,7 @@ static size_t mca_btl_uct_tl_modex_size(mca_btl_uct_tl_t *tl)
258
258
259
259
static size_t mca_btl_uct_module_modex_size (mca_btl_uct_module_t * module )
260
260
{
261
- size_t modex_size = 4 + strlen (module -> md_name ) + 1 ;
261
+ size_t modex_size = 4 + strlen (module -> md -> md_name ) + 1 ;
262
262
263
263
if (module -> rdma_tl ) {
264
264
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
307
307
308
308
static uint8_t * mca_btl_uct_modex_pack (mca_btl_uct_module_t * module , uint8_t * modex_data )
309
309
{
310
- size_t name_len = strlen (module -> md_name );
310
+ size_t name_len = strlen (module -> md -> md_name );
311
311
312
312
/* pack the size */
313
313
* ((uint32_t * ) modex_data ) = (uint32_t ) mca_btl_uct_module_modex_size (module );
314
314
315
315
modex_data += 4 ;
316
316
317
- strcpy ((char * ) modex_data , module -> md_name );
317
+ strcpy ((char * ) modex_data , module -> md -> md_name );
318
318
modex_data += name_len + 1 ;
319
319
320
320
if (module -> rdma_tl ) {
@@ -366,7 +366,7 @@ static int mca_btl_uct_modex_send(void)
366
366
return rc ;
367
367
}
368
368
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 ,
370
370
size_t registration_size )
371
371
{
372
372
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
389
389
OBJ_CONSTRUCT (& module -> lock , opal_recursive_mutex_t );
390
390
391
391
module -> md = md ;
392
- module -> md_name = strdup (md_name );
393
392
module -> super .btl_registration_handle_size = registration_size ;
394
393
395
394
return module ;
@@ -463,25 +462,26 @@ static int mca_btl_uct_component_process_uct_md(uct_md_resource_desc_t *md_desc)
463
462
}
464
463
465
464
md = OBJ_NEW (mca_btl_uct_md_t );
465
+ md -> md_name = strdup (md_desc -> md_name );
466
466
467
467
#if UCT_API >= UCT_VERSION (1 , 7 )
468
468
ucs_status = uct_md_config_read (component , NULL , NULL , & uct_config );
469
469
if (UCS_OK != ucs_status ) {
470
470
BTL_VERBOSE (("uct_md_config_read failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
471
471
return OPAL_ERR_NOT_AVAILABLE ;
472
472
}
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 );
474
474
if (UCS_OK != ucs_status ) {
475
475
BTL_VERBOSE (("uct_md_open failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
476
476
return OPAL_ERR_NOT_AVAILABLE ;
477
477
}
478
478
#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 );
480
480
if (UCS_OK != ucs_status ) {
481
481
BTL_VERBOSE (("uct_md_config_read failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
482
482
return OPAL_ERR_NOT_AVAILABLE ;
483
483
}
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 );
485
485
if (UCS_OK != ucs_status ) {
486
486
BTL_VERBOSE (("uct_md_open failed %d (%s)" , ucs_status , ucs_status_string (ucs_status )));
487
487
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)
500
500
return OPAL_ERR_NOT_AVAILABLE ;
501
501
}
502
502
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 );
504
504
if (NULL == module ) {
505
505
uct_release_tl_resource_list (tl_desc );
506
506
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)
517
517
OBJ_RELEASE (md );
518
518
519
519
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 ));
521
521
mca_btl_uct_finalize (& module -> super );
522
522
return OPAL_ERR_NOT_AVAILABLE ;
523
523
}
@@ -534,7 +534,7 @@ static int mca_btl_uct_component_process_uct_md(uct_md_resource_desc_t *md_desc)
534
534
/* NTH: a registration cache shouldn't be necessary when using UCT but there are measurable
535
535
* performance benefits to using rcache/grdma instead of assuming UCT will do the right
536
536
* thing. */
537
- (void ) opal_asprintf (& tmp , "uct.%s" , module -> md_name );
537
+ (void ) opal_asprintf (& tmp , "uct.%s" , md -> md_name );
538
538
539
539
rcache_resources .cache_name = tmp ;
540
540
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)
553
553
}
554
554
} else {
555
555
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 ));
557
557
mca_btl_uct_component .conn_module = module ;
558
558
} else {
559
559
mca_btl_uct_finalize (& module -> super );
@@ -635,7 +635,7 @@ static void mca_btl_uct_component_validate_modules(void) {
635
635
&& NULL == module -> conn_tl ) {
636
636
/* module can not be used */
637
637
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 ));
639
639
mca_btl_uct_finalize (& mca_btl_uct_component .modules [i ]-> super );
640
640
mca_btl_uct_component .modules [i ] = NULL ;
641
641
}
0 commit comments