Repository navigation
UCP/GTEST: fix and test rndv requests leak from the ptr_map. #5769
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
Changes from all commits
7d1cbe6
a8a3db6
91c8e11
284df93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -978,34 +978,38 @@ class test_ucp_sockaddr_protocols : public test_ucp_sockaddr { | |
|
|
||
| void test_tag_send_recv(size_t size, bool is_exp, bool is_sync = false) | ||
| { | ||
| std::string send_buf(size, 'x'); | ||
| std::string recv_buf(size, 'y'); | ||
| /* send multiple messages to test the protocol both before and after | ||
| * connection establishment */ | ||
| for (int i = 0; i < 100; i++) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a dependency on this change. @alinask what about creating a separate PR with sockaddr-only change to test before/after connection establishment? If you wish, I could help with that
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dmitrygx which PR is dependent on this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| std::string send_buf(size, 'x'); | ||
| std::string recv_buf(size, 'y'); | ||
|
|
||
| void *rreq = NULL, *sreq = NULL; | ||
| void *rreq = NULL, *sreq = NULL; | ||
|
|
||
| if (is_exp) { | ||
| rreq = ucp_tag_recv_nb(receiver().worker(), &recv_buf[0], size, | ||
| ucp_dt_make_contig(1), 0, 0, rtag_complete_cb); | ||
| } | ||
| if (is_exp) { | ||
| rreq = ucp_tag_recv_nb(receiver().worker(), &recv_buf[0], size, | ||
| ucp_dt_make_contig(1), 0, 0, rtag_complete_cb); | ||
| } | ||
|
|
||
| if (is_sync) { | ||
| sreq = ucp_tag_send_sync_nb(sender().ep(), &send_buf[0], size, | ||
| ucp_dt_make_contig(1), 0, scomplete_cb); | ||
| } else { | ||
| sreq = ucp_tag_send_nb(sender().ep(), &send_buf[0], size, | ||
| ucp_dt_make_contig(1), 0, scomplete_cb); | ||
| } | ||
| if (is_sync) { | ||
| sreq = ucp_tag_send_sync_nb(sender().ep(), &send_buf[0], size, | ||
| ucp_dt_make_contig(1), 0, scomplete_cb); | ||
| } else { | ||
| sreq = ucp_tag_send_nb(sender().ep(), &send_buf[0], size, | ||
| ucp_dt_make_contig(1), 0, scomplete_cb); | ||
| } | ||
|
|
||
| if (!is_exp) { | ||
| short_progress_loop(); | ||
| rreq = ucp_tag_recv_nb(receiver().worker(), &recv_buf[0], size, | ||
| ucp_dt_make_contig(1), 0, 0, rtag_complete_cb); | ||
| } | ||
| if (!is_exp) { | ||
| short_progress_loop(); | ||
| rreq = ucp_tag_recv_nb(receiver().worker(), &recv_buf[0], size, | ||
| ucp_dt_make_contig(1), 0, 0, rtag_complete_cb); | ||
| } | ||
|
|
||
| request_wait(sreq); | ||
| request_wait(rreq); | ||
| request_wait(sreq); | ||
| request_wait(rreq); | ||
|
|
||
| compare_buffers(send_buf, recv_buf); | ||
| compare_buffers(send_buf, recv_buf); | ||
| } | ||
| } | ||
|
|
||
| void wait_for_server_ep() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? NULL is also pointer, kind of...
if this happens unexpectedly, IMO, it should be fixed/asserted in UCP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would you want to put a null pointer into the ptr_map..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO NULL pointer is incorrect usage (we expect an id to resolve to a valid object), and ptr_map can help by catching this early
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't :) but IMHO it should not be restricted in UCS
anyway let's do it symmetric - if assert then for both add/del