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-dup-no-free.c
1 /* -*- Mode: C; -*- */
2 /* Creator: Jeffrey Vetter (vetter3@llnl.gov) Thu Feb 24 2000 */
3
4 /* type-commit-twice.c -- do a type commit twice w/ the same type */
5
6 #ifndef lint
7 static char *rcsid =
8   "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/comm-dup-no-free.c,v 1.1.1.1 2000/08/23 17:28:26 vetter Exp $";
9 #endif
10
11 #include <stdio.h>
12 #include <string.h>
13 #include "mpi.h"
14
15 #define buf_size 128
16
17 int
18 main (int argc, char **argv)
19 {
20   int nprocs = -1;
21   int rank = -1;
22   MPI_Comm comm = MPI_COMM_WORLD;
23   char processor_name[128];
24   int namelen = 128;
25   MPI_Comm newcomm;
26
27   /* init */
28   MPI_Init (&argc, &argv);
29   MPI_Comm_size (comm, &nprocs);
30   MPI_Comm_rank (comm, &rank);
31   MPI_Get_processor_name (processor_name, &namelen);
32   printf ("(%d) is alive on %s\n", rank, processor_name);
33   fflush (stdout);
34
35   MPI_Barrier (comm);
36   MPI_Comm_dup (comm, &newcomm);        /* not freed */
37   MPI_Barrier (comm);
38
39   printf ("(%d) Finished normally\n", rank);
40   MPI_Finalize ();
41 }
42
43 /* EOF */