-
Notifications
You must be signed in to change notification settings - Fork 38
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
Change signature of the nearest callback #366
Conversation
This commit only addresses on-node part.
bff82e2
to
1a43969
Compare
Decided to quickly redo this as this will heavily conflict with #425. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the patch is pretty straightforward. The only thing I'm not happy with is where the extra functions (getReversePermutation
and getPrimitiveBoundingVolume
) live. Any ideas welcome. This should be merged prior to #425.
Kokkos::View<unsigned int *, typename BVH::memory_space> rev_permute( | ||
Kokkos::ViewAllocateWithoutInitializing( | ||
"ArborX::DistributedTree::query::nearest::reverse_permutation"), | ||
n); | ||
Kokkos::parallel_for( | ||
"ArborX::DistributedTree::query::nearest::compute_reverse_permutation", | ||
Kokkos::RangePolicy<ExecutionSpace>(exec_space, 0, n), | ||
KOKKOS_LAMBDA(int const i) { | ||
rev_permute(leaf_nodes(i).getLeafPermutationIndex()) = i; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was actually a nice idea. Mostly, because it avoids all the semantics of when and how to store user primitives, or extra arrays. It completely bypasses this question, because it is possible to figure out reverse permutation from the leaf nodes, which are accessible during query
.
@@ -417,6 +449,9 @@ DistributedTreeImpl<DeviceType>::queryDispatchImpl( | |||
// recompute everything instead of just searching for potential better | |||
// neighbors and updating the list. | |||
|
|||
CallbackWithDistance<BVH<typename DeviceType::memory_space>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I should try to fix it to something like std::decay_t<decltype(bottom_tree)>
. It is still completely tied to BVH
and won't work with anything else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just add a comment before you merge
1a43969
to
40096ed
Compare
40096ed
to
d5a1d29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable but can you please comment on the disabled tests?
@masterleinad Thanks for the review. I'll fix |
return make_compressed_storage( | ||
Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace{}, offsets), | ||
Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace{}, values)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to keep the distributed version?
ArborX/test/Search_UnitTestHelpers.hpp
Lines 131 to 135 in d5a1d29
#ifdef ARBORX_ENABLE_MPI | |
template <typename ExecutionSpace, typename Tree, typename Queries> | |
auto query_with_distance(ExecutionSpace const &exec_space, Tree const &tree, | |
Queries const &queries, | |
std::enable_if_t<is_distributed<Tree>{}> * = nullptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DistributedTree has a (deprecated) query dispatch that returns distances. If we want to maintain backwards compatibility, it has to be kept and tested.
Co-authored-by: Damien L-G <dalg24@gmail.com>
@masterleinad @dalg24 Should have addressed all your comments. |
A friend declaration inside a class counts as a declaration, so if we also declare that friend outside the class, that will trigger a redundant declaration warning from this check.
PGI seems to fail sporadically, same error as in #430. PGI was running on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK with me after we clarify the Clang-Tidy check removal
This reverts commit 38d4358. No longer necessary, as we no longer use friend functions.
I changed to using friend class declaration instead of two friend functions. I also reverted clang-tidy check. @dalg24 This should address all your comments. On a side note, I wasted a lot of time trying to figure out why it did not work. It was an easy thing of forgetting to include This is not the first time I got burned by forgetting to include that header. Does anyone know if we can have a check that if a file uses any macro with a name from the config file, the config file has to be included? |
Our |
No. It only tests whether the standalone header can be compiled. But the issue here is that it can be compiled even when you use macros from the config header without including it. The protected code is simply compiled away. |
If it includes a macro, it should be in |
I guess I got burned accidentally here, as this |
again HIP failure |
retest this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not requesting change but making sure it does not get merged "too early".
I want to detect that the legacy signature is being used and provide a better error message via a failed static assertion.
Unblocking now that error message is better
Another randomly failing test: distributed tree on PGI. Can be merged. |
retest this please |
@dalg24 You dismissed your review, but did not approve. Should I understand it as you are going to do a final look? |
@@ -417,6 +449,9 @@ DistributedTreeImpl<DeviceType>::queryDispatchImpl( | |||
// recompute everything instead of just searching for potential better | |||
// neighbors and updating the list. | |||
|
|||
CallbackWithDistance<BVH<typename DeviceType::memory_space>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just add a comment before you merge
@dalg24 thanks! |
I completely forgot to performance test this PR. And results look very fishy (I compared 6224c97 with 9c4ae2d):
Serial
OpenMP
Cuda
|
Fix performance regression introduced in #366
It is only used in the distributed testing, and does not test anything useful. It prevents the refactoring of the DistributedTree as it reaches inside the implementation which would vary between the old and new interface. Should have been removed as part of arborx#366.
Fix #355