Benjamin Brock
2017-04-24 17:40:02 UTC
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
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