@@ -156,6 +156,10 @@ static void mca_btl_uct_tl_destructor(mca_btl_uct_tl_t *tl)
156156 }
157157 }
158158
159+ if (tl -> ucs_async ) {
160+ ucs_async_context_destroy (tl -> ucs_async );
161+ }
162+
159163 if (tl -> uct_md ) {
160164 OBJ_RELEASE (tl -> uct_md );
161165 }
@@ -291,7 +295,7 @@ static int mca_btl_uct_populate_tl_attr(mca_btl_uct_module_t *module, mca_btl_uc
291295
292296 /* do the bare minimum to get tl attributes */
293297 uct_worker_h uct_worker ;
294- ucs_status = uct_worker_create (module -> ucs_async , UCS_THREAD_MODE_SINGLE , & uct_worker );
298+ ucs_status = uct_worker_create (tl -> ucs_async , UCS_THREAD_MODE_SINGLE , & uct_worker );
295299 if (OPAL_UNLIKELY (UCS_OK != ucs_status )) {
296300 BTL_VERBOSE (("could not create a UCT worker" ));
297301 return OPAL_ERROR ;
@@ -364,7 +368,7 @@ mca_btl_uct_device_context_t *mca_btl_uct_context_create(mca_btl_uct_module_t *m
364368 * use our own locks just go ahead and use UCS_THREAD_MODE_SINGLE. if they ever fix their
365369 * api then change this back to UCS_THREAD_MODE_MULTI and remove the locks around the
366370 * various UCT calls. */
367- ucs_status = uct_worker_create (module -> ucs_async , UCS_THREAD_MODE_SINGLE , & context -> uct_worker );
371+ ucs_status = uct_worker_create (tl -> ucs_async , UCS_THREAD_MODE_SINGLE , & context -> uct_worker );
368372 if (OPAL_UNLIKELY (UCS_OK != ucs_status )) {
369373 BTL_VERBOSE (("could not create a UCT worker" ));
370374 mca_btl_uct_context_destroy (context );
@@ -437,6 +441,13 @@ static mca_btl_uct_tl_t *mca_btl_uct_create_tl(mca_btl_uct_module_t *module, mca
437441
438442 (void ) uct_md_iface_config_read (md -> uct_md , tl_desc -> tl_name , NULL , NULL , & tl -> uct_tl_config );
439443
444+ ucs_status_t ucs_status = ucs_async_context_create (UCS_ASYNC_MODE_THREAD , & tl -> ucs_async );
445+ if (UCS_OK != ucs_status ) {
446+ BTL_VERBOSE (("Could not create a UCT async context" ));
447+ OBJ_RELEASE (tl );
448+ return NULL ;
449+ }
450+
440451 int rc = mca_btl_uct_populate_tl_attr (module , tl );
441452 if (OPAL_UNLIKELY (OPAL_SUCCESS != rc )) {
442453 OBJ_RELEASE (tl );
0 commit comments