ucp_md_map_t ucp_ep_config_get_amo_md_map(const ucp_ep_config_key_t *key, ucp_lane_index_t lane) { ucp_lane_index_t amo_lane= ucp_ep_get_amo_lane_index(key, lane); if (amo_lane != UCP_NULL_LANE) { return ucp_lane_map_get_lane(key->amo_lane_map, amo_lane); } else { return 0; } }
static ucs_status_t ucp_wireup_connect_local(ucp_ep_h ep, const uint8_t *tli, unsigned address_count, const ucp_address_entry_t *address_list) { ucp_worker_h worker = ep->worker; const ucp_address_entry_t *address; ucp_rsc_index_t rsc_index; ucp_lane_index_t lane, amo_index; ucs_status_t status; ucp_md_map_t UCS_V_UNUSED md_map; ucs_trace("ep %p: connect local transports", ep); for (lane = 0; lane < ucp_ep_num_lanes(ep); ++lane) { rsc_index = ucp_ep_get_rsc_index(ep, lane); if (!ucp_worker_is_tl_p2p(worker, rsc_index)) { continue; } address = &address_list[tli[lane]]; ucs_assert(address->tl_addr_len > 0); /* Check that if the lane is used for RMA/AMO, destination md index matches */ md_map = ucp_lane_map_get_lane(ucp_ep_config(ep)->key.rma_lane_map, lane); ucs_assertv((md_map == 0) || (md_map == UCS_BIT(address->md_index)), "lane=%d ai=%d md_map=0x%x md_index=%d", lane, tli[lane], md_map, address->md_index); amo_index = ucp_ep_get_amo_lane_index(&ucp_ep_config(ep)->key, lane); if (amo_index != UCP_NULL_LANE) { md_map = ucp_lane_map_get_lane(ucp_ep_config(ep)->key.amo_lane_map, amo_index); ucs_assertv((md_map == 0) || (md_map == UCS_BIT(address->md_index)), "lane=%d ai=%d md_map=0x%x md_index=%d", lane, tli[lane], md_map, address->md_index); } status = uct_ep_connect_to_ep(ep->uct_eps[lane], address->dev_addr, address->ep_addr); if (status != UCS_OK) { return status; } } return UCS_OK; }
static void ucp_wireup_print_config(ucp_context_h context, const ucp_ep_config_key_t *key, const char *title, uint8_t *addr_indices) { char lane_info[128], *p, *endp; ucp_lane_index_t lane, amo_index; ucp_rsc_index_t rsc_index; ucp_md_map_t md_map; if (!ucs_log_enabled(UCS_LOG_LEVEL_DEBUG)) { return; } ucs_debug("%s: am_lane %d wirep_lane %d rma_lane_map 0x%"PRIx64 " amo_lane_map 0x%"PRIx64" reachable_mds 0x%x", title, key->am_lane, key->wireup_msg_lane, key->rma_lane_map, key->amo_lane_map, key->reachable_md_map); for (lane = 0; lane < key->num_lanes; ++lane) { p = lane_info; endp = lane_info + sizeof(lane_info); rsc_index = key->lanes[lane]; if (addr_indices != NULL) { snprintf(p, endp - p, "->addr[%d] ", addr_indices[lane]); p += strlen(p); } if (key->am_lane == lane) { snprintf(p, endp - p, "[am]"); p += strlen(p); } md_map = ucp_lane_map_get_lane(key->rma_lane_map, lane); if (md_map) { snprintf(p, endp - p, "[rma->md%d]", ucs_ffs64(md_map)); p += strlen(p); } amo_index = ucp_ep_get_amo_lane_index(key, lane); if (amo_index != UCP_NULL_LANE) { md_map = ucp_lane_map_get_lane(key->amo_lane_map, amo_index); if (md_map) { snprintf(p, endp - p, "[amo[%d]->md%d]", amo_index, ucs_ffs64(md_map)); p += strlen(p); } } if (key->wireup_msg_lane == lane) { snprintf(p, endp - p, "[wireup]"); p += strlen(p); } ucs_debug("%s: lane[%d] using rsc[%d] "UCT_TL_RESOURCE_DESC_FMT " %s", title, lane, rsc_index, UCT_TL_RESOURCE_DESC_ARG(&context->tl_rscs[rsc_index].tl_rsc), lane_info); } }