Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f7b0e3c
UCP/CORE: Implement flush+destroy for UCT EPs on UCP Worker
dmitrygx Aug 24, 2020
627a8a5
UCP/GTEST: Complete worker_flus operation if there is no flush ops an…
dmitrygx Aug 26, 2020
e9d3b1d
UCT/IB: Fix uct_iface_flush()/uct_ep_flush(LOCAL) after uct_ep_flush(…
dmitrygx Aug 26, 2020
ecd8663
UCT/IB/UD: Reset max_psn instead of stopping TX
dmitrygx Aug 26, 2020
8d4a9f9
UCM/GTEST: Fix leftovers
dmitrygx Aug 27, 2020
d229eae
UCP/WORKER: Introduce khash to find whether UCT EP there or not
dmitrygx Aug 27, 2020
8558d4c
UCP/CORE: Fix Coverity issue
dmitrygx Aug 28, 2020
cdfe88d
UCP/UCT: Fix review comments
dmitrygx Aug 28, 2020
c1a8fee
UCP/CORE: Fix review comments
dmitrygx Aug 31, 2020
28edf67
UCP/CORE: Fix EP-by-EP flush when iface_flush returns NO_RESOURCE
dmitrygx Aug 31, 2020
022a6f2
UCP/RMA/FLUSH: Fix flush ops count check usage
dmitrygx Sep 1, 2020
46b1272
UCP/CORE: Fix tests
dmitrygx Sep 2, 2020
cb197a4
UCP/CORE: Implemented purge
dmitrygx Sep 2, 2020
5d0b3fa
UCP/CORE: Fix bug in purging
dmitrygx Sep 3, 2020
12d1c34
UCP/CORE/GTEST: Fix review comments
dmitrygx Sep 3, 2020
d1ab7d4
GTEST/UCP: Fix review comments
dmitrygx Sep 3, 2020
d809dc1
UCP/CORE/GTEST: Fix bug in purging
dmitrygx Sep 3, 2020
7e6a5b4
Merge remote-tracking branch 'origin/master' into topic/ucp/worker_di…
dmitrygx Sep 3, 2020
a0f759b
UCP/CORE: Fix review comments
dmitrygx Sep 3, 2020
46afaaf
UCP/CORE/WIREUP/GTEST: Fix leak of WIREUP MSG proxy req
dmitrygx Sep 3, 2020
e2982d5
UCP/WIREUP/GTEST: Use pointer to the UCP request to be able free it i…
dmitrygx Sep 4, 2020
7ecd09d
GTEST/UCP: Fix review comments
dmitrygx Sep 4, 2020
9ef1f34
UCP/CORE: Fix review comments
dmitrygx Sep 4, 2020
efdb4d3
GTEST/UCP: Ensure that fluah+pending_add is registered on Worker prog…
dmitrygx Sep 6, 2020
509dd6c
UCP/GTEST: Fix review comments
dmitrygx Sep 7, 2020
07b8bb3
UCP/RMA: Remove flush_ops_count_check
dmitrygx Sep 7, 2020
43c3e92
UCP/GTEST: Fix review comments
dmitrygx Sep 8, 2020
9153e50
UCP/CORE: Added useful comments
dmitrygx Sep 8, 2020
9c346d6
UCP/RMA: Add more comments for flush to make it clear + fix typo
dmitrygx Sep 8, 2020
465be85
GTEST/UCP: Fix review comments
dmitrygx Sep 8, 2020
cdb8875
UCP/CORE: Use progress instead of loop over ERR_BUSY
dmitrygx Sep 8, 2020
2a5888f
UCP/GTEST: Fix review comments
dmitrygx Sep 9, 2020
d3cf051
UCP/WORKER: Fix review comments
dmitrygx Sep 9, 2020
ea18b51
UCP/CORE: Let UCP Wireup EP be destroyed in case of error
dmitrygx Sep 9, 2020
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
6 changes: 2 additions & 4 deletions src/ucp/core/ucp_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -2520,7 +2520,6 @@ void ucp_worker_discard_uct_ep(ucp_worker_h worker, uct_ep_h uct_ep,
{
uct_worker_cb_id_t cb_id = UCS_CALLBACKQ_ID_NULL;
ucp_request_t *req;
khiter_t UCS_V_UNUSED iter;
int ret;

ucs_assert(uct_ep != NULL);
Expand All @@ -2544,9 +2543,8 @@ void ucp_worker_discard_uct_ep(ucp_worker_h worker, uct_ep_h uct_ep,
}

++worker->flush_ops_count;
Comment thread
yosefe marked this conversation as resolved.
iter = kh_put(ucp_worker_discard_uct_ep_hash,
&worker->discard_uct_ep_hash,
uct_ep, &ret);
kh_put(ucp_worker_discard_uct_ep_hash, &worker->discard_uct_ep_hash,
uct_ep, &ret);
if (ret == UCS_KH_PUT_FAILED) {
ucs_fatal("failed to put %p UCT EP into the %p worker hash",
uct_ep, worker);
Expand Down
4 changes: 2 additions & 2 deletions src/ucp/wireup/wireup_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ static uct_ep_h ucp_wireup_ep_get_msg_ep(ucp_wireup_ep_t *wireup_ep)

ucs_status_t ucp_wireup_ep_progress_pending(uct_pending_req_t *self)
{
ucp_request_t *proxy_req = ucs_container_of(self, ucp_request_t, send.uct);
uct_pending_req_t *req = proxy_req->send.proxy.req;
ucp_request_t *proxy_req = ucs_container_of(self, ucp_request_t, send.uct);
uct_pending_req_t *req = proxy_req->send.proxy.req;
Comment on lines +144 to +145

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls align on '='

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not my code, I returned it back in the same state as it was

ucp_wireup_ep_t *wireup_ep = proxy_req->send.proxy.wireup_ep;
ucs_status_t status;

Expand Down
51 changes: 27 additions & 24 deletions test/gtest/ucp/test_ucp_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ class test_ucp_worker_discard : public ucp_test {
std::vector<uct_pending_req_t*> pending_reqs;
unsigned flush_count;
unsigned pending_add_count;

ep_test_info_t() {
pending_reqs.clear();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed, std::vector has its own constructor.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

flush_count = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: better to use initializer list

ep_test_info_t() : flush_count(0), pending_add_count(0) {
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

pending_add_count = 0;
}
};
typedef std::map<uct_ep_h, ep_test_info_t> ep_test_info_map_t;

Expand Down Expand Up @@ -188,18 +194,18 @@ class test_ucp_worker_discard : public ucp_test {
EXPECT_EQ(m_created_ep_count, total_ep_count);

for (unsigned i = 0; i < m_created_ep_count; i++) {
ep_test_info_t *test_info = ep_test_info_get(&eps[i]);
ep_test_info_t &test_info = ep_test_info_get(&eps[i]);

/* check EP flush counters */
if (ep_flush_func == ep_flush_func_return_3_no_resource_then_ok) {
EXPECT_EQ(4, test_info->flush_count);
EXPECT_EQ(4, test_info.flush_count);
} else if (ep_flush_func == ep_flush_func_return_in_progress) {
EXPECT_EQ(1, test_info->flush_count);
EXPECT_EQ(1, test_info.flush_count);
}

/* check EP pending add counters */
if (ep_pending_add_func == ep_pending_add_func_return_ok_then_busy) {
EXPECT_EQ(3, test_info->pending_add_count);
EXPECT_EQ(3, test_info.pending_add_count);
}
}

Expand All @@ -220,34 +226,31 @@ class test_ucp_worker_discard : public ucp_test {
m_destroyed_ep_count++;
}

static ep_test_info_t* ep_test_info_get(uct_ep_h ep) {
ep_test_info_t *test_info_p;
static ep_test_info_t& ep_test_info_get(uct_ep_h ep) {
ep_test_info_map_t::iterator it = m_ep_test_info_map.find(ep);

if (it == m_ep_test_info_map.end()) {
ep_test_info_t test_info = {};
ep_test_info_t test_info;

m_ep_test_info_map.insert(std::make_pair(ep, test_info));
test_info_p = &m_ep_test_info_map.find(ep)->second;
} else {
test_info_p = &it->second;
it = m_ep_test_info_map.find(ep);
}

return test_info_p;
return it->second;
}

static unsigned
ep_test_info_flush_inc(uct_ep_h ep) {
ep_test_info_t *test_info = ep_test_info_get(ep);
test_info->flush_count++;
return test_info->flush_count;
ep_test_info_t &test_info = ep_test_info_get(ep);
test_info.flush_count++;
return test_info.flush_count;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: can be shorter
return ++ep_test_info_get(ep).flush_count;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

static unsigned
ep_test_info_pending_add_inc(uct_ep_h ep) {
ep_test_info_t *test_info = ep_test_info_get(ep);
test_info->pending_add_count++;
return test_info->pending_add_count;
ep_test_info_t &test_info = ep_test_info_get(ep);
test_info.pending_add_count++;
return test_info.pending_add_count;
}

static ucs_status_t
Expand Down Expand Up @@ -299,26 +302,26 @@ class test_ucp_worker_discard : public ucp_test {
static ucs_status_t
ep_pending_add_save_req(uct_ep_h ep, uct_pending_req_t *req,
unsigned flags) {
ep_test_info_t *test_info = ep_test_info_get(ep);
test_info->pending_reqs.push_back(req);
ep_test_info_t &test_info = ep_test_info_get(ep);
test_info.pending_reqs.push_back(req);
return UCS_OK;
}

static void
ep_pending_purge_func_iter_reqs(uct_ep_h ep,
uct_pending_purge_callback_t cb,
void *arg) {
ep_test_info_t *test_info = ep_test_info_get(ep);
ep_test_info_t &test_info = ep_test_info_get(ep);
uct_pending_req_t *req;

for (unsigned i = 0; i < m_pending_purge_reqs_count; i++) {
std::vector<uct_pending_req_t*> *req_vec = &test_info->pending_reqs;
if (req_vec->size() == 0) {
std::vector<uct_pending_req_t*> &req_vec = test_info.pending_reqs;
if (req_vec.size() == 0) {
break;
}

req = req_vec->back();
req_vec->pop_back();
req = req_vec.back();
req_vec.pop_back();
cb(req, arg);
}
}
Expand Down