X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d9c9e08948a8387e9e8ecb0fe67ab6b94ec2a66f..14a764d0473e5137d70be1909b292579acb112ce:/teshsuite/smpi/mpich3-test/rma/badrma.c diff --git a/teshsuite/smpi/mpich3-test/rma/badrma.c b/teshsuite/smpi/mpich3-test/rma/badrma.c index 8e0dfb126d..8c642c6514 100644 --- a/teshsuite/smpi/mpich3-test/rma/badrma.c +++ b/teshsuite/smpi/mpich3-test/rma/badrma.c @@ -9,11 +9,11 @@ #define SIZE 100 -MPI_Win win; -int win_buf[SIZE], origin_buf[SIZE], result_buf[SIZE]; int do_test(int origin_count, MPI_Datatype origin_type, int result_count, - MPI_Datatype result_type, int target_count, MPI_Datatype target_type) + MPI_Datatype result_type, int target_count, MPI_Datatype target_type, MPI_Win win, int* win_buf, int* origin_buf, int* result_buf); +int do_test(int origin_count, MPI_Datatype origin_type, int result_count, + MPI_Datatype result_type, int target_count, MPI_Datatype target_type, MPI_Win win, int* win_buf, int* origin_buf, int* result_buf) { int errs = 0, ret, origin_type_size, result_type_size; @@ -70,6 +70,8 @@ int do_test(int origin_count, MPI_Datatype origin_type, int result_count, int main(int argc, char *argv[]) { + MPI_Win win; + int win_buf[SIZE], origin_buf[SIZE], result_buf[SIZE]; int rank, nprocs, i, j, k; int errs = 0; MPI_Datatype types[4]; @@ -94,7 +96,7 @@ int main(int argc, char *argv[]) types[3] = MPI_DOUBLE; MPI_Win_create(win_buf, SIZE * sizeof(int), sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &win); - + MPI_Win_set_errhandler(win, MPI_ERRORS_RETURN); MPI_Win_fence(0, win); if (rank == 0) { @@ -102,41 +104,41 @@ int main(int argc, char *argv[]) for (i = 0; i < 4; i++) for (j = 0; j < 4; j++) for (k = 0; k < 4; k++) - do_test(0, types[i], 0, types[j], 0, types[k]); + do_test(0, types[i], 0, types[j], 0, types[k], win, win_buf, origin_buf, result_buf); /* single zero-size datatype, but non-zero count */ for (i = 1; i < 4; i++) { for (j = 1; j < 4; j++) { - do_test(1, types[0], 0, types[i], 0, types[j]); - do_test(0, types[i], 1, types[0], 0, types[j]); - do_test(0, types[i], 0, types[j], 1, types[0]); + do_test(1, types[0], 0, types[i], 0, types[j], win, win_buf, origin_buf, result_buf); + do_test(0, types[i], 1, types[0], 0, types[j], win, win_buf, origin_buf, result_buf); + do_test(0, types[i], 0, types[j], 1, types[0], win, win_buf, origin_buf, result_buf); } } /* two zero-size datatypes, but non-zero count */ for (i = 1; i < 4; i++) { - do_test(1, types[0], 1, types[0], 0, types[i]); - do_test(1, types[0], 0, types[i], 1, types[0]); - do_test(0, types[i], 1, types[0], 1, types[0]); + do_test(1, types[0], 1, types[0], 0, types[i], win, win_buf, origin_buf, result_buf); + do_test(1, types[0], 0, types[i], 1, types[0], win, win_buf, origin_buf, result_buf); + do_test(0, types[i], 1, types[0], 1, types[0], win, win_buf, origin_buf, result_buf); - do_test(1, types[0], 2, types[0], 0, types[i]); - do_test(2, types[0], 1, types[0], 0, types[i]); + do_test(1, types[0], 2, types[0], 0, types[i], win, win_buf, origin_buf, result_buf); + do_test(2, types[0], 1, types[0], 0, types[i], win, win_buf, origin_buf, result_buf); - do_test(1, types[0], 0, types[i], 2, types[0]); - do_test(2, types[0], 0, types[i], 1, types[0]); + do_test(1, types[0], 0, types[i], 2, types[0], win, win_buf, origin_buf, result_buf); + do_test(2, types[0], 0, types[i], 1, types[0], win, win_buf, origin_buf, result_buf); - do_test(0, types[i], 1, types[0], 2, types[0]); - do_test(0, types[i], 2, types[0], 1, types[0]); + do_test(0, types[i], 1, types[0], 2, types[0], win, win_buf, origin_buf, result_buf); + do_test(0, types[i], 2, types[0], 1, types[0], win, win_buf, origin_buf, result_buf); } /* three zero-size datatypes, but non-zero count */ - do_test(1, types[0], 1, types[0], 1, types[0]); - do_test(1, types[0], 1, types[0], 2, types[0]); - do_test(1, types[0], 2, types[0], 1, types[0]); - do_test(1, types[0], 2, types[0], 2, types[0]); - do_test(2, types[0], 1, types[0], 1, types[0]); - do_test(2, types[0], 1, types[0], 2, types[0]); - do_test(2, types[0], 2, types[0], 1, types[0]); + do_test(1, types[0], 1, types[0], 1, types[0], win, win_buf, origin_buf, result_buf); + do_test(1, types[0], 1, types[0], 2, types[0], win, win_buf, origin_buf, result_buf); + do_test(1, types[0], 2, types[0], 1, types[0], win, win_buf, origin_buf, result_buf); + do_test(1, types[0], 2, types[0], 2, types[0], win, win_buf, origin_buf, result_buf); + do_test(2, types[0], 1, types[0], 1, types[0], win, win_buf, origin_buf, result_buf); + do_test(2, types[0], 1, types[0], 2, types[0], win, win_buf, origin_buf, result_buf); + do_test(2, types[0], 2, types[0], 1, types[0], win, win_buf, origin_buf, result_buf); } MPI_Win_fence(0, win);