Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / teshsuite / smpi / isp / umpire / comm-split-no-free.c
1 /* -*- Mode: C; -*- */
2 /* Creator: Jeffrey Vetter (vetter3@llnl.gov) Thu Feb 24 2000 */
3
4 #ifndef lint
5 static char *rcsid =
6   "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/comm-split-no-free.c,v 1.1.1.1 2000/08/23 17:28:26 vetter Exp $";
7 #endif
8
9 #include <stdio.h>
10 #include <string.h>
11 #include "mpi.h"
12
13 #define buf_size 128
14
15 int
16 main (int argc, char **argv)
17 {
18   int nprocs = -1;
19   int rank = -1;
20   MPI_Comm comm = MPI_COMM_WORLD;
21   char processor_name[128];
22   int namelen = 128;
23   MPI_Comm newcomm;
24
25   /* init */
26   MPI_Init (&argc, &argv);
27   MPI_Comm_size (comm, &nprocs);
28   MPI_Comm_rank (comm, &rank);
29   MPI_Get_processor_name (processor_name, &namelen);
30   printf ("(%d) is alive on %s\n", rank, processor_name);
31   fflush (stdout);
32
33   MPI_Barrier (comm);
34   {
35     int color = rank % 2;
36     int key = 1;
37     MPI_Comm_split (comm, color, key, &newcomm);        /* not freed */
38   }
39   MPI_Barrier (comm);
40
41   printf ("(%d) Finished normally\n", rank);
42   MPI_Finalize ();
43 }
44
45 /* EOF */