2 /* Creator: Bronis R. de Supinski (bronis@llnl.gov) */
4 /* group-no-error3.c -- "correctly" construct many groups and free them */
8 "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/group-no-error3.c,v 1.1 2003/01/13 18:31:48 bronis Exp $";
12 /* NOTE: Some value of ITERATIONS will imply resource exhaustion */
13 /* either in Umpire or MPI no matter how things are implemented */
14 /* the best we can hope for is to fail gracefully... */
15 /* UNKNOWN N breaks umpire due to running out of memory as of 12/20/02... */
16 /* FAILURE IS NOT GRACEFUL AS OF THIS TIME... */
17 #define ITERATIONS 100
27 main (int argc, char **argv)
32 char processor_name[128];
34 MPI_Group worldgroup, newgroup[ITERATIONS];
37 MPI_Init (&argc, &argv);
38 MPI_Comm_size (MPI_COMM_WORLD, &nprocs);
39 MPI_Comm_rank (MPI_COMM_WORLD, &rank);
40 MPI_Get_processor_name (processor_name, &namelen);
41 printf ("(%d) is alive on %s\n", rank, processor_name);
44 MPI_Comm_group (MPI_COMM_WORLD, &worldgroup);
46 MPI_Barrier (MPI_COMM_WORLD);
48 for (i = 0; i < ITERATIONS; i++) {
49 /* create groups that don't include the local rank... */
50 MPI_Group_excl (worldgroup, 1, &rank, &newgroup[i]);
53 for (i = 0; i < ITERATIONS; i++) {
54 MPI_Group_free (&newgroup[i]);
57 MPI_Group_free (&worldgroup);
58 MPI_Barrier (MPI_COMM_WORLD);
59 printf ("(%d) Finished normally\n", rank);