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 "self collision" accelerated traversal for spatial predicates #801

Closed
wants to merge 6 commits into from

Conversation

dalg24
Copy link
Contributor

@dalg24 dalg24 commented Dec 27, 2022

This is a draft
I am looking for feedback on:

  • API for what the cabana_proxy free function (name? signature?)
  • tests for that cabana_proxy function

I could propose expandHalfToFull() on its own. The motivation for that function was that I observed it was significant faster to search for half and expand than register both (i,j) and (j,i) from the callback.

@aprokop
Copy link
Contributor

aprokop commented Dec 28, 2022

API for what the cabana_proxy free function (name? signature?)

I haven't thought much about the name. But I think the currently proposed implementation is too restrictive. I think what we want here is to allow a user to provide any kind of geometric objects for self-intersections. They could be spheres, boxes, or some custom types. We should not restrict it here. I think we would then want a user to be able to tell us how to expand that geometric object by a given radius. However, we should not rely on the user to construct predicates, I think.

Looking in the future, I think we would want to be able to intersect stored values, instead of intersecting bounding volumes. That would require a user to provide us with some kind of lambda anyway.

If we want to start really small and be super restrictive, just trying it out for the MD case, then the current interface would be fine except you would want to static assert Primitives to be point primitives.

I should also mention that while I like this order of arguments (offsets, indices) a lot better than (indices, offsets), it differs from the usage in other places which uses (indices, offsets).

@aprokop
Copy link
Contributor

aprokop commented Dec 28, 2022

tests for that cabana_proxy function

What feedback are you looking for here? Whether the current test is sufficient, or ideas about how to test it?

@aprokop
Copy link
Contributor

aprokop commented Dec 28, 2022

Also, do you think we should a switch to whether include self-collisions in the results or not? There may be cases to use either. If you are interesting in pair-wise interactions, like force calculations, you would not want them. But if you do something like interpolation from all the points within distance, you would want to include yourself. However, that would make converting half to full a bit more complex to avoid duplication.

@aprokop
Copy link
Contributor

aprokop commented Dec 28, 2022

I just noticed that there is also no callback option? Is that because it is geared towards Cabana? But it we want to use it in ArborX for DBSCAN, we would want to allow a pure callback option.

@aprokop aprokop added the enhancement New feature or request label Dec 28, 2022
#ifdef V1
if (left_child < i)
#else
if (true)
Copy link
Contributor

Choose a reason for hiding this comment

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

One of the benefits of the V2 version that I didn't think about is that it is agnostic to the ordering of the internal nodes. Meaning that as long as the ropes are appropriately constructed, it will find correct answer. But I think V1 would only work with Karras ordering, and not Apetrei or any other.

@aprokop
Copy link
Contributor

aprokop commented Dec 30, 2022

#485 has a few important comments and considerations to keep in mind.

@@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(iota, DeviceType, ARBORX_DEVICE_TYPES)
std::vector<int> w_ref = {0, 1, 2};
auto w_host = Kokkos::create_mirror_view(w);
Kokkos::deep_copy(w_host, w);
BOOST_TEST(w_ref == w_host, tt::per_element());
// BOOST_TEST(w_ref == w_host, tt::per_element());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't mean to commit that. Please ignore.

@aprokop
Copy link
Contributor

aprokop commented Dec 31, 2022

I think it would make sense to separate this PR into 3:

  • Traversal
  • Half list / cabana proxy
  • Expand half to full

@dalg24
Copy link
Contributor Author

dalg24 commented Jan 5, 2023

Closing in favor of #812

@dalg24 dalg24 closed this Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants