File: typemiscx.cxx

package info (click to toggle)
mpich 4.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 423,384 kB
  • sloc: ansic: 1,088,434; cpp: 71,364; javascript: 40,763; f90: 22,829; sh: 17,463; perl: 14,773; xml: 14,418; python: 10,265; makefile: 9,246; fortran: 8,008; java: 4,355; asm: 324; ruby: 176; lisp: 19; php: 8; sed: 4
file content (170 lines) | stat: -rw-r--r-- 5,737 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/*
 * Copyright (C) by Argonne National Laboratory
 *     See COPYRIGHT in top-level directory
 */

#include "mpi.h"
#include "mpitestconf.h"

#ifdef HAVE_IOSTREAM
// Not all C++ compilers have iostream instead of iostream.h
#include <iostream>
#ifdef HAVE_NAMESPACE_STD
// Those that do often need the std namespace; otherwise, a bare "cout"
// is likely to fail to compile
using namespace std;
#endif
#else
#include <iostream.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "mpitestcxx.h"

int main(int argc, char *argv[])
{
    int num_ints, num_adds, num_types, combiner, errs = 0;

    MPI::Init();

    /* Check for the Fortran Datatypes */
#ifdef HAVE_FORTRAN_BINDING
    /* First, the optional types.  We allow these to be DATATYPE_NULL */
    if (MPI::REAL4 != MPI::DATATYPE_NULL) {
        MPI::REAL4.Get_envelope(num_ints, num_adds, num_types, combiner);
        if (combiner != MPI::COMBINER_NAMED) {
            cout << "REAL4 not a NAMED type" << "\n";
            errs++;
        }
    }
    if (MPI::REAL8 != MPI::DATATYPE_NULL) {
        MPI::REAL8.Get_envelope(num_ints, num_adds, num_types, combiner);
        if (combiner != MPI::COMBINER_NAMED) {
            cout << "REAL8 not a NAMED type" << "\n";
            errs++;
        }
    }
    if (MPI::REAL16 != MPI::DATATYPE_NULL) {
        MPI::REAL16.Get_envelope(num_ints, num_adds, num_types, combiner);
        if (combiner != MPI::COMBINER_NAMED) {
            cout << "REAL16 not a NAMED type" << "\n";
            errs++;
        }
    }
    if (MPI::COMPLEX8 != MPI::DATATYPE_NULL) {
        MPI::COMPLEX8.Get_envelope(num_ints, num_adds, num_types, combiner);
        if (combiner != MPI::COMBINER_NAMED) {
            cout << "COMPLEX8 not a NAMED type" << "\n";
            errs++;
        }
    }
    if (MPI::COMPLEX16 != MPI::DATATYPE_NULL) {
        MPI::COMPLEX16.Get_envelope(num_ints, num_adds, num_types, combiner);
        if (combiner != MPI::COMBINER_NAMED) {
            cout << "COMPLEX16 not a NAMED type" << "\n";
            errs++;
        }
    }
    if (MPI::COMPLEX32 != MPI::DATATYPE_NULL) {
        MPI::COMPLEX32.Get_envelope(num_ints, num_adds, num_types, combiner);
        if (combiner != MPI::COMBINER_NAMED) {
            cout << "COMPLEX32 not a NAMED type" << "\n";
            errs++;
        }
    }
    if (MPI::INTEGER1 != MPI::DATATYPE_NULL) {
        MPI::INTEGER1.Get_envelope(num_ints, num_adds, num_types, combiner);
        if (combiner != MPI::COMBINER_NAMED) {
            cout << "INTEGER1 not a NAMED type" << "\n";
            errs++;
        }
    }
    if (MPI::INTEGER2 != MPI::DATATYPE_NULL) {
        MPI::INTEGER2.Get_envelope(num_ints, num_adds, num_types, combiner);
        if (combiner != MPI::COMBINER_NAMED) {
            cout << "INTEGER2 not a NAMED type" << "\n";
            errs++;
        }
    }
    if (MPI::INTEGER4 != MPI::DATATYPE_NULL) {
        MPI::INTEGER4.Get_envelope(num_ints, num_adds, num_types, combiner);
        if (combiner != MPI::COMBINER_NAMED) {
            cout << "INTEGER4 not a NAMED type" << "\n";
            errs++;
        }
    }
    if (MPI::INTEGER8 != MPI::DATATYPE_NULL) {
        MPI::INTEGER8.Get_envelope(num_ints, num_adds, num_types, combiner);
        if (combiner != MPI::COMBINER_NAMED) {
            cout << "INTEGER8 not a NAMED type" << "\n";
            errs++;
        }
    }
#ifdef HAVE_MPI_INTEGER16
    if (MPI::INTEGER16 != MPI::DATATYPE_NULL) {
        MPI::INTEGER16.Get_envelope(num_ints, num_adds, num_types, combiner);
        if (combiner != MPI::COMBINER_NAMED) {
            cout << "INTEGER16 not a NAMED type" << "\n";
            errs++;
        }
    }
#endif
    /* Here end the optional types */

    MPI::INTEGER.Get_envelope(num_ints, num_adds, num_types, combiner);
    if (combiner != MPI::COMBINER_NAMED) {
        cout << "INTEGER not a NAMED type" << "\n";
        errs++;
    }
    MPI::REAL.Get_envelope(num_ints, num_adds, num_types, combiner);
    if (combiner != MPI::COMBINER_NAMED) {
        cout << "REAL not a NAMED type" << "\n";
        errs++;
    }
    MPI::DOUBLE_PRECISION.Get_envelope(num_ints, num_adds, num_types, combiner);
    if (combiner != MPI::COMBINER_NAMED) {
        cout << "DOUBLE_PRECISION not a NAMED type" << "\n";
        errs++;
    }
    MPI::F_COMPLEX.Get_envelope(num_ints, num_adds, num_types, combiner);
    if (combiner != MPI::COMBINER_NAMED) {
        cout << "F_COMPLEX not a NAMED type" << "\n";
        errs++;
    }
    MPI::F_DOUBLE_COMPLEX.Get_envelope(num_ints, num_adds, num_types, combiner);
    if (combiner != MPI::COMBINER_NAMED) {
        cout << "F_DOUBLE_COMPLEX not a NAMED type" << "\n";
        errs++;
    }
    MPI::LOGICAL.Get_envelope(num_ints, num_adds, num_types, combiner);
    if (combiner != MPI::COMBINER_NAMED) {
        cout << "LOGICAL not a NAMED type" << "\n";
        errs++;
    }
    MPI::CHARACTER.Get_envelope(num_ints, num_adds, num_types, combiner);
    if (combiner != MPI::COMBINER_NAMED) {
        cout << "CHARACTER not a NAMED type" << "\n";
        errs++;
    }
    MPI::TWOREAL.Get_envelope(num_ints, num_adds, num_types, combiner);
    if (combiner != MPI::COMBINER_NAMED) {
        cout << "TWOREAL not a NAMED type" << "\n";
        errs++;
    }
    MPI::TWODOUBLE_PRECISION.Get_envelope(num_ints, num_adds, num_types, combiner);
    if (combiner != MPI::COMBINER_NAMED) {
        cout << "TWODOUBLE_PRECISION not a NAMED type" << "\n";
        errs++;
    }
    MPI::TWOINTEGER.Get_envelope(num_ints, num_adds, num_types, combiner);
    if (combiner != MPI::COMBINER_NAMED) {
        cout << "TWOINTEGER not a NAMED type" << "\n";
        errs++;
    }
#endif

    MTest_Finalize(errs);

    return 0;
}