MPI_Win_allocate() does not return

79 Views Asked by At

When I run the following code with mpirun -n 2 ./out it works with no problem but with mpirun -n 3 ./out MPI_Win_allocate() does not return. I checked this out by printing to the screen before and after MPI_Win_allocate(). Also, if I comment out MPI_Bcast() the code works. What is the problem?

EDIT: Changed boost functions to standard ones to simplify the problem.

#include <mpi.h>

int main()
{
    MPI_Init(NULL, NULL);

    int nmesh;
    MPI_Bcast(&nmesh, 1, MPI_INT, 0, MPI_COMM_WORLD);         

    MPI_Win win;
    int* narrival;
    MPI_Win_allocate(1*sizeof(int), sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &narrival, &win);
    MPI_Win_free(&win);

    MPI_Finalize();

    return 0;
}
0

There are 0 best solutions below