2 /* Creator: Jeffrey Vetter (vetter3@llnl.gov) Thu Feb 24 2000 */
6 "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/comm-deadlock.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];
27 MPI_Init (&argc, &argv);
28 MPI_Comm_size (comm, &nprocs);
29 MPI_Comm_rank (comm, &rank);
30 MPI_Get_processor_name (processor_name, &namelen);
31 printf ("(%d) is alive on %s\n", rank, processor_name);
38 printf ("Creating first new comm\n");
45 MPI_Comm_split (comm, color, key, &nc1);
46 MPI_Comm_size (nc1, &nsize);
47 MPI_Comm_rank (nc1, &nrank);
48 printf ("world task %d/%d/%d maps to new comm task %d/%d/%d\n",
49 comm, nprocs, rank, nc1, nsize, nrank);
54 printf ("Entering deadlock state.....\n");
58 MPI_Bcast (&dat, 1, MPI_INT, 0, nc1);
62 MPI_Bcast (&dat, 1, MPI_INT, 0, comm);
67 printf ("(%d) Finished normally\n", rank);