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

Implement HPX::in_parallel #6143

Merged
merged 2 commits into from
May 30, 2023
Merged

Implement HPX::in_parallel #6143

merged 2 commits into from
May 30, 2023

Conversation

msimberg
Copy link
Contributor

Fixes #5744. This implements the weaker form of in_parallel from https://kokkos.github.io/kokkos-core-wiki/API/core/execution_spaces.html?highlight=in_parallel#functionality:

Note: as currently implemented, there is no guarantee that true means the caller is necessarily executing as part of a pattern on the particular instance ex; just some instance of Ex. This may be strengthened in the future.

i.e. this does not use the ExecutionSpace argument to in_parallel. I can strengthen this if useful in the future.

I couldn't find any existing tests (except for

int in_parallel = ExecSpace::in_parallel();
ASSERT_FALSE(in_parallel);
which doesn't test much) so I added a test specific for the HPX backend. Let me know if this test would be possible to use already now for all backends.

core/unit_test/hpx/TestHPX_InParallel.cpp Outdated Show resolved Hide resolved
core/unit_test/hpx/TestHPX_InParallel.cpp Outdated Show resolved Hide resolved
core/unit_test/hpx/TestHPX_InParallel.cpp Show resolved Hide resolved
core/unit_test/hpx/TestHPX_InParallel.cpp Show resolved Hide resolved
@msimberg msimberg force-pushed the hpx-in_parallel branch 2 times, most recently from fc570a2 to a2f3276 Compare May 19, 2023 07:14
Copy link
Contributor

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK to me. It seems we could extend the tests added to all other backends (except for Serial) but I'm fine with doing that in another pull request.

@msimberg
Copy link
Contributor Author

Do you know what happened on continuous-integration/jenkin-ci/pr? Anything I should worry about?

@dalg24
Copy link
Member

dalg24 commented May 22, 2023

Do you know what happened on continuous-integration/jenkin-ci/pr? Anything I should worry about?

I do not but it looks like the clang-format test passed so it is probably ok.

@msimberg
Copy link
Contributor Author

Any further comments on this?

@dalg24 dalg24 merged commit ab6f756 into kokkos:develop May 30, 2023
27 of 28 checks passed
@dalg24
Copy link
Member

dalg24 commented May 30, 2023

No. Looks good. Thank you Mikael.

@nmm0 nmm0 mentioned this pull request Jun 16, 2023
nliber pushed a commit to nliber/kokkos that referenced this pull request Jun 22, 2023
* Implement HPX::in_parallel

* Don't use gtest macros in parallel regions in HPX in_parallel test
@msimberg msimberg deleted the hpx-in_parallel branch August 7, 2023 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants