-
Notifications
You must be signed in to change notification settings - Fork 156
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
Fix quadtree spatial join OOMs on large numbers of input polygons #1381
Fix quadtree spatial join OOMs on large numbers of input polygons #1381
Conversation
…tributed instead of distributing along a diagonal
cpp/include/cuspatial/detail/join/quadtree_point_in_polygon.cuh
Outdated
Show resolved
Hide resolved
cpp/include/cuspatial/detail/join/quadtree_point_in_polygon.cuh
Outdated
Show resolved
Hide resolved
cpp/include/cuspatial/detail/join/quadtree_point_in_polygon.cuh
Outdated
Show resolved
Hide resolved
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.
Nice improvement. I think adding some of the details from your review comments as actual code comments might be valuable. But I approve.
cpp/include/cuspatial/detail/join/quadtree_point_in_polygon.cuh
Outdated
Show resolved
Hide resolved
cpp/include/cuspatial/detail/join/quadtree_point_in_polygon.cuh
Outdated
Show resolved
Hide resolved
…into fix/quadtree-spatial-join-oom
…its and allocating the exact amount of memory for the results
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.
Thanks for fixing! One small request.
cpp/include/cuspatial/detail/join/quadtree_point_in_polygon.cuh
Outdated
Show resolved
Hide resolved
cpp/include/cuspatial/detail/join/quadtree_point_in_polygon.cuh
Outdated
Show resolved
Hide resolved
Not sure what's going on with the |
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.
One small code suggestion below. Otherwise lgtm!
auto count_in_chunks = [&](auto const& func) { | ||
std::uint64_t memo{}; | ||
for (std::uint64_t offset{0}; offset < num_total_points; offset += max_points_to_test) { | ||
memo += func(memo, offset, std::min(max_points_to_test, num_total_points - offset)); | ||
} | ||
return memo; | ||
}; |
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 like a count + reduce to me.. I'm ok with using a for loop in the small scope here. One small suggestion: renaming func
to count_func
could increase readability.
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.
Yeah, this is a special form of std::reduce
. The difference is mainly in how it passes min(max, num_left_to_process)
as the size
argument, which I thought would be more confusing to read if I implemented it as an iterator of [max, max, .., leftover]
.
/merge |
Description
Followup to #1346.
Fixes #890.
Checklist