10 main (int argc, char **argv)
13 MPI_Comm comm = MPI_COMM_WORLD;
14 char processor_name[128];
20 MPI_Init (&argc, &argv);
21 MPI_Comm_rank (comm, &rank);
22 MPI_Get_processor_name (processor_name, &namelen);
23 printf ("(%d) is alive on %s\n", rank, processor_name);
27 memset (buf0, 0, buf_size*sizeof(int));
28 MPI_Bcast (buf0, buf_size, MPI_INT, 1, MPI_COMM_WORLD);
29 MPI_Bcast (buf0, buf_size, MPI_INT, 0, MPI_COMM_WORLD);
33 memset (buf1, 1, buf_size*sizeof(int));
35 MPI_Bcast (buf0, buf_size, MPI_INT, 0, MPI_COMM_WORLD);
36 MPI_Bcast (buf0, buf_size, MPI_INT, 1, MPI_COMM_WORLD);
40 printf ("(%d) Finished normally\n", rank);