Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
first commit to add the mpich-test suite to smpi tesh suite. Obviously all tests...
[simgrid.git] / teshsuite / smpi / mpich-test / coll / allredmany.c
1 #include <stdio.h>
2 #include "mpi.h"
3 #include "test.h"
4
5 /*
6  * This example should be run with 2 processes and tests the ability of the
7  * implementation to handle a flood of one-way messages.
8  */
9
10 int main( int argc, char **argv )
11 {
12   double wscale = 10.0, scale;
13   int numprocs, myid,i,namelen;
14   char processor_name[MPI_MAX_PROCESSOR_NAME];
15
16   MPI_Init(&argc,&argv);
17   MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
18   MPI_Comm_rank(MPI_COMM_WORLD,&myid);
19   MPI_Get_processor_name(processor_name,&namelen);
20
21   /* fprintf(stderr,"Process %d on %s\n",
22           myid, processor_name); */
23   for ( i=0; i<10000; i++) {
24     MPI_Allreduce(&wscale,&scale,1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD);
25   }
26   MPI_Finalize();
27   return 0;
28 }