X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fc0a76c21f0bceb0314aee5d62f785ea8009495e..5ca17dc381bb7fba4f2689143e2080f7549ee0ab:/teshsuite/smpi/mpich3-test/rma/lockcontention2.c diff --git a/teshsuite/smpi/mpich3-test/rma/lockcontention2.c b/teshsuite/smpi/mpich3-test/rma/lockcontention2.c index bae541f154..9374980183 100644 --- a/teshsuite/smpi/mpich3-test/rma/lockcontention2.c +++ b/teshsuite/smpi/mpich3-test/rma/lockcontention2.c @@ -3,13 +3,13 @@ * (C) 2010 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ -#include "mpi.h" +#include "mpi.h" #include "stdio.h" #include "stdlib.h" #include "mpitest.h" -/* - * Tests for lock contention, including special cases within the MPICH code +/* + * Tests for lock contention, including special cases within the MPICH code * (any MPI implementation should pass these tests; in the MPICH case, our * coverage analysis showed that the lockcontention.c test was not covering * all cases, and in fact, this test revealed a bug in the code). @@ -26,279 +26,261 @@ #define NBLOCK 10 #define MAX_ERRS_REPORT 10 -/* +/* * Each process writes data into the rmabuf on the process with target rank * trank. The final result in rmabuf are the consecutive integers starting - * from 0. Each process, however, does not write a consecutive block. + * from 0. Each process, however, does not write a consecutive block. * Instead, they write these locations: * * for i=0,...,NELM-1 * for j=0,...,NBLOCK-1 * j + NBLOCK * (rank + i * wsize) - * + * * The value written is the location. * * In many cases, multiple RMA operations are needed. Where these must not * overlap, the above pattern is replicated at NBLOCK*NELM*wsize. - * (NBLOCK is either 1 or NBLOCK in the code below, depending on use) + * (NBLOCK is either 1 or NBLOCK in the code below, depending on use) */ static int toterrs = 0; -int testValues( int, int, int, int *, const char * ); +int testValues(int, int, int, int *, const char *); -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) +{ int rank, wsize, i, j, cnt; int *rmabuf, *localbuf, *localbuf2, *vals; MPI_Win win; int trank = 0; int windowsize; - MTest_Init(&argc,&argv); - MPI_Comm_size(MPI_COMM_WORLD,&wsize); - MPI_Comm_rank(MPI_COMM_WORLD,&rank); + MTest_Init(&argc, &argv); + MPI_Comm_size(MPI_COMM_WORLD, &wsize); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (wsize < 2) { fprintf(stderr, "Run this program with at least 2 processes\n"); - MPI_Abort(MPI_COMM_WORLD,1); + MPI_Abort(MPI_COMM_WORLD, 1); } - windowsize = (2*NBLOCK + 2) * NELM * wsize; - rmabuf = (int *)malloc( windowsize * sizeof(int) ); - localbuf = (int *)malloc( NELM * sizeof(int) ); - localbuf2 = (int *)malloc( NELM * NBLOCK * sizeof(int) ); - vals = (int *)malloc( NELM*sizeof(int) ); + windowsize = (2 * NBLOCK + 2) * NELM * wsize; + rmabuf = (int *) malloc(windowsize * sizeof(int)); + localbuf = (int *) malloc(NELM * sizeof(int)); + localbuf2 = (int *) malloc(NELM * NBLOCK * sizeof(int)); + vals = (int *) malloc(NELM * sizeof(int)); - /* + /* * Initialize the buffers */ - for (i=0; i