@@ -23,16 +23,17 @@ ucp_proto_rndv_ctrl_get_md_map(const ucp_proto_rndv_ctrl_init_params_t *params,
2323{
2424 ucp_context_h context = params -> super .super .worker -> context ;
2525 const ucp_ep_config_key_t * ep_config_key = params -> super .super .ep_config_key ;
26- ucp_rsc_index_t mem_sys_dev , ep_sys_dev ;
26+ ucp_rsc_index_t mem_sys_dev = params -> super .reg_mem_info .sys_dev ;
27+ ucp_rsc_index_t ep_sys_dev ;
2728 const uct_iface_attr_t * iface_attr ;
2829 const uct_md_attr_v2_t * md_attr ;
2930 const uct_component_attr_t * cmpt_attr ;
3031 ucp_md_index_t md_index ;
3132 ucp_lane_index_t lane ;
3233 ucs_status_t status ;
3334
34- /* md_map is all lanes which support get_zcopy on the given mem_type and
35- * require remote key
35+ /* md_map is all lanes which support get_zcopy on the given mem_type,
36+ * require remote key and can reach memory sys_dev
3637 */
3738 * md_map = 0 ;
3839 * sys_dev_map = 0 ;
@@ -76,6 +77,11 @@ ucp_proto_rndv_ctrl_get_md_map(const ucp_proto_rndv_ctrl_init_params_t *params,
7677 continue ;
7778 }
7879
80+ /* Check reachability between mem_sys_dev and current lane's sys_dev */
81+ if (!ucs_topo_is_reachable (ep_sys_dev , mem_sys_dev )) {
82+ continue ;
83+ }
84+
7985 ucs_trace_req ("lane[%d]: selected md %s index %u" , lane ,
8086 context -> tl_mds [md_index ].rsc .md_name , md_index );
8187 * md_map |= UCS_BIT (md_index );
@@ -87,7 +93,6 @@ ucp_proto_rndv_ctrl_get_md_map(const ucp_proto_rndv_ctrl_init_params_t *params,
8793 * sys_dev_map |= UCS_BIT (ep_sys_dev );
8894 }
8995
90- mem_sys_dev = params -> super .reg_mem_info .sys_dev ;
9196 ucs_for_each_bit (ep_sys_dev , * sys_dev_map ) {
9297 status = ucs_topo_get_distance (mem_sys_dev , ep_sys_dev , sys_distance );
9398 ucs_assertv_always (status == UCS_OK , "mem_info->sys_dev=%d sys_dev=%d" ,
0 commit comments