X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fc0a76c21f0bceb0314aee5d62f785ea8009495e..5ec2b80b686983f84ebab7c7398a29e73286deee:/teshsuite/smpi/mpich3-test/rma/fetchandadd_am.c diff --git a/teshsuite/smpi/mpich3-test/rma/fetchandadd_am.c b/teshsuite/smpi/mpich3-test/rma/fetchandadd_am.c index 0ecde99535..0a70155798 100644 --- a/teshsuite/smpi/mpich3-test/rma/fetchandadd_am.c +++ b/teshsuite/smpi/mpich3-test/rma/fetchandadd_am.c @@ -3,74 +3,73 @@ * (C) 2001 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" /* Fetch and add example from Using MPI-2 (the non-scalable version, - Fig. 6.12). */ + Fig. 6.12). */ /* same as fetchandadd.c but uses alloc_mem */ -#define NTIMES 20 /* no of times each process calls the counter - routine */ +#define NTIMES 20 /* no of times each process calls the counter + * routine */ -int localvalue=0; /* contribution of this process to the counter. We - define it as a global variable because attribute - caching on the window is not enabled yet. */ +int localvalue = 0; /* contribution of this process to the counter. We + * define it as a global variable because attribute + * caching on the window is not enabled yet. */ void Get_nextval(MPI_Win win, int *val_array, MPI_Datatype get_type, int rank, int nprocs, int *value); int compar(const void *a, const void *b); -int main(int argc, char *argv[]) -{ - int rank, nprocs, i, blens[2], disps[2], *counter_mem, *val_array, - *results, *counter_vals; +int main(int argc, char *argv[]) +{ + int rank, nprocs, i, blens[2], disps[2], *counter_mem, *val_array, *results, *counter_vals; MPI_Datatype get_type; MPI_Win win; int errs = 0; - - MTest_Init(&argc,&argv); - MPI_Comm_size(MPI_COMM_WORLD,&nprocs); - MPI_Comm_rank(MPI_COMM_WORLD,&rank); + + MTest_Init(&argc, &argv); + MPI_Comm_size(MPI_COMM_WORLD, &nprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (rank == 0) { /* allocate counter memory and initialize to 0 */ /* counter_mem = (int *) calloc(nprocs, sizeof(int)); */ - i = MPI_Alloc_mem(nprocs*sizeof(int), MPI_INFO_NULL, &counter_mem); + i = MPI_Alloc_mem(nprocs * sizeof(int), MPI_INFO_NULL, &counter_mem); if (i) { printf("Can't allocate memory in test program\n"); MPI_Abort(MPI_COMM_WORLD, 1); } - for (i=0; i