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 / type-no-error.c
1 /* -*- Mode: C; -*- */
2 /* Creator: Bronis R. de Supinski (bronis@llnl.gov) */
3
4 /* type-no-error.c -- construct a type and free it */
5
6 #ifndef lint
7 static char *rcsid =
8   "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/type-no-error.c,v 1.1 2002/05/29 16:09:51 bronis 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_Datatype newtype, newtype2;
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_Type_contiguous (128, MPI_INT, &newtype);
37   MPI_Type_free (&newtype);
38   MPI_Barrier (comm);
39   /* now with an alias... */
40   MPI_Type_contiguous (128, MPI_INT, &newtype);
41   newtype2 = newtype;
42   MPI_Type_free (&newtype2);
43   MPI_Barrier (comm);
44
45   printf ("(%d) Finished normally\n", rank);
46   MPI_Finalize ();
47 }
48
49 /* EOF */