X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/826897d361add5db3272a9810e70371a40ba1660..HEAD:/teshsuite/smpi/mpich3-test/rma/win_shared_noncontig.c diff --git a/teshsuite/smpi/mpich3-test/rma/win_shared_noncontig.c b/teshsuite/smpi/mpich3-test/rma/win_shared_noncontig.c index a6ab73ba1f..db25c332fc 100644 --- a/teshsuite/smpi/mpich3-test/rma/win_shared_noncontig.c +++ b/teshsuite/smpi/mpich3-test/rma/win_shared_noncontig.c @@ -15,14 +15,15 @@ const int verbose = 0; -int main(int argc, char **argv) { - int i, j, rank, nproc; - int shm_rank, shm_nproc; +int main(int argc, char **argv) +{ + int i, j, rank, nproc; + int shm_rank, shm_nproc; MPI_Info alloc_shared_info; - int errors = 0, all_errors = 0; - int disp_unit; - int *my_base; - MPI_Win shm_win; + int errors = 0, all_errors = 0; + int disp_unit; + int *my_base; + MPI_Win shm_win; MPI_Comm shm_comm; MPI_Init(&argc, &argv); @@ -39,8 +40,8 @@ int main(int argc, char **argv) { MPI_Comm_size(shm_comm, &shm_nproc); /* Allocate ELEM_PER_PROC integers for each process */ - MPI_Win_allocate_shared(sizeof(int)*ELEM_PER_PROC, sizeof(int), alloc_shared_info, - shm_comm, &my_base, &shm_win); + MPI_Win_allocate_shared(sizeof(int) * ELEM_PER_PROC, sizeof(int), alloc_shared_info, + shm_comm, &my_base, &shm_win); MPI_Win_lock_all(MPI_MODE_NOCHECK, shm_win); @@ -55,16 +56,16 @@ int main(int argc, char **argv) { /* Read and verify everyone's data */ for (i = 0; i < shm_nproc; i++) { - int *base; - MPI_Aint size; + int *base; + MPI_Aint size; MPI_Win_shared_query(shm_win, i, &size, &disp_unit, &base); - assert(size == ELEM_PER_PROC * sizeof(int)); + assert(size >= ELEM_PER_PROC * sizeof(int)); for (j = 0; j < ELEM_PER_PROC; j++) { - if ( base[j] != j ) { + if (base[j] != j) { errors++; - printf("%d -- Got %d at rank %d index %d, expected %d\n", shm_rank, + printf("%d -- Got %d at rank %d index %d, expected %d\n", shm_rank, base[j], i, j, j); } }