2 /* Creator: Jeffrey Vetter (vetter3@llnl.gov) Thu Feb 24 2000 */
6 "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/comm-simple.c,v 1.2 2000/12/04 19:09:45 bronis Exp $";
16 main (int argc, char **argv)
20 MPI_Comm comm = MPI_COMM_WORLD;
21 char processor_name[128];
26 MPI_Init (&argc, &argv);
27 MPI_Comm_size (comm, &nprocs);
28 MPI_Comm_rank (comm, &rank);
29 MPI_Get_processor_name (processor_name, &namelen);
30 printf ("(%d) is alive on %s\n", rank, processor_name);
33 printf ("WARNING: doesn't really deadlock yet! work-in-progress.\n");
44 MPI_Comm_split (comm, color, key, &newcomm);
46 MPI_Comm_size (newcomm, &nsize);
47 MPI_Comm_rank (newcomm, &nrank);
48 printf ("world task %p/%d/%d maps to new comm task %p/%d/%d\n",
49 comm, nprocs, rank, newcomm, nsize, nrank);
56 MPI_Bcast (&dat, 1, MPI_INT, 0, newcomm);
58 printf ("world task %p/%d/%d maps to new comm task %p/%d/%d --> %d\n",
59 comm, nprocs, rank, newcomm, nsize, nrank, dat);
64 printf ("(%d) Finished normally\n", rank);