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

WIREUP: exclude ep_check lanes where KA supported from map #6039

Merged
merged 1 commit into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions src/ucp/wireup/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,22 @@ static void ucp_wireup_init_keepalive_map(ucp_worker_h worker,

dev_map_used = 0;

/* find all devices with built-in keepalive support */
for (lane = 0; lane < key->num_lanes; ++lane) {
rsc_index = key->lanes[lane].rsc_index;
if (rsc_index == UCP_NULL_RESOURCE) {
continue;
}

dev_index = context->tl_rscs[rsc_index].dev_index;
ucs_assert(dev_index < (sizeof(dev_map_used) * 8));
iface_attr = ucp_worker_iface_get_attr(worker, rsc_index);
if (iface_attr->cap.flags & UCT_IFACE_FLAG_EP_KEEPALIVE) {
dev_map_used |= UCS_BIT(dev_index);
}
}

/* send ep_check on devices without built-in keepalive */
for (lane = 0; lane < key->num_lanes; ++lane) {
/* add lanes to ep_check map */
rsc_index = key->lanes[lane].rsc_index;
Expand Down
2 changes: 2 additions & 0 deletions test/gtest/ucp/test_ucp_peer_failure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@ class test_ucp_peer_failure_keepalive : public test_ucp_peer_failure
test_ucp_peer_failure_keepalive() {
m_sbuf.resize(1 * UCS_MBYTE);
m_rbuf.resize(1 * UCS_MBYTE);

m_env.push_back(new ucs::scoped_setenv("UCX_TCP_KEEPIDLE", "inf"));
}

void init() {
Expand Down
7 changes: 7 additions & 0 deletions test/gtest/ucp/test_ucp_wireup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,10 @@ UCP_INSTANTIATE_TEST_CASE_TLS(test_ucp_wireup_asymmetric, ib, "ib")

class test_ucp_wireup_keepalive : public test_ucp_wireup {
public:
test_ucp_wireup_keepalive() {
m_env.push_back(new ucs::scoped_setenv("UCX_TCP_KEEPIDLE", "inf"));
}

static void get_test_variants(std::vector<ucp_test_variant>& variants)
{
test_ucp_wireup::get_test_variants(variants,
Expand All @@ -1445,6 +1449,9 @@ class test_ucp_wireup_keepalive : public test_ucp_wireup {
sender().connect(&receiver(), get_ep_params());
receiver().connect(&sender(), get_ep_params());
}

protected:
ucs::ptr_vector<ucs::scoped_setenv> m_env;
};

/* test if EP has non-empty keepalive lanes mask */
Expand Down
7 changes: 7 additions & 0 deletions test/gtest/uct/test_peer_failure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,10 @@ UCT_INSTANTIATE_TEST_CASE(test_uct_peer_failure_multiple)
class test_uct_peer_failure_keepalive : public test_uct_peer_failure
{
public:
test_uct_peer_failure_keepalive() {
m_env.push_back(new ucs::scoped_setenv("UCX_TCP_KEEPIDLE", "inf"));
}

void kill_receiver()
{
/* Hack: for SHM-based transports we can't really terminate
Expand All @@ -483,6 +487,9 @@ class test_uct_peer_failure_keepalive : public test_uct_peer_failure

test_uct_peer_failure::kill_receiver();
}

protected:
ucs::ptr_vector<ucs::scoped_setenv> m_env;
};

UCS_TEST_SKIP_COND_P(test_uct_peer_failure_keepalive, killed,
Expand Down