Skip to content

Commit

Permalink
WIREUP: exclude ep_check lanes where KA supported from map
Browse files Browse the repository at this point in the history
- exclude from ep_check map lanes where built-in keepalive
  feature is supported
- updated ep-check gtests to disable built-in keepalive
  • Loading branch information
Sergey Oblomov committed Dec 17, 2020
1 parent 50c10f2 commit 94a1f3e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
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;

/* exclude from ep_check map all devices where built-in
* keepalive is supported - mark all such devices as used */
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);
}
}

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

0 comments on commit 94a1f3e

Please sign in to comment.