Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reactivate an umpire test, once disabled in 56fefe1bf81ca.
[simgrid.git] / teshsuite / smpi / isp / umpire / type-commit-twice.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/type-commit-twice.c,v 1.4 2002/07/30 21:34:43 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;
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
37   MPI_Type_contiguous (128, MPI_INT, &newtype);
38   MPI_Type_commit (&newtype);
39
40   /* COMMITTING TWICE IS NOT AN ERROR - SEE:
41      http://www.mpi-forum.org/docs/mpi-20-html/node50.htm#Node50
42      AT MOST, UMPIRE SHOULD PROVIDE A CLEAR WARNING ABOUT MINOR
43      PERFORMANCE CONSEQUENCE (JUST A WASTED FUNCTION CALL)... */
44   MPI_Type_commit (&newtype);
45
46   MPI_Barrier (comm);
47
48   MPI_Type_free (&newtype);
49
50   printf ("(%d) Finished normally\n", rank);
51   MPI_Finalize ();
52 }
53
54 /* EOF */