Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed Sep 27, 2022
1 parent 2d0152f commit c47b028
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/details/ArborX_DetailsDistributedTreeImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,13 +704,25 @@ DistributedTreeImpl<DeviceType>::queryDispatch(
Kokkos::View<int *, ExecutionSpace> ranks(
"ArborX::DistributedTree::query::nearest::ranks", 0);

// First find the ranks and indices for the nearest queries.
// The strategy for executing the callback only for the primitives that are
// closest for every predicate is as follows:
// - Find the ranks and indices for the nearest queries using the overload not
// taking a callback.
// - Send the predicate-primitive pairs to the process where the match was
// found.
// - Execute the callback on the process owning the primitives.
// - Send the result back to the process owning the predicates.

// Find the ranks and indices for the nearest queries using the overload not
// taking a callback.
queryDispatchImpl(NearestPredicateTag{}, tree, space, queries, indices,
offset, ranks);

Kokkos::Profiling::pushRegion(
"ArborX::DistributedTree::query::nearest::postprocess_callback");

// Send the predicate-primitive pairs to the process where the match was
// found.
auto comm = tree.getComm();
int comm_rank;
MPI_Comm_rank(comm, &comm_rank);
Expand Down Expand Up @@ -746,7 +758,7 @@ DistributedTreeImpl<DeviceType>::queryDispatch(
sendAcrossNetwork(space, distributor, exported_queries_with_indices,
imported_queries_with_indices);

// execute imported queries
// Execute the callback on the process owning the primitives.
OutputView remote_out(
Kokkos::view_alloc(space, Kokkos::WithoutInitializing,
"ArborX::DistributedTree::query::remote_out"),
Expand All @@ -765,7 +777,7 @@ DistributedTreeImpl<DeviceType>::queryDispatch(
});
});

// communicate results back to the source MPI ranks
// Send the result back to the process owning the predicates.
Distributor<DeviceType> back_distributor(comm);
auto const &dest = distributor.get_sources();
auto const &off = distributor.get_source_offsets();
Expand Down

0 comments on commit c47b028

Please sign in to comment.