X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/99e8fb90a14e543c1a4b2feaf22a5c0670c2951a..f301027bdd26302bdc73aa7c93b022dd75439256:/examples/smpi/alltoall2.c diff --git a/examples/smpi/alltoall2.c b/examples/smpi/alltoall2.c index ae47160d1e..ef2068e0a7 100644 --- a/examples/smpi/alltoall2.c +++ b/examples/smpi/alltoall2.c @@ -42,27 +42,44 @@ #define MAXLEN 10000 - -void main() + +int main(int argc, char *argv[]) { - int out[1000000],in[1000000],i,j,k; - int myself,tasks; - - MPI_Init(0,0); - MPI_Comm_rank(MPI_COMM_WORLD,&myself); - MPI_Comm_size(MPI_COMM_WORLD,&tasks); - for(j=1;j<=MAXLEN;j*=10) { - for(i=0;i bad answer (%d) at index %d of %d (should be %d)\n", + myself, in[k + i * j], k + i * j, j * tasks, i); + break; + } } - } - MPI_Barrier(MPI_COMM_WORLD); - if(myself==0) printf("TEST COMPLETE\n"); - MPI_Finalize(); + } + } + MPI_Barrier(MPI_COMM_WORLD); + if (myself == 0) + printf("TEST COMPLETE\n"); + MPI_Finalize(); + return EXIT_SUCCESS; }