Repository navigation
Conversation
min_element, max_element, minmax_element, lexicographical_compare, find_end and search give an iteration the size of the comparison of two elements. find_first_of and search_n compare an element with each element of the second range or with count elements, an iteration has the size of that many comparisons. Signed-off-by: Hartmut Kaiser <[email protected]>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Estimate and validate partition task sizes libs/core/algorithms/include/hpx/parallel/algorithms/detail/search.hpp, libs/core/algorithms/include/hpx/parallel/algorithms/find.hpp, libs/core/algorithms/include/hpx/parallel/algorithms/lexicographical_compare.hpp, libs/core/algorithms/include/hpx/parallel/algorithms/minmax.hpp, libs/core/algorithms/tests/unit/task_sizes/* |
The parallel algorithms derive task-size estimates from callable and projected argument types, with range or count scaling for find_first_of and search_n. They pass the estimates to the partitioner through with_task_size. The new unit test checks task-size classifications. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Possibly related issues
- Let tasks carry their expected run time (hpx::task_size) for scheduling decisions #7837: The issue proposes
hpx::task_sizemetadata for scheduling. This PR adds task-size estimates to parallel algorithm tasks.
Possibly related PRs
- TheHPXProject/hpx#7947: Adds task-size estimation for one predicate call and helpers extended by this PR.
- TheHPXProject/hpx#7925: Defines task-size mechanisms, including
with_task_size, used by this PR. - TheHPXProject/hpx#7948: Adds chunk selection based on task sizes supplied by work functions.
Suggested labels: type: optimization, category: tests
Suggested reviewers: v4xsh
Merge Risk: 
Minimal · up to 78ec4
-
No actionable merge-blocking risk was established for the new task-size hints.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 9 functions across 5 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Up to standards ✅🟢 Issues
|
This is the third part of the task-size series (#7926, #7946, #7947), it applies on top of #7947.
min_element, max_element, minmax_element and lexicographical_compare give an iteration the size of the comparison of two elements. minmax_element makes 1.5 comparisons per element and lexicographical_compare two, which stays within the size of one comparison. find_end and search do the same: most positions don't match the first element of the sequence. find_first_of compares an element with each element of the second range and search_n with count elements, so an iteration has the size of that many comparisons, computed at run time with bulk_task_size.
As for the other algorithms, a size given to the comparison wins, a comparison without a size has none, and a projection hides the type the comparison is called with. includes and the set algorithms stay unsized.
Tests: the new task_sizes_multi_call test and the existing tests of the changed algorithms pass on Windows.