[Mpi3-rma] MPI_Win_allocate_shared and Win_free

Hubert Ritzdorf Hubert.Ritzdorf at EMEA.NEC.COM
Fri Jan 18 07:26:13 CST 2013


Hi,

I have a question to the memory allocated in MPI_Win_allocate_shared.
What happens if (see also pseudo code below)

(*) the allocated memory is used in another MPI_Win_create and
(*) the window created by MPI_Win_allocate_shared is freed and
(*) the user program still works with the allocates shared memory
     before the window created by MPI_Win_create is freed ?

MPI 3.0, page 415, lines 6-8 specifies:

If the window was created with MPI_WIN_ALLOCATE_SHARED,
MPI_WIN_FREE will free the window memory that was allocated
in MPI_WIN_ALLOCATE_SHARED.

Thus main question:

(a) Should the corresponding program fail or
(b) should the program work correctly (i..e. the MPI library recognizes
     that the memory is still used in another window) and the shared memory
     is freed when the window created by MPI_Win_create is freed ?

Best regards

Hubert

------- Pseudo code -------

    MPI_Win_allocate_shared (shared_size, disp_unit, shared_info, comm,
                             &shared_baseptr, &shared_win);

    MPI_Win_create (shared_baseptr, shared_size, disp_unit,
                    info2, comm, &win2);

    /* Non-concurrent work/communication window shared_win */
    ...

    /* Non-concurrent communication on window win2 */
    ...

    /* Free window shared_win;
       Is shared_baseptr really deallocated in MPI_Win_free
       as defined on page 415 lines 6-8 ? */

    MPI_Win_free (&shared_win);

    /* Work on window win2 */
    ...

    /* Free window win2;
       Is shared_baseptr deallocated in following MPI_Win_free */

    MPI_Win_free (&win2);


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-rma/attachments/20130118/0b9f1233/attachment.html>


More information about the mpiwg-rma mailing list