~ubuntu-branches/ubuntu/raring/simgrid/raring

« back to all changes in this revision

Viewing changes to teshsuite/smpi/mpich-test/coll/bcastbug2.c

  • Committer: Package Import Robot
  • Author(s): Martin Quinson
  • Date: 2013-01-31 00:24:51 UTC
  • mfrom: (10.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20130131002451-krejhf7w7h24lpsc
Tags: 3.9~rc1-1
* New upstream release: the "Grasgory" release. Major changes:
  - Gras was completely removed from this version.
  - Documentation reorganization to ease browsing it.
  - New default value for the TCP_gamma parameter: 4MiB

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "mpi.h"
 
2
#include <stdlib.h>
 
3
#include <stdio.h>
 
4
#include "test.h"
 
5
 
 
6
int main( int argc, char **argv)
 
7
{
 
8
   char *buf;
 
9
   int i, iam;
 
10
   MPI_Init(&argc, &argv);
 
11
   MPI_Barrier(MPI_COMM_WORLD);
 
12
   buf = (char *)malloc(32*1024);
 
13
   MPI_Comm_rank(MPI_COMM_WORLD, &iam);
 
14
   for(i=1; i<=32; i++){
 
15
      if (iam == 0){
 
16
         *buf=i;
 
17
         printf("Broadcasting %d bytes\n", i*64);
 
18
         }
 
19
      MPI_Bcast(buf, i*64, MPI_BYTE, 0, MPI_COMM_WORLD);
 
20
      if (*buf != i) printf("Sanity check error on node %d\n", iam);
 
21
/*      gsync();
 
22
*/
 
23
      MPI_Barrier(MPI_COMM_WORLD);
 
24
      }
 
25
   Test_Waitforall( );
 
26
   MPI_Finalize();
 
27
 
 
28
   return 0;
 
29
}