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

Test on-node space indexes using both float and double #1200

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

aprokop
Copy link
Contributor

@aprokop aprokop commented Jan 6, 2025

  • Generalized make(), makeIntersects*(), makeNearest*() to work with any kind of geometry
  • Added testing for on-node space indexes for both float and double

@aprokop aprokop added enhancement New feature or request testing Anything to do with tests and CI labels Jan 6, 2025
@aprokop aprokop marked this pull request as ready for review January 6, 2025 21:45
@aprokop aprokop requested a review from dalg24 January 6, 2025 21:57
@aprokop aprokop added the bug Something isn't working label Jan 7, 2025
@aprokop
Copy link
Contributor Author

aprokop commented Jan 11, 2025

@dalg24 Everything passed (except one CUDA build that threw subprocess exceptions). I think it should be fine to merge if you are OK with the changes.

@@ -175,6 +175,14 @@ struct PredicateWithAttachment : Predicate
: Predicate(std::forward<Predicate>(pred))
, _data(std::forward<Data>(data))
{}
#if defined(KOKKOS_ENABLE_CUDA) && defined(KOKKOS_COMPILER_CLANG) && \
(KOKKOS_COMPILER_CLANG < 1500)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just being conservative here. No idea what combinations are susceptible.

typename Coordinate = float>
auto make(ExecutionSpace const &exec_space,
std::vector<ArborX::Box<DIM, Coordinate>> const &b)
template <typename Tree, typename Geometry, typename ExecutionSpace>
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not loving the ordering of the template parameters but I understand why you did it this way

template <typename DeviceType, int DIM = 3, typename Coordinate = float>
auto makeIntersectsBoxQueries(
std::vector<ArborX::Box<DIM, Coordinate>> const &boxes,
template <typename DeviceType, typename Geometry>
Copy link
Contributor

Choose a reason for hiding this comment

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

We still want to template on DeviceType?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I plan to switch it to templating on the ExecutionSpace in the future.

list(APPEND ARBORX_TEST_QUERY_TREE_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BF.cpp")
foreach(_bounding_volume KDOP14 KDOP18) # purposefully ommitting KDOP6 and KDOP26 to reduce the number of instantiations
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BVH_${_bounding_volume}.cpp.tmp"
foreach (_precision float double)
Copy link
Contributor

Choose a reason for hiding this comment

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

By how much are we increasing compile time? runtime?
I am interested both in these numbers for the QueryTree exe and total times

test/Search_UnitTestHelpers.hpp Outdated Show resolved Hide resolved
Comment on lines +277 to +278
using Point = ArborX::Point<3>;
using Box = ArborX::Box<3>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to be explicit here and say float?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not right now. I'll do that once we switch distributed test to run both.

test/tstDistributedTreeSpatial.cpp Outdated Show resolved Hide resolved
@aprokop
Copy link
Contributor Author

aprokop commented Jan 15, 2025

@dalg24 Addressed all your comments.

@aprokop
Copy link
Contributor Author

aprokop commented Jan 17, 2025

By how much are we increasing compile time? runtime?
I am interested both in these numbers for the QueryTree exe and total times

On my Mac in Debug configuration with only the Serial backend:

master, making just the tree query test:

$ time make -j1 ArborX_Test_QueryTree.exe
[25/25] Linking CXX executable test/ArborX_Test_QueryTree.exe
real    1m35.138s
user    1m29.668s
sys     0m6.000s

master, making all tests:

$ cd test
$ time make -j1
[99/99] Linking CXX executable test/ArborX_Test_InterpMovingLeastSquares.exe
real    3m16.225s
user    3m4.549s
sys     0m13.047s

branch, making just the tree query test:

$ time make -j1 ArborX_TestQueryTree.exe
[41/41] Linking CXX executable test/ArborX_Test_QueryTree.exe
real    2m56.503s
user    2m46.213s
sys     0m11.336s

So, ~2x slower than float, as expected.
branch, making all tests:

$ cd test
$ time make -j1
[114/114] Linking CXX executable test/ArborX_Test_InterpMovingLeastSquares.exe
real    4m37.494s
user    4m20.802s
sys     0m18.160s

So, around ~40% slower than just float.

Runtime is in the epsilon, as on my Mac running query test with both float and double only takes 14s.

@aprokop
Copy link
Contributor Author

aprokop commented Jan 18, 2025

Rebased to fix conflicts with #1108.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request testing Anything to do with tests and CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants