2 /* Creator: Bronis R. de Supinski (bronis@llnl.gov) Tue Aug 12 2003 */
6 "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/comm-bcast-deadlock.c,v 1.1 2003/09/02 15:57:49 bronis Exp $";
16 main (int argc, char **argv)
20 int comm = MPI_COMM_WORLD;
21 char processor_name[128];
23 MPI_Comm inverted_comm;
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);
34 MPI_Barrier (MPI_COMM_WORLD);
38 printf ("Incorrect number of tasks; exactly 3 required\n");
41 /* create inverted communicator... */
42 MPI_Comm_split (comm, 0, nprocs - rank, &inverted_comm);
45 MPI_Bcast (&rank, 1, MPI_INT, 1, inverted_comm);
46 MPI_Bcast (&bcast_rank, 1, MPI_INT, 2, comm);
49 MPI_Bcast (&rank, 1, MPI_INT, 2, comm);
50 MPI_Bcast (&bcast_rank, 1, MPI_INT, 1, inverted_comm);
53 MPI_Bcast (&bcast_rank, 1, MPI_INT, 2, comm);
54 MPI_Bcast (&bcast_rank, 1, MPI_INT, 1, inverted_comm);
60 printf ("(%d) Finished normally\n", rank);