You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #135 we introduced duplicating of user-provided communicators to cleanly separate the library's communication from that of the user. We store the duplicated communicator inside ArborX::DistributedSearchTree. However, what we did not realize was that it can lead to the problem in the following situation:
The issue is that the destructor for the distributed tree, which contains MPI_comm_free(&_comm); will be called afterMPI_Finalize().
There is currently nothing in the interface to indicate that it cannot/should not be used this way. After searching online, I cannot say definitively what MPI_Finalize() does with non-freed communicators. But as it cleans up all MPI context, I think the proper fix would be to check if MPI is still initialized before freeing the communicator.
This is not a defect. This is expected. The MPI execution environment, just like the Kokkos one, needs to be properly initialized before you create our distributed tree data structure and these are not be finalized as long as any object is in scope.
aprokop
changed the title
Distributed search tree may try to free communicator after MPI_Finalize()
Document the that lifetime of the DistributedSearchTree should be within MPI initialization region
Jul 30, 2020
aprokop
changed the title
Document the that lifetime of the DistributedSearchTree should be within MPI initialization region
Document that the lifetime of the DistributedSearchTree should be within MPI initialization region
Sep 5, 2020
In #135 we introduced duplicating of user-provided communicators to cleanly separate the library's communication from that of the user. We store the duplicated communicator inside
ArborX::DistributedSearchTree
. However, what we did not realize was that it can lead to the problem in the following situation:The issue is that the destructor for the distributed tree, which contains
MPI_comm_free(&_comm);
will be called afterMPI_Finalize()
.There is currently nothing in the interface to indicate that it cannot/should not be used this way. After searching online, I cannot say definitively what
MPI_Finalize()
does with non-freed communicators. But as it cleans up all MPI context, I think the proper fix would be to check if MPI is still initialized before freeing the communicator.Reported-by: @mattbement
The text was updated successfully, but these errors were encountered: