X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/aac4ba41ea27fe8168bebed009abebd7e5c3f006..4cdc0f888550cbaefe6094ae801230336d005337:/teshsuite/smpi/mpich3-test/rma/accfence2.c diff --git a/teshsuite/smpi/mpich3-test/rma/accfence2.c b/teshsuite/smpi/mpich3-test/rma/accfence2.c index 4366e101a9..b0bf95823c 100644 --- a/teshsuite/smpi/mpich3-test/rma/accfence2.c +++ b/teshsuite/smpi/mpich3-test/rma/accfence2.c @@ -17,72 +17,75 @@ static char MTEST_Descrip[] = "Test MPI_Accumulate with fence"; */ -int main( int argc, char *argv[] ) +int main(int argc, char *argv[]) { int errs = 0; int rank, size, source; - int minsize = 2, count, i; - MPI_Comm comm; - MPI_Win win; - int *winbuf, *sbuf; + int minsize = 2, count, i; + MPI_Comm comm; + MPI_Win win; + int *winbuf, *sbuf; - MTest_Init( &argc, &argv ); + MTest_Init(&argc, &argv); - /* The following illustrates the use of the routines to - run through a selection of communicators and datatypes. - Use subsets of these for tests that do not involve combinations - of communicators, datatypes, and counts of datatypes */ - while (MTestGetIntracommGeneral( &comm, minsize, 1 )) { - if (comm == MPI_COMM_NULL) continue; - /* Determine the sender and receiver */ - MPI_Comm_rank( comm, &rank ); - MPI_Comm_size( comm, &size ); - source = 0; - - for (count = 1; count < 65000; count = count * 2) { - /* We compare with an integer value that can be as large as - size * (count * count + (1/2)*(size-1)) - For large machines (size large), this can exceed the - maximum integer for some large values of count. We check - that in advance and break this loop if the above value - would exceed MAX_INT. Specifically, + /* The following illustrates the use of the routines to + * run through a selection of communicators and datatypes. + * Use subsets of these for tests that do not involve combinations + * of communicators, datatypes, and counts of datatypes */ + while (MTestGetIntracommGeneral(&comm, minsize, 1)) { + if (comm == MPI_COMM_NULL) + continue; + /* Determine the sender and receiver */ + MPI_Comm_rank(comm, &rank); + MPI_Comm_size(comm, &size); + source = 0; - size*count*count + (1/2)*size*(size-1) > MAX_INT - count*count > (MAX_INT/size - (1/2)*(size-1)) - */ - if (count * count > (MAX_INT/size - (size-1)/2)) break; - winbuf = (int *)malloc( count * sizeof(int) ); - sbuf = (int *)malloc( count * sizeof(int) ); + for (count = 1; count < 65000; count = count * 2) { + /* We compare with an integer value that can be as large as + * size * (count * count + (1/2)*(size-1)) + * For large machines (size large), this can exceed the + * maximum integer for some large values of count. We check + * that in advance and break this loop if the above value + * would exceed MAX_INT. Specifically, + * + * size*count*count + (1/2)*size*(size-1) > MAX_INT + * count*count > (MAX_INT/size - (1/2)*(size-1)) + */ + if (count * count > (MAX_INT / size - (size - 1) / 2)) + break; + winbuf = (int *) malloc(count * sizeof(int)); + sbuf = (int *) malloc(count * sizeof(int)); - for (i=0; i