2 /* Creator: Bronis R. de Supinski (bronis@llnl.gov) Fri Dec 20 2002 */
4 /* comm-dup-no-error.c - "correctly" use many communicators... */
8 "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/comm-dup-no-error.c,v 1.1 2003/01/13 18:31:47 bronis Exp $";
11 /* NOTE: Some value of ITERATIONS will imply resource exhaustion */
12 /* either in Umpire or MPI no matter how things are implemented */
13 /* the best we can hope for is to fail gracefully... */
14 /* Approximately 4100 gets "ERROR: 0032-160 Too many communicators" */
15 /* with IBM's MPI (AIX 5.1.0, PSSP 3.4) as of 1/13/03... */
16 /* Umpire failure is graceful - comm creates are identified... */
17 /* UNKNOWN N breaks umpire due to running out of memory as of 1/13/03... */
18 /* UMPIRE FAILURE IS NOT GRACEFUL AS OF THIS TIME IN THIS CASE... */
29 main (int argc, char **argv)
34 char processor_name[128];
36 MPI_Comm newcomm[ITERATIONS];
39 MPI_Init (&argc, &argv);
40 MPI_Comm_size (MPI_COMM_WORLD, &nprocs);
41 MPI_Comm_rank (MPI_COMM_WORLD, &rank);
42 MPI_Get_processor_name (processor_name, &namelen);
43 printf ("(%d) is alive on %s\n", rank, processor_name);
46 MPI_Barrier (MPI_COMM_WORLD);
48 for (i = 0; i < ITERATIONS; i++) {
49 MPI_Comm_dup (MPI_COMM_WORLD, &newcomm[i]);
52 for (i = 0; i < ITERATIONS; i++) {
53 MPI_Barrier (newcomm[i]);
57 for (i = 0; i < ITERATIONS; i++) {
58 MPI_Comm_free (&newcomm[i]);
61 MPI_Barrier (MPI_COMM_WORLD);
63 printf ("(%d) Finished normally\n", rank);