Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Ignore stdout/stderr of the umpire tests
[simgrid.git] / teshsuite / smpi / isp / umpire / group-no-error2.c
1 /* -*- Mode: C; -*- */
2 /* Creator: Bronis R. de Supinski (bronis@llnl.gov) */
3
4 /* group-no-error.c -- "correctly" construct many groups and free them */
5
6 #ifndef lint
7 static char *rcsid =
8   "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/group-no-error2.c,v 1.1 2003/01/13 18:31:48 bronis Exp $";
9 #endif
10
11
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
18
19
20 #include <stdio.h>
21 #include <string.h>
22 #include "mpi.h"
23
24 #define buf_size 128
25
26 int
27 main (int argc, char **argv)
28 {
29   int nprocs = -1;
30   int rank = -1;
31   int i;
32   char processor_name[128];
33   int namelen = 128;
34   MPI_Group newgroup[ITERATIONS];
35
36   /* init */
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);
42   fflush (stdout);
43
44   MPI_Barrier (MPI_COMM_WORLD);
45
46   for (i = 0; i < ITERATIONS; i++) {
47     MPI_Comm_group (MPI_COMM_WORLD, &newgroup[i]);
48   }
49
50   for (i = 0; i < ITERATIONS; i++) {
51     MPI_Group_free (&newgroup[i]);
52   }
53
54   MPI_Barrier (MPI_COMM_WORLD);
55   printf ("(%d) Finished normally\n", rank);
56   MPI_Finalize ();
57 }
58
59 /* EOF */