Skip to content

Commit

Permalink
Merge pull request #6064 from bureddy/v1.10.x
Browse files Browse the repository at this point in the history
UCP/MEM_TYPE: Adjust mem type zcopy thresh if user sets UCX_ZCOPY_THRESH - v1.10.x
  • Loading branch information
yosefe authored Dec 29, 2020
2 parents 6ff702f + d284685 commit 102a97e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ucp/core/ucp_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,7 @@ static void ucp_ep_config_init_attrs(ucp_worker_t *worker, ucp_rsc_index_t rsc_i
uct_iface_attr_t *iface_attr;
size_t it;
size_t zcopy_thresh;
size_t mem_type_zcopy_thresh;
int mem_type;

iface_attr = ucp_worker_iface_get_attr(worker, rsc_index);
Expand Down Expand Up @@ -1528,6 +1529,7 @@ static void ucp_ep_config_init_attrs(ucp_worker_t *worker, ucp_rsc_index_t rsc_i

if (context->config.ext.zcopy_thresh == UCS_MEMUNITS_AUTO) {
config->zcopy_auto_thresh = 1;
mem_type_zcopy_thresh = 1;
for (it = 0; it < UCP_MAX_IOV; ++it) {
zcopy_thresh = ucp_ep_config_get_zcopy_auto_thresh(
it + 1, &md_attr->reg_cost, context,
Expand All @@ -1541,6 +1543,7 @@ static void ucp_ep_config_init_attrs(ucp_worker_t *worker, ucp_rsc_index_t rsc_i
config->zcopy_auto_thresh = 0;
config->sync_zcopy_thresh[0] = config->zcopy_thresh[0] =
ucs_min(context->config.ext.zcopy_thresh, adjust_min_val);
mem_type_zcopy_thresh = config->zcopy_thresh[0];

/* adjust max_short if zcopy_thresh is set externally */
ucp_ep_config_adjust_max_short(&config->max_short,
Expand All @@ -1551,7 +1554,7 @@ static void ucp_ep_config_init_attrs(ucp_worker_t *worker, ucp_rsc_index_t rsc_i
if (UCP_MEM_IS_HOST(mem_type)) {
config->mem_type_zcopy_thresh[mem_type] = config->zcopy_thresh[0];
} else if (md_attr->cap.reg_mem_types & UCS_BIT(mem_type)) {
config->mem_type_zcopy_thresh[mem_type] = 1;
config->mem_type_zcopy_thresh[mem_type] = mem_type_zcopy_thresh;
}
}
}
Expand Down

0 comments on commit 102a97e

Please sign in to comment.