Repository navigation
GTEST/UCP: Check wait condition after every progress call - #12242
Conversation
wait_for_flag() and wait_for_value() checked their condition only between short_progress_loop() calls. Each loop is 100 progress calls with a 100 us sleep after every call, so every wait that was not satisfied on entry took at least ~16 ms. Check the condition after every progress() call, as request_wait() does. The conditions and timeouts are unchanged.
|
🤖 Starting review — findings will be posted here when done. |
|
No new test is expected for this change; the validation is a full gtest run. Worth confirming the UCP gtest suite passed in the slow configurations (valgrind, ASan) and not only the default one, because the change also removes the trailing ~10 ms of progress that used to run after the flag was already set — any test implicitly relying on that extra progress would show up only there. UCT's |
|
🤖 CI Triage Agent — TL;DR: The gtest run failed on a single test, Full analysisSummary: Azure job "new on worker 2" (build 144890) failed Root cause: Only the Implicated commit: d513f98 — nbellalou, "UCP/FLUSH: Add topology-safe selective endpoint flush (#11923)" (introduced the File: src/ucp/rma/flush.c:189-196 ( Suggested fix: In Related: #12266 (fix), #12242 (PR under test), #11923 (selective endpoint flush that introduced the loop) |
Use ucs::get_deadline() in wait_for_flag(), as wait_for_value() (through test_base::wait_for_cond()) and the UCT wait helpers already do, so its timeout grows with the test time multiplier under valgrind and ASan.
|
🤖 Starting review — findings will be posted here when done. |
|
Re the review summary:
|
| while ((ucs_get_time() < loop_end_limit) && (!(*flag))) { | ||
| short_progress_loop(); | ||
| progress(); | ||
| } |
There was a problem hiding this comment.
maybe reuse wait_for_cond() here - after this change the deadline+poll loop is exactly what it already does:
| } | |
| wait_for_cond([flag]() { return !!(*flag); }, | |
| [this]() { progress(); }, timeout); |
What?
ucp_test::wait_for_flag()anducp_test::wait_for_value()check theircondition after every
progress()call instead of after everyshort_progress_loop().Why?
short_progress_loop()runsprogress()100 times withusleep(100)aftereach call, which takes about 16 ms. The wait helpers checked the condition only
between such loops, so every wait that was not satisfied on entry took at least
16 ms, even when the condition became true a few microseconds later. Tests that
wait in a loop pay this on every iteration. For example, in the RMA variants of
the wireup stress tests the receiver waits for the last put 1000-2000 times per
test.
The same tests with and without this change, time per test (10-CPU container,
ConnectX-7):
udx/test_ucp_wireup_1sided.stress_connect2tcp/test_ucp_wireup_1sided.stress_connect2udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnectudx/test_ucp_wireup_2sided.multi_ep_2sidedrcx/test_ucp_am_nbx_dts.short_bcopy_sendtcp/test_ucp_am_nbx_dts.short_bcopy_sendBased on the Azure PR pipeline timings, this saves about 96 agent-minutes per
build, 25 of them on the GPU pool.
gtest output, master (db31790) and this PR
How?
Use
progress()as the wait step, asrequest_wait()already does(
progress()callssched_yield()after progressing each entity). Theconditions and iteration counts are unchanged, so the tests check the same
things and coverage is the same; they just stop waiting as soon as the
condition holds. Explicit
short_progress_loop()calls are not changed.wait_for_flag()now takes its deadline fromucs::get_deadline(), likewait_for_value()and the UCT wait helpers, so its timeout scales with thevalgrind/ASan time multiplier.