2 /* Creator: Bronis R. de Supinski (bronis@llnl.gov) */
4 /* type-no-free-exhaustive.c -- use all type constructors without freeing */
8 "$Header: /usr/gapps/asde/cvs-vault/umpire/tests/type-no-free-exhaustive.c,v 1.1 2002/05/29 16:09:51 bronis Exp $";
16 #define TYPE_CONSTRUCTOR_COUNT 6
19 main (int argc, char **argv)
23 MPI_Comm comm = MPI_COMM_WORLD;
24 char processor_name[128];
27 int blocklens[2], displs[2];
28 MPI_Datatype newtype[TYPE_CONSTRUCTOR_COUNT];
29 MPI_Datatype newtype2[TYPE_CONSTRUCTOR_COUNT];
32 MPI_Init (&argc, &argv);
33 MPI_Comm_size (comm, &nprocs);
34 MPI_Comm_rank (comm, &rank);
35 MPI_Get_processor_name (processor_name, &namelen);
36 printf ("(%d) is alive on %s\n", rank, processor_name);
39 newtype2[0] = MPI_DOUBLE;
40 newtype2[1] = MPI_CHAR;
41 blocklens[0] = blocklens[1] = 1;
47 /* create the types */
48 MPI_Type_struct (2, blocklens, displs, newtype2, &newtype[0]);
49 MPI_Type_vector (2, 3, 4, newtype[0], &newtype[1]);
50 MPI_Type_hvector (3, 2, 192, newtype[1], &newtype[2]);
52 MPI_Type_indexed (2, blocklens, displs, newtype[2], &newtype[3]);
54 MPI_Type_hindexed (2, blocklens, displs, newtype[3], &newtype[4]);
56 MPI_Type_contiguous (10, newtype[4], &newtype[5]);
60 printf ("(%d) Finished normally\n", rank);