Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reduce the size of partial shared malloc tests.
[simgrid.git] / teshsuite / smpi / mpich3-test / datatype / sizedtypes.c
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  *
4  *  (C) 2003 by Argonne National Laboratory.
5  *      See COPYRIGHT in top-level directory.
6  */
7 #include "mpi.h"
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include "mpitest.h"
11
12 /*
13 static char MTEST_Descrip[] = "Test of the sized types, supported in MPI-2";
14 */
15
16 int main(int argc, char *argv[])
17 {
18     int errs = 0;
19     int size;
20
21     MTest_Init(&argc, &argv);
22
23     MPI_Type_size(MPI_REAL4, &size);
24     if (size != 4) {
25         errs++;
26         printf("MPI_REAL4 has size %d\n", size);
27     }
28     MPI_Type_size(MPI_REAL8, &size);
29     if (size != 8) {
30         errs++;
31         printf("MPI_REAL8 has size %d\n", size);
32     }
33     if (MPI_REAL16 != MPI_DATATYPE_NULL) {
34         MPI_Type_size(MPI_REAL16, &size);
35         if (size != 16) {
36             errs++;
37             printf("MPI_REAL16 has size %d\n", size);
38         }
39     }
40
41     MPI_Type_size(MPI_COMPLEX8, &size);
42     if (size != 8) {
43         errs++;
44         printf("MPI_COMPLEX8 has size %d\n", size);
45     }
46     MPI_Type_size(MPI_COMPLEX16, &size);
47     if (size != 16) {
48         errs++;
49         printf("MPI_COMPLEX16 has size %d\n", size);
50     }
51     if (MPI_COMPLEX32 != MPI_DATATYPE_NULL) {
52         MPI_Type_size(MPI_COMPLEX32, &size);
53         if (size != 32) {
54             errs++;
55             printf("MPI_COMPLEX32 has size %d\n", size);
56         }
57     }
58
59     MPI_Type_size(MPI_INTEGER1, &size);
60     if (size != 1) {
61         errs++;
62         printf("MPI_INTEGER1 has size %d\n", size);
63     }
64     MPI_Type_size(MPI_INTEGER2, &size);
65     if (size != 2) {
66         errs++;
67         printf("MPI_INTEGER2 has size %d\n", size);
68     }
69     MPI_Type_size(MPI_INTEGER4, &size);
70     if (size != 4) {
71         errs++;
72         printf("MPI_INTEGER4 has size %d\n", size);
73     }
74     if (MPI_INTEGER8 != MPI_DATATYPE_NULL) {
75         MPI_Type_size(MPI_INTEGER8, &size);
76         if (size != 8) {
77             errs++;
78             printf("MPI_INTEGER8 has size %d\n", size);
79         }
80     }
81 #ifdef HAVE_MPI_INTEGER16
82     if (MPI_INTEGER16 != MPI_DATATYPE_NULL) {
83         MPI_Type_size(MPI_INTEGER16, &size);
84         if (size != 16) {
85             errs++;
86             printf("MPI_INTEGER16 has size %d\n", size);
87         }
88     }
89 #endif
90
91     MTest_Finalize(errs);
92     MPI_Finalize();
93     return 0;
94 }