-
Notifications
You must be signed in to change notification settings - Fork 34
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
Allow default-initialized distributed tree #1040
Conversation
1347c56
to
4072adc
Compare
All tests pass except for SYCL. Trying to address the latter in #1041. |
4072adc
to
ba87832
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.
The empty tree state still does not feel right to me.
We did not spell out any precondition on the getComm()
member. Should we be initializing to MPI_COMM_NULL
or such?
Addressed. The preconditions to calling Whether |
Please do this instead diff --git a/src/ArborX_DistributedTree.hpp b/src/ArborX_DistributedTree.hpp
index f31ea1b8..229b60cf 100644
--- a/src/ArborX_DistributedTree.hpp
+++ b/src/ArborX_DistributedTree.hpp
@@ -50,13 +50,7 @@ public:
using bounding_volume_type = BoundingVolume;
using value_type = typename BottomTree::value_type;
- DistributedTreeBase()
- {
- _comm_ptr.reset([]() {
- auto p = std::make_unique<MPI_Comm>(MPI_COMM_NULL);
- return p.release();
- }());
- }
+ DistributedTreeBase() = default;
template <typename ExecutionSpace, typename... Args>
DistributedTreeBase(MPI_Comm comm, ExecutionSpace const &space,
@@ -115,7 +109,8 @@ protected:
private:
friend struct Details::DistributedTreeImpl;
- std::shared_ptr<MPI_Comm> _comm_ptr;
+ std::shared_ptr<MPI_Comm> _comm_ptr{
+ std::make_unique<MPI_Comm>(MPI_COMM_NULL)};
BottomTree _bottom_tree; // local
TopTree _top_tree; // replicated
size_type _top_tree_size{0}; |
Co-authored-by: Damien L-G <dalg24@gmail.com>
0ea0b44
to
b18786b
Compare
This would, for example, allow storing DistributedTree in user classes for later initialization.