We see an error with MS-MPI 10.1.1 when we try to allocate a shared memory window of size 0, e.g.:
MPI_Aint size = 0;
err = MPI_Win_allocate_shared(size, sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &shared, &win);
mpi_assert(err);
[0] fatal error
Fatal error in MPI_Win_allocate_shared: Other MPI error, error stack:
MPI_Win_allocate_shared(size=1169160520, disp_unit=0, info=0x4, comm=0x1c000000, baseptr=0x000000E144000000, win=0x000000E145AFF938) failed
CreateFileMapping failed, error 87
I know that creating a window of size 0 is not that useful. The error does not occur as soon I change the requested size from 0 to 1. However, the MPI 3 standard allows size to be 0, as the requirement for size is to be non-negative. Furthermore there is an extra note for MPI_Win_allocate_shared:
The size argument may be different at each process and size = 0 is valid.