@@ -160,7 +160,6 @@ static void mca_btl_uct_tl_destructor(mca_btl_uct_tl_t *tl)
160160 OBJ_RELEASE (tl -> uct_md );
161161 }
162162
163- free (tl -> uct_dev_contexts );
164163 free (tl -> uct_tl_name );
165164 free (tl -> uct_dev_name );
166165
@@ -246,7 +245,10 @@ static int mca_btl_uct_setup_connection_tl(mca_btl_uct_module_t *module)
246245 return OPAL_ERR_NOT_SUPPORTED ;
247246 }
248247
249- ucs_status = uct_iface_set_am_handler (module -> conn_tl -> uct_dev_contexts [0 ]-> uct_iface ,
248+ mca_btl_uct_device_context_t * context = mca_btl_uct_module_get_tl_context_specific (module , module -> conn_tl ,
249+ /*context_id=*/ 0 );
250+
251+ ucs_status = uct_iface_set_am_handler (context -> uct_iface ,
250252 MCA_BTL_UCT_CONNECT_RDMA , mca_btl_uct_conn_req_cb , module ,
251253 UCT_CB_FLAG_ASYNC );
252254 if (UCS_OK != ucs_status ) {
@@ -377,7 +379,7 @@ mca_btl_uct_device_context_t *mca_btl_uct_context_create(mca_btl_uct_module_t *m
377379 return NULL ;
378380 }
379381
380- if (context_id > 0 && tl == module -> am_tl ) {
382+ if (tl == module -> am_tl ) {
381383 BTL_VERBOSE (("installing AM handler for tl %p context id %d" , (void * ) tl , context_id ));
382384 uct_iface_set_am_handler (context -> uct_iface , MCA_BTL_UCT_FRAG , mca_btl_uct_am_handler ,
383385 context , MCA_BTL_UCT_CB_FLAG_SYNC );
@@ -433,12 +435,6 @@ static mca_btl_uct_tl_t *mca_btl_uct_create_tl(mca_btl_uct_module_t *module, mca
433435 tl -> uct_dev_name = strdup (tl_desc -> dev_name );
434436 tl -> priority = priority ;
435437
436- tl -> uct_dev_contexts = calloc (MCA_BTL_UCT_MAX_WORKERS , sizeof (tl -> uct_dev_contexts [0 ]));
437- if (NULL == tl -> uct_dev_contexts ) {
438- OBJ_RELEASE (tl );
439- return NULL ;
440- }
441-
442438 (void ) uct_md_iface_config_read (md -> uct_md , tl_desc -> tl_name , NULL , NULL , & tl -> uct_tl_config );
443439
444440 int rc = mca_btl_uct_populate_tl_attr (module , tl );
@@ -491,16 +487,9 @@ static void mca_btl_uct_set_tl_rdma(mca_btl_uct_module_t *module, mca_btl_uct_tl
491487static void mca_btl_uct_set_tl_am (mca_btl_uct_module_t * module , mca_btl_uct_tl_t * tl )
492488{
493489 BTL_VERBOSE (("tl %s is suitable for active-messaging" , tl -> uct_tl_name ));
494-
495- if (module -> rdma_tl == tl ) {
496- module -> shared_endpoints = true;
497- }
498490 module -> am_tl = tl ;
499491 OBJ_RETAIN (tl );
500492
501- uct_iface_set_am_handler (tl -> uct_dev_contexts [0 ]-> uct_iface , MCA_BTL_UCT_FRAG ,
502- mca_btl_uct_am_handler , tl -> uct_dev_contexts [0 ], UCT_CB_FLAG_ASYNC );
503-
504493 tl -> tl_index = (module -> rdma_tl && tl != module -> rdma_tl ) ? 1 : 0 ;
505494 module -> comm_tls [tl -> tl_index ] = tl ;
506495 if (tl -> max_device_contexts <= 1 ) {
@@ -580,12 +569,6 @@ static int mca_btl_uct_evaluate_tl(mca_btl_uct_module_t *module, mca_btl_uct_tl_
580569 module -> super .btl_latency = 1 ;
581570 }
582571
583- if (tl == module -> rdma_tl || tl == module -> am_tl || tl == module -> conn_tl ) {
584- /* make sure progress is enabled on the default context now that we know this TL will be
585- * used */
586- mca_btl_uct_context_enable_progress (tl -> uct_dev_contexts [0 ]);
587- }
588-
589572 return OPAL_SUCCESS ;
590573}
591574
@@ -629,7 +612,6 @@ int mca_btl_uct_query_tls(mca_btl_uct_module_t *module, mca_btl_uct_md_t *md,
629612 OBJ_RELEASE (tl );
630613
631614 if (OPAL_SUCCESS == rc ) {
632- mca_btl_uct_context_enable_progress (tl -> uct_dev_contexts [0 ]);
633615 return OPAL_SUCCESS ;
634616 }
635617
0 commit comments