You don't. The memory is freed when the window is freed by MPI_Win_free (). See
MPI-3.1 § 11.2.5
-Nathan
On Apr 24, 2017, at 11:41 AM, Benjamin Brock <br...@berkeley.edu> wrote:
How are we meant to free memory allocated with MPI_Win_allocate()? The
following crashes for me with OpenMPI 1.10.6:
#include <cstdlib>
#include <cstdio>
#include <mpi.h>
int main(int argc, char **argv) {
MPI_Init(&argc, &argv);
int n = 1000;
int *a;
MPI_Win win;
MPI_Win_allocate(n*sizeof(int), sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &a,
&win);
/* Why does the following crash? */
MPI_Free_mem(a);
MPI_Finalize();
return 0;
}
Any suggestions?
Ben
_______________________________________________
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
_______________________________________________
users mailing list
users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/users