Repository navigation
Honor min_tasks_to_steal_pending in the work-requesting schedulers - #7771
Conversation
A worker handling a steal request sent tasks to the requesting worker regardless of hpx.thread_queue.min_tasks_to_steal_pending, as it took them from its queue with allow_stealing = false. Since #7726 made the work-requesting schedulers hand out tasks, this made the min_tasks_to_steal_staged test fail intermittently on CI, which runs the tests with --hpx:queuing=local-workrequesting-fifo. thread_queue::get_next_threads compared the minimum with the number of requested items instead of all pending items, which refused to steal fewer items than the minimum however many were pending. Adds a --scheduler option to the min_tasks_to_steal_staged test, which selects the scheduler through the resource partitioner, so that it can be registered for the work-requesting scheduler without conflicting with --hpx:queuing given through HPX_WITH_TESTS_COMMAND_LINE. Signed-off-by: Hartmut Kaiser <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
Up to standards ✅🟢 Issues
|
Performance test reportHPX PerformanceComparison
Info
Comparison
Info
Comparison
Info
Explanation of Symbols
|
|
For the records: the |
Describe the PRs merged since the release branch was rebuilt on master cba138f (#7675, #7720, #7723, #7725, #7726, #7735, #7736, #7738, #7740, #7741, #7749, #7754, #7755, #7757, #7759), and since it was rebuilt on master 97c7e25 (#7750, #7752, #7762, #7771, #7781, #7782, #7791, #7793). Regenerate the closed issue and pull request lists for release-2.0.X at 0e973ff against the v1.11.0 tag (754 PRs, 153 issues). Signed-off-by: Hartmut Kaiser <[email protected]>
Describe the PRs merged since the release branch was rebuilt on master cba138f (#7675, #7720, #7723, #7725, #7726, #7735, #7736, #7738, #7740, #7741, #7749, #7754, #7755, #7757, #7759), since it was rebuilt on master 97c7e25 (#7750, #7752, #7762, #7771, #7781, #7782, #7791, #7793), and since it was rebuilt on master 67e52ba (#7718, #7739, #7751, #7753, #7756, #7770, #7797, #7800, #7802, #7804, #7805). Regenerate the closed issue and pull request lists for release-2.0.X at a55fd37 against the v1.11.0 tag (765 PRs, 157 issues). Signed-off-by: Hartmut Kaiser <[email protected]>
Proposed Changes
local_workrequesting_scheduler::handle_steal_request: a worker receiving a steal request no longer sends any tasks while it has fewer pending tasks thanhpx.thread_queue.min_tasks_to_steal_pending, as the other schedulers already do. It took the tasks withallow_stealing = false, so the minimum was never checked. Nothing changes for the default minimum of 0.thread_queue::get_next_threads: when stealing, compare the minimum with all pending tasks instead of the number of tasks requested. The count was clipped tomax_itemsbefore the check, so asking for fewer tasks than the minimum was always refused, however many tasks were pending.thread_queue_get_next_threadstest: steal with a minimum set, and check that nothing can be stolen once fewer pending tasks are left.min_tasks_to_steal_stagedtest: new--scheduler=default|workrequestingoption, which selects the scheduler through the resource partitioner, and a new registrationmin_tasks_to_steal_staged_workrequesting. It uses this option instead of--hpx:queuingso that it doesn't conflict with a--hpx:queuinggiven throughHPX_WITH_TESTS_COMMAND_LINE.Any background context you want to provide?
min_tasks_to_steal_staged(added in #7730) fails intermittently on CI withstate->ran_elsewhere.load() == 0failed,'1' != '0', on master, release-2.0.X and several PRs (e.g. #7756). CI runs the tests with--hpx:queuing=local-workrequesting-fifo, and since #7726 the work-requesting schedulers actually hand tasks to idle workers, which made the missing check visible: one of the three tasks posted to a worker was sent to a worker requesting work, although the test setsmin_tasks_to_steal_pendingto 10.I could reproduce this locally with
--hpx:threads=2 --hpx:queuing=local-workrequesting-fifoand 16 runs in parallel: 3 out of 320 runs failed on master, none out of 320 with this change (also none for the new registration, and none with both--hpx:queuingand--schedulergiven). The scheduler, thread pool, threading and resource partitioner unit tests pass.Checklist
Not all points below apply to all pull requests.