X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fc0a76c21f0bceb0314aee5d62f785ea8009495e..5ca17dc381bb7fba4f2689143e2080f7549ee0ab:/teshsuite/smpi/mpich3-test/rma/accfence2_am.c diff --git a/teshsuite/smpi/mpich3-test/rma/accfence2_am.c b/teshsuite/smpi/mpich3-test/rma/accfence2_am.c index 11d2fb770a..0d11fb4535 100644 --- a/teshsuite/smpi/mpich3-test/rma/accfence2_am.c +++ b/teshsuite/smpi/mpich3-test/rma/accfence2_am.c @@ -19,79 +19,79 @@ static char MTEST_Descrip[] = "Test MPI_Accumulate with fence"; /* same as accfence2.c, but uses alloc_mem */ -int main( int argc, char *argv[] ) +int main(int argc, char *argv[]) { int errs = 0; - int rank, size, source, dest; - int minsize = 2, count, i; - MPI_Comm comm; - MPI_Win win; - MPI_Datatype datatype; - int *winbuf, *sbuf; + int rank, size, source; + 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; - dest = size - 1; - - for (count = 32768; count < 65000; count = count * 2) { - datatype = MPI_INT; + /* 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; - /* 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, + for (count = 32768; count < 65000; count = count * 2) { - 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; + /* 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; - MPI_Alloc_mem( count * sizeof(int), MPI_INFO_NULL, &winbuf ); - MPI_Alloc_mem( count * sizeof(int), MPI_INFO_NULL, &sbuf ); + MPI_Alloc_mem(count * sizeof(int), MPI_INFO_NULL, &winbuf); + MPI_Alloc_mem(count * sizeof(int), MPI_INFO_NULL, &sbuf); - for (i=0; i