<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi,<br>
<br>
I have a question to the memory allocated in MPI_Win_allocate_shared.<br>
What happens if (see also pseudo code below)<br>
<br>
(*) the allocated memory is used in another MPI_Win_create and<br>
(*) the window created by MPI_Win_allocate_shared is freed and<br>
(*) the user program still works with the allocates shared memory<br>
     before the window created by MPI_Win_create is freed ?<br>
<br>
MPI 3.0, page 415, lines 6-8 specifies:<br>
<br>
If the window was created with MPI_WIN_ALLOCATE_SHARED, <br>
MPI_WIN_FREE will free the window memory that was allocated<br>
in MPI_WIN_ALLOCATE_SHARED.<br>
<br>
Thus main question:<br>
<br>
(a) Should the corresponding program fail or<br>
(b) should the program work correctly (i..e. the MPI library recognizes<br>
     that the memory is still used in another window) and the shared memory<br>
     is freed when the window created by MPI_Win_create is freed ?<br>
<br>
Best regards<br>
<br>
Hubert<br>
<br>
------- Pseudo code -------<br>
<br>
    MPI_Win_allocate_shared (shared_size, disp_unit, shared_info, comm,<br>
                             &shared_baseptr, &shared_win);<br>
<br>
    MPI_Win_create (shared_baseptr, shared_size, disp_unit,<br>
                    info2, comm, &win2);<br>
<br>
    /* Non-concurrent work/communication window shared_win */<br>
    ...<br>
<br>
    /* Non-concurrent communication on window win2 */<br>
    ...<br>
<br>
    /* Free window shared_win;<br>
       Is shared_baseptr really deallocated in MPI_Win_free<br>
       as defined on page 415 lines 6-8 ? */<br>
<br>
    MPI_Win_free (&shared_win);<br>
<br>
    /* Work on window win2 */<br>
    ...<br>
<br>
    /* Free window win2;<br>
       Is shared_baseptr deallocated in following MPI_Win_free */<br>
<br>
    MPI_Win_free (&win2);<br>
<br>
<br>
</div>
</body>
</html>