Patrick - Your program is erroneous, so the behavior of the MPI is not defined. The default implementation of RMA with Open MPI uses active-message like semantics to locally deliver the message, and does not do bounds checking, so the error was not caught.
Brian On Feb 11, 2011, at 5:41 AM, <patrick.le-...@bull.net> wrote: > Hi all, > I am testing the one-sided message passing (MPI_Put, MPI_Get) > and it seems to me that the size parameter of MPI_Win_create() > is definitly not taken into account. > > Then I can put/get messages using a window created with size=0 > (or put/get after any others limits between 0 and the original buffer size). > > I know that size=0 is not an usual practice but the man page say : > "A process may elect to expose no memory by specifying size = 0." > > I might still have misunderstood something ? > > Hereafter a simple test to reproduce the with Open MPI 1.5 > > Thx, > Patrick > > > /* > * compilation : > * mpicc -o a.out a.c > * > * execution : > * srun --resv-ports -n2 -N2 a.out > * > */ > > #include "mpi.h" > > #define SIZE_10 10 > #define RANK_1 1 > > int main(int argc, char *argv[]) { > int i, rank, nprocs, A[SIZE_10], B[SIZE_10]; > MPI_Win win; > int errs = 0; > > MPI_Init(&argc, &argv); > MPI_Comm_size(MPI_COMM_WORLD, &nprocs); > MPI_Comm_rank(MPI_COMM_WORLD, &rank); > > if (nprocs != 2) { > printf("%d is a bad process number : srun -n2 -N2 a.out \n", nprocs); > MPI_Finalize(); > return -1; > } > > for (i=0; i<SIZE_10; i++) { > A[i] = i+1; > B[i] = (-1)*(i+1); > } > > printf("[%d] create a window on A[] with size=0 \n", rank); > MPI_Win_create(A, 0, sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &win); > > if (rank == 0) { > printf("[%d] call MPI_Get(B, %d, ...) \n", rank, SIZE_10); > MPI_Win_lock(MPI_LOCK_SHARED, RANK_1, 0, win); > MPI_Get(B, SIZE_10, MPI_INT, RANK_1, 0, SIZE_10, MPI_INT, win); > MPI_Win_unlock(RANK_1, win); > > for (i=0; i<SIZE_10; i++) { > if (B[i] != i+1) { > printf("[%d] MPI_Get error: B[%d]=%d, should be %d \n",rank, i, B[i], > i+1); > errs++; > } > } > > if (errs == 0) { > printf("[%d] No Error! \n", rank); > } > > } > > MPI_Barrier(MPI_COMM_WORLD); > MPI_Win_free(&win); > MPI_Finalize(); > } > > _______________________________________________ > users mailing list > us...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/users >