Skip to content
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

Add unit test cases for the S/R versions of the parallel algorithms #6494

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

zhekemist
Copy link

@zhekemist zhekemist commented May 22, 2024

This draft has the goal of adding simple unit test cases for the S/R versions of HPX's parallel algorithms, where they did not exist yet. It is still a work in progress, in particular the following things still need to be done:

  • Add the remaining test cases: For now, all planned test cases have been added. An overview of the existing test cases (and which of those compile) can be found in this document
  • Use the function call syntax for tt::sync_wait instead of piping, in order to make the test compatible with NVIDIA's stdexec

Checklist

  • I have added a test using random numbers; I have made sure it uses a seed, and that random numbers generated are valid inputs for the tests.

This commit introduces simple unit test cases for the S/R (Sender
and Receiver) versions of the parallel algorithms where they did not
exist yet. Note that this is only the first part of these additional
test cases, they have not been implemented for every algorithm yet.
@jenkins-cscs
Copy link
Collaborator

Can one of the admins verify this patch?

Copy link

codacy-production bot commented May 22, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.88% 67.31%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (daa1fd5) 222123 188895 85.04%
Head commit (087c8b2) 193805 (-28318) 163110 (-25785) 84.16% (-0.88%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#6494) 3123 2102 67.31%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences


🚀 Don’t miss a bit, follow what’s new on Codacy.

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

All usages of the tt::sync_wait sender consumer in the recently
added unit tests were replaced with equivalent function calls
in order to make the tests compatible with NVIDIA's stdexec.
This commit adds the remaining sender adaptor test cases. As of now,
it is not planned to add further test cases, as test cases were
added to all the algorithms where they are currently of interest.
@hkaiser
Copy link
Member

hkaiser commented May 28, 2024

Wow... Just wow! Thanks a lot for your work on this!

zhekemist and others added 7 commits June 28, 2024 10:21
This commit introduces a first batch of fixes for the
S/R versions of some parallel algorithms. However,
they are currently all build on a temporary solution
for an issue in the "then sender" and therefore not
final yet.
- Fly-by: comment out sender tests for algorithms that are not fixed yet
zhekemist and others added 5 commits July 29, 2024 15:05
The guard prevents the use of invocables returning bool in the
bulk_async_execute method of the explicit_scheduler_executor to
avoid data races. Using such invocables can cause issues because
std::vector<return type of the invocable> may be simultaneously
written to by multiple threads, which is problematic
with std::vector<bool> due to its space optimizations.
This commit introduces a new set of fixes for the
S/R versions of several more parallel algorithms and
reworks of some previous, buggy fixes. Additionally,
new unit test cases have been added for some of the
algorithms to cover edge cases such as empty ranges in
case they could become pitfalls for the S/R adaptations.
This led to the discovery of some general bugs in the
algorithms, which were fixed as flybys:
* `first_first_of` (+ regression test case)
* `ends_with`
Fly-by: Rebalance the two target lists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants