Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UCP/MEM_TYPE: Adjust mem type zcopy thresh if user sets UCX_ZCOPY_THRESH - v1.10.x #6064

Merged
merged 1 commit into from
Dec 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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