-
Notifications
You must be signed in to change notification settings - Fork 39
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
Avoid double free in distributed tree #369
Conversation
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.
I don't see how it resolves overlapping contexts from multiple copies of the same tree, see comment.
Multiple copies would now share the same communicator. What if both of them send/receive messages at the same time? I suspect that would result in potential conflicts. |
I saw your comment. This is indeed not addressing the situation you describe but the solution I propose is an improvement over the status quo. Copies may occur without the user having the intention to search tree in multiple contexts. |
From #368 (comment)
|
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.
I cannot think of a better way to achieve the goal within the scope of this PR.
|
afd327c
to
aec043c
Compare
aec043c
to
275981b
Compare
src/ArborX_DistributedSearchTree.hpp
Outdated
_comm_ptr.reset( | ||
[comm]() { | ||
auto p = std::make_unique<MPI_Comm>(); | ||
MPI_Comm_dup(comm, p.get()); | ||
return p.release(); | ||
}(), | ||
[](MPI_Comm *p) { | ||
MPI_Comm_free(p); | ||
delete p; | ||
}); |
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.
Please add comments explaining the reasons behind this complication, including what problems it is trying to solve.
Retest this please |
Do we really care to wait for the HIP build to be fixed? |
Blame me if there are any warnings we were missing. |
Proposed resolution for #368
Stores the duplicated comm in a smart pointer with a custom deleter.