2929#include "opal/mca/btl/base/base.h"
3030#include "opal/mca/hwloc/base/base.h"
3131#include "opal/util/argv.h"
32+ #include "opal/memoryhooks/memory.h"
33+ #include "opal/mca/memory/base/base.h"
34+ #include <ucm/api/ucm.h>
35+
3236#include "opal/util/printf.h"
3337
3438#include <string.h>
@@ -49,13 +53,13 @@ static int mca_btl_uct_component_register(void)
4953 MCA_BASE_VAR_FLAG_SETTABLE , OPAL_INFO_LVL_3 , MCA_BASE_VAR_SCOPE_LOCAL ,
5054 & mca_btl_uct_component .memory_domains );
5155
52- mca_btl_uct_component .allowed_transports = "any" ;
56+ mca_btl_uct_component .allowed_transports = "dc_mlx5,rc_mlx5,ud, any" ;
5357 (void ) mca_base_component_var_register (& mca_btl_uct_component .super .btl_version ,
54- "transports" , "Comma-delimited list of transports of the form to use. "
55- " The list of transports available can be queried using ucx_info. Special"
56- "values: any (any available) (default: any)" , MCA_BASE_VAR_TYPE_STRING ,
57- NULL , 0 , MCA_BASE_VAR_FLAG_SETTABLE , OPAL_INFO_LVL_3 , MCA_BASE_VAR_SCOPE_LOCAL ,
58- & mca_btl_uct_component .allowed_transports );
58+ "transports" , "Comma-delimited list of transports to use sorted by increasing "
59+ "priority. The list of transports available can be queried using ucx_info. Special"
60+ "values: any (any available) (default: dc_mlx5,rc_mlx5,ud, any)" ,
61+ MCA_BASE_VAR_TYPE_STRING , NULL , 0 , MCA_BASE_VAR_FLAG_SETTABLE , OPAL_INFO_LVL_3 ,
62+ MCA_BASE_VAR_SCOPE_LOCAL , & mca_btl_uct_component .allowed_transports );
5963
6064 mca_btl_uct_component .num_contexts_per_module = 0 ;
6165 (void ) mca_base_component_var_register (& mca_btl_uct_component .super .btl_version ,
@@ -95,6 +99,11 @@ static int mca_btl_uct_component_register(void)
9599 & module -> super );
96100}
97101
102+ static void mca_btl_uct_mem_release_cb (void * buf , size_t length , void * cbdata , bool from_alloc )
103+ {
104+ ucm_vm_munmap (buf , length );
105+ }
106+
98107static int mca_btl_uct_component_open (void )
99108{
100109 if (0 == mca_btl_uct_component .num_contexts_per_module ) {
@@ -114,6 +123,15 @@ static int mca_btl_uct_component_open(void)
114123 }
115124 }
116125
126+ if (mca_btl_uct_component .num_contexts_per_module > MCA_BTL_UCT_MAX_WORKERS ) {
127+ mca_btl_uct_component .num_contexts_per_module = MCA_BTL_UCT_MAX_WORKERS ;
128+ }
129+
130+ if (mca_btl_uct_component .disable_ucx_memory_hooks ) {
131+ ucm_set_external_event (UCM_EVENT_VM_UNMAPPED );
132+ opal_mem_hooks_register_release (mca_btl_uct_mem_release_cb , NULL );
133+ }
134+
117135 return OPAL_SUCCESS ;
118136}
119137
@@ -123,6 +141,10 @@ static int mca_btl_uct_component_open(void)
123141 */
124142static int mca_btl_uct_component_close (void )
125143{
144+ if (mca_btl_uct_component .disable_ucx_memory_hooks ) {
145+ opal_mem_hooks_unregister_release (mca_btl_uct_mem_release_cb );
146+ }
147+
126148 return OPAL_SUCCESS ;
127149}
128150
@@ -249,7 +271,6 @@ static mca_btl_uct_module_t *mca_btl_uct_alloc_module (const char *md_name, mca_
249271 OBJ_CONSTRUCT (& module -> short_frags , opal_free_list_t );
250272 OBJ_CONSTRUCT (& module -> eager_frags , opal_free_list_t );
251273 OBJ_CONSTRUCT (& module -> max_frags , opal_free_list_t );
252- OBJ_CONSTRUCT (& module -> rdma_completions , opal_free_list_t );
253274 OBJ_CONSTRUCT (& module -> pending_frags , opal_list_t );
254275 OBJ_CONSTRUCT (& module -> lock , opal_mutex_t );
255276
0 commit comments