Closed csubich closed 1 year ago
First, I don't care whether your program is strictly compliant or not - Intel MPI should not crash like that. They have all the necessary information to clean up windows during finalization and not crash. MPICH built with the necessary debug options will report every single handle that's still active during finalize, so the infrastructure is already there inside of Intel MPI.
Second, I have yet to find anything in the standard that says your program is wrong, but I'll wait until others have weighed in to take a strong position here.
Here's what I found so far:
§ 11.2.2
Before an MPI process invokes MPI_FINALIZE, the process must perform all MPI calls needed to complete its involvement in MPI communications associated with the World Model. It must locally complete all MPI operations that it initiated and must execute matching calls needed to complete MPI communications initiated by other processes.
The call to MPI_FINALIZE does not free objects created by MPI calls; these objects are freed using MPI_XXX_FREE calls.
This does not state that windows must freed, only that finalize doesn't free them. It says you must complete all communication, but you haven't initiated any in your example program.
A future version of the standard should clarify this situation for all objects.
Can you please recreate this issue under https://github.com/mpi-forum/mpi-issues/issues? It is more general than RMA and should be looked at by more people. Thanks!
Closing this in favor of https://github.com/mpi-forum/mpi-issues/issues/711
Greetings,
Recently, I was surprised by an error at
MPI_Finalize
on Intel's MPI implementation (MPICH-based, I think) with the following code:The error was evidently mine, for not freeing the
MPI_Win
object before the call toMPI_Finalize
. After some long discussion in the above-linked Intel thread, I've convinced myself that the specification does allow implementations to treat this as an error, making the call toMPI_Win_free
obligatory.However, this requirement does not appear to be obvious. The language around
MPI_Finalize
refers to completing communications, and my mental model of anMPI_Win
object was that it was more like a communicator object (which does not need to be explicitly freed) than a request (which must be completed).Might a future version of the MPI specification highlight this requirement more explicitly?