Repository navigation
Partition merge over all output elements - #7942
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Partition merge work and update benchmark accounting libs/core/algorithms/include/hpx/parallel/algorithms/merge.hpp, libs/core/algorithms/tests/performance/benchmark_merge_sweep.cpp |
parallel_merge uses diagonal indices to partition the combined output range and returns both input end iterators with the destination advanced by the total input length. The benchmark divides sequential merge time by the combined input lengths. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
- Let tasks carry their expected run time (hpx::task_size) for scheduling decisions #7837: The change uses the full output length for
parallel_mergepartitioning, which is relevant to task-size information used for scheduling decisions.
Possibly related PRs
- TheHPXProject/hpx#7948: This PR changes the iteration count passed to the merge partitioner, which feeds the chunking decisions added by
#7948. - TheHPXProject/hpx#7926: This PR changes the iteration count used by the task-size estimate added by
#7926.
Suggested reviewers: v4xsh
Merge Risk: 
Minimal · up to 8dac7
-
No merge-blocking issue was identified.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% 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 1 functions across 2 files.
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
|
|
@kollanur Could you have a look, please? |
sure. |
Thanks for the changes. This makes sense, especially with the task-size estimation introduced in #7926. Since |
parallel_merge passed the longer of its two input ranges to the partitioner, so the executor parameters saw between half and all of the work of the merge. The chunks only use their index, and the diagonal index finds where each chunk starts in both inputs, so the partitioner now runs over a counting range of all output elements. benchmark_merge_sweep computes the time per iteration it gives adaptive_chunk_size per output element accordingly. Signed-off-by: Hartmut Kaiser <[email protected]>
33594d6 to
8dac7d3
Compare
parallel_merge passed the longer of its two input ranges to the partitioner, so the executor parameters saw between half and all of the work of the merge. For two inputs of equal length they saw only half of the iterations, so executor parameters that derive the number of cores or the chunk size from the number of iterations and the run time of one iteration based their decision on the wrong amount of work.
The chunks of the merge only use their index into the output: the diagonal index finds where each chunk starts in both inputs. The partitioner now runs over a counting range of all output elements (
hpx::util::counting_iterator<std::size_t>), so that the executor parameters see the whole work of the merge. The result of the algorithm is computed from the known ends of both inputs instead of from the iterator the partitioner returns, which removes the two separate calls for the longer first or second input.benchmark_merge_sweep computes the time per iteration it gives adaptive_chunk_size per output element accordingly.
All merge tests pass, and benchmark_merge takes the same time as before (189.5 s vs 189.9 s).