1 | // -*- c++ -*- |
---|
2 | // |
---|
3 | // Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana |
---|
4 | // University Research and Technology |
---|
5 | // Corporation. All rights reserved. |
---|
6 | // Copyright (c) 2004-2005 The University of Tennessee and The University |
---|
7 | // of Tennessee Research Foundation. All rights |
---|
8 | // reserved. |
---|
9 | // Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, |
---|
10 | // University of Stuttgart. All rights reserved. |
---|
11 | // Copyright (c) 2004-2005 The Regents of the University of California. |
---|
12 | // All rights reserved. |
---|
13 | // Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved. |
---|
14 | // $COPYRIGHT$ |
---|
15 | // |
---|
16 | // Additional copyrights may follow |
---|
17 | // |
---|
18 | // $HEADER$ |
---|
19 | // |
---|
20 | |
---|
21 | |
---|
22 | // return codes |
---|
23 | static const int SUCCESS = MPI_SUCCESS; |
---|
24 | static const int ERR_BUFFER = MPI_ERR_BUFFER; |
---|
25 | static const int ERR_COUNT = MPI_ERR_COUNT; |
---|
26 | static const int ERR_TYPE = MPI_ERR_TYPE; |
---|
27 | static const int ERR_TAG = MPI_ERR_TAG ; |
---|
28 | static const int ERR_COMM = MPI_ERR_COMM; |
---|
29 | static const int ERR_RANK = MPI_ERR_RANK; |
---|
30 | static const int ERR_REQUEST = MPI_ERR_REQUEST; |
---|
31 | static const int ERR_ROOT = MPI_ERR_ROOT; |
---|
32 | static const int ERR_GROUP = MPI_ERR_GROUP; |
---|
33 | static const int ERR_OP = MPI_ERR_OP; |
---|
34 | static const int ERR_TOPOLOGY = MPI_ERR_TOPOLOGY; |
---|
35 | static const int ERR_DIMS = MPI_ERR_DIMS; |
---|
36 | static const int ERR_ARG = MPI_ERR_ARG; |
---|
37 | static const int ERR_UNKNOWN = MPI_ERR_UNKNOWN; |
---|
38 | static const int ERR_TRUNCATE = MPI_ERR_TRUNCATE; |
---|
39 | static const int ERR_OTHER = MPI_ERR_OTHER; |
---|
40 | static const int ERR_INTERN = MPI_ERR_INTERN; |
---|
41 | static const int ERR_PENDING = MPI_ERR_PENDING; |
---|
42 | static const int ERR_IN_STATUS = MPI_ERR_IN_STATUS; |
---|
43 | static const int ERR_LASTCODE = MPI_ERR_LASTCODE; |
---|
44 | |
---|
45 | static const int ERR_BASE = MPI_ERR_BASE; |
---|
46 | static const int ERR_INFO_VALUE = MPI_ERR_INFO_VALUE; |
---|
47 | static const int ERR_INFO_KEY = MPI_ERR_INFO_KEY; |
---|
48 | static const int ERR_INFO_NOKEY = MPI_ERR_INFO_NOKEY; |
---|
49 | static const int ERR_KEYVAL = MPI_ERR_KEYVAL; |
---|
50 | static const int ERR_NAME = MPI_ERR_NAME; |
---|
51 | static const int ERR_NO_MEM = MPI_ERR_NO_MEM; |
---|
52 | static const int ERR_SERVICE = MPI_ERR_SERVICE; |
---|
53 | static const int ERR_SPAWN = MPI_ERR_SPAWN; |
---|
54 | static const int ERR_WIN = MPI_ERR_WIN; |
---|
55 | |
---|
56 | |
---|
57 | // assorted constants |
---|
58 | OMPI_DECLSPEC extern void* const BOTTOM; |
---|
59 | OMPI_DECLSPEC extern void* const IN_PLACE; |
---|
60 | static const int PROC_NULL = MPI_PROC_NULL; |
---|
61 | static const int ANY_SOURCE = MPI_ANY_SOURCE; |
---|
62 | static const int ROOT = MPI_ROOT; |
---|
63 | static const int ANY_TAG = MPI_ANY_TAG; |
---|
64 | static const int UNDEFINED = MPI_UNDEFINED; |
---|
65 | static const int BSEND_OVERHEAD = MPI_BSEND_OVERHEAD; |
---|
66 | static const int KEYVAL_INVALID = MPI_KEYVAL_INVALID; |
---|
67 | static const int ORDER_C = MPI_ORDER_C; |
---|
68 | static const int ORDER_FORTRAN = MPI_ORDER_FORTRAN; |
---|
69 | static const int DISTRIBUTE_BLOCK = MPI_DISTRIBUTE_BLOCK; |
---|
70 | static const int DISTRIBUTE_CYCLIC = MPI_DISTRIBUTE_CYCLIC; |
---|
71 | static const int DISTRIBUTE_NONE = MPI_DISTRIBUTE_NONE; |
---|
72 | static const int DISTRIBUTE_DFLT_DARG = MPI_DISTRIBUTE_DFLT_DARG; |
---|
73 | |
---|
74 | // error-handling specifiers |
---|
75 | OMPI_DECLSPEC extern const Errhandler ERRORS_ARE_FATAL; |
---|
76 | OMPI_DECLSPEC extern const Errhandler ERRORS_RETURN; |
---|
77 | OMPI_DECLSPEC extern const Errhandler ERRORS_THROW_EXCEPTIONS; |
---|
78 | |
---|
79 | // typeclass definitions for MPI_Type_match_size |
---|
80 | static const int TYPECLASS_INTEGER = MPI_TYPECLASS_INTEGER; |
---|
81 | static const int TYPECLASS_REAL = MPI_TYPECLASS_REAL; |
---|
82 | static const int TYPECLASS_COMPLEX = MPI_TYPECLASS_COMPLEX; |
---|
83 | |
---|
84 | // maximum sizes for strings |
---|
85 | static const int MAX_PROCESSOR_NAME = MPI_MAX_PROCESSOR_NAME; |
---|
86 | static const int MAX_ERROR_STRING = MPI_MAX_ERROR_STRING; |
---|
87 | static const int MAX_INFO_KEY = MPI_MAX_INFO_KEY; |
---|
88 | static const int MAX_INFO_VAL = MPI_MAX_INFO_VAL; |
---|
89 | static const int MAX_PORT_NAME = MPI_MAX_PORT_NAME; |
---|
90 | static const int MAX_OBJECT_NAME = MPI_MAX_OBJECT_NAME; |
---|
91 | |
---|
92 | // elementary datatypes (C / C++) |
---|
93 | OMPI_DECLSPEC extern const Datatype CHAR; |
---|
94 | OMPI_DECLSPEC extern const Datatype SHORT; |
---|
95 | OMPI_DECLSPEC extern const Datatype INT; |
---|
96 | OMPI_DECLSPEC extern const Datatype LONG; |
---|
97 | OMPI_DECLSPEC extern const Datatype SIGNED_CHAR; |
---|
98 | OMPI_DECLSPEC extern const Datatype UNSIGNED_CHAR; |
---|
99 | OMPI_DECLSPEC extern const Datatype UNSIGNED_SHORT; |
---|
100 | OMPI_DECLSPEC extern const Datatype UNSIGNED; |
---|
101 | OMPI_DECLSPEC extern const Datatype UNSIGNED_LONG; |
---|
102 | OMPI_DECLSPEC extern const Datatype FLOAT; |
---|
103 | OMPI_DECLSPEC extern const Datatype DOUBLE; |
---|
104 | OMPI_DECLSPEC extern const Datatype LONG_DOUBLE; |
---|
105 | OMPI_DECLSPEC extern const Datatype BYTE; |
---|
106 | OMPI_DECLSPEC extern const Datatype PACKED; |
---|
107 | OMPI_DECLSPEC extern const Datatype WCHAR; |
---|
108 | |
---|
109 | // datatypes for reductions functions (C / C++) |
---|
110 | OMPI_DECLSPEC extern const Datatype FLOAT_INT; |
---|
111 | OMPI_DECLSPEC extern const Datatype DOUBLE_INT; |
---|
112 | OMPI_DECLSPEC extern const Datatype LONG_INT; |
---|
113 | OMPI_DECLSPEC extern const Datatype TWOINT; |
---|
114 | OMPI_DECLSPEC extern const Datatype SHORT_INT; |
---|
115 | OMPI_DECLSPEC extern const Datatype LONG_DOUBLE_INT; |
---|
116 | |
---|
117 | // elementary datatype (Fortran) |
---|
118 | OMPI_DECLSPEC extern const Datatype INTEGER; |
---|
119 | OMPI_DECLSPEC extern const Datatype REAL; |
---|
120 | OMPI_DECLSPEC extern const Datatype DOUBLE_PRECISION; |
---|
121 | OMPI_DECLSPEC extern const Datatype F_COMPLEX; |
---|
122 | OMPI_DECLSPEC extern const Datatype LOGICAL; |
---|
123 | OMPI_DECLSPEC extern const Datatype CHARACTER; |
---|
124 | |
---|
125 | // datatype for reduction functions (Fortran) |
---|
126 | OMPI_DECLSPEC extern const Datatype TWOREAL; |
---|
127 | OMPI_DECLSPEC extern const Datatype TWODOUBLE_PRECISION; |
---|
128 | OMPI_DECLSPEC extern const Datatype TWOINTEGER; |
---|
129 | |
---|
130 | // optional datatypes (Fortran) |
---|
131 | OMPI_DECLSPEC extern const Datatype INTEGER1; |
---|
132 | OMPI_DECLSPEC extern const Datatype INTEGER2; |
---|
133 | OMPI_DECLSPEC extern const Datatype INTEGER4; |
---|
134 | OMPI_DECLSPEC extern const Datatype REAL2; |
---|
135 | OMPI_DECLSPEC extern const Datatype REAL4; |
---|
136 | OMPI_DECLSPEC extern const Datatype REAL8; |
---|
137 | |
---|
138 | // optional datatype (C / C++) |
---|
139 | OMPI_DECLSPEC extern const Datatype LONG_LONG; |
---|
140 | OMPI_DECLSPEC extern const Datatype UNSIGNED_LONG_LONG; |
---|
141 | |
---|
142 | // c++ types |
---|
143 | OMPI_DECLSPEC extern const Datatype BOOL; |
---|
144 | OMPI_DECLSPEC extern const Datatype COMPLEX; |
---|
145 | OMPI_DECLSPEC extern const Datatype DOUBLE_COMPLEX; |
---|
146 | OMPI_DECLSPEC extern const Datatype LONG_DOUBLE_COMPLEX; |
---|
147 | |
---|
148 | // special datatypes for contstruction of derived datatypes |
---|
149 | OMPI_DECLSPEC extern const Datatype UB; |
---|
150 | OMPI_DECLSPEC extern const Datatype LB; |
---|
151 | |
---|
152 | // datatype decoding constants |
---|
153 | static const int COMBINER_NAMED = MPI_COMBINER_NAMED; |
---|
154 | static const int COMBINER_DUP = MPI_COMBINER_DUP; |
---|
155 | static const int COMBINER_CONTIGUOUS = MPI_COMBINER_CONTIGUOUS; |
---|
156 | static const int COMBINER_VECTOR = MPI_COMBINER_VECTOR; |
---|
157 | static const int COMBINER_HVECTOR_INTEGER = MPI_COMBINER_HVECTOR_INTEGER; |
---|
158 | static const int COMBINER_HVECTOR = MPI_COMBINER_HVECTOR; |
---|
159 | static const int COMBINER_INDEXED = MPI_COMBINER_INDEXED; |
---|
160 | static const int COMBINER_HINDEXED_INTEGER = MPI_COMBINER_HINDEXED_INTEGER; |
---|
161 | static const int COMBINER_HINDEXED = MPI_COMBINER_HINDEXED; |
---|
162 | static const int COMBINER_INDEXED_BLOCK = MPI_COMBINER_INDEXED_BLOCK; |
---|
163 | static const int COMBINER_STRUCT_INTEGER = MPI_COMBINER_STRUCT_INTEGER; |
---|
164 | static const int COMBINER_STRUCT = MPI_COMBINER_STRUCT; |
---|
165 | static const int COMBINER_SUBARRAY = MPI_COMBINER_SUBARRAY; |
---|
166 | static const int COMBINER_DARRAY = MPI_COMBINER_DARRAY; |
---|
167 | static const int COMBINER_F90_REAL = MPI_COMBINER_F90_REAL; |
---|
168 | static const int COMBINER_F90_COMPLEX = MPI_COMBINER_F90_COMPLEX; |
---|
169 | static const int COMBINER_F90_INTEGER = MPI_COMBINER_F90_INTEGER; |
---|
170 | static const int COMBINER_RESIZED = MPI_COMBINER_RESIZED; |
---|
171 | |
---|
172 | // thread constants |
---|
173 | static const int THREAD_SINGLE = MPI_THREAD_SINGLE; |
---|
174 | static const int THREAD_FUNNELED = MPI_THREAD_FUNNELED; |
---|
175 | static const int THREAD_SERIALIZED = MPI_THREAD_SERIALIZED; |
---|
176 | static const int THREAD_MULTIPLE = MPI_THREAD_MULTIPLE; |
---|
177 | |
---|
178 | // reserved communicators |
---|
179 | // JGS these can not be const because Set_errhandler is not const |
---|
180 | OMPI_DECLSPEC extern Intracomm COMM_WORLD; |
---|
181 | OMPI_DECLSPEC extern Intracomm COMM_SELF; |
---|
182 | |
---|
183 | // results of communicator and group comparisons |
---|
184 | static const int IDENT = MPI_IDENT; |
---|
185 | static const int CONGRUENT = MPI_CONGRUENT; |
---|
186 | static const int SIMILAR = MPI_SIMILAR; |
---|
187 | static const int UNEQUAL = MPI_UNEQUAL; |
---|
188 | |
---|
189 | // environmental inquiry keys |
---|
190 | static const int TAG_UB = MPI_TAG_UB; |
---|
191 | static const int HOST = MPI_HOST; |
---|
192 | static const int IO = MPI_IO; |
---|
193 | static const int WTIME_IS_GLOBAL = MPI_WTIME_IS_GLOBAL; |
---|
194 | static const int APPNUM = MPI_APPNUM; |
---|
195 | static const int LASTUSEDCODE = MPI_LASTUSEDCODE; |
---|
196 | static const int UNIVERSE_SIZE = MPI_UNIVERSE_SIZE; |
---|
197 | static const int WIN_BASE = MPI_WIN_BASE; |
---|
198 | static const int WIN_SIZE = MPI_WIN_SIZE; |
---|
199 | static const int WIN_DISP_UNIT = MPI_WIN_DISP_UNIT; |
---|
200 | |
---|
201 | // collective operations |
---|
202 | OMPI_DECLSPEC extern const Op MAX; |
---|
203 | OMPI_DECLSPEC extern const Op MIN; |
---|
204 | OMPI_DECLSPEC extern const Op SUM; |
---|
205 | OMPI_DECLSPEC extern const Op PROD; |
---|
206 | OMPI_DECLSPEC extern const Op MAXLOC; |
---|
207 | OMPI_DECLSPEC extern const Op MINLOC; |
---|
208 | OMPI_DECLSPEC extern const Op BAND; |
---|
209 | OMPI_DECLSPEC extern const Op BOR; |
---|
210 | OMPI_DECLSPEC extern const Op BXOR; |
---|
211 | OMPI_DECLSPEC extern const Op LAND; |
---|
212 | OMPI_DECLSPEC extern const Op LOR; |
---|
213 | OMPI_DECLSPEC extern const Op LXOR; |
---|
214 | OMPI_DECLSPEC extern const Op REPLACE; |
---|
215 | |
---|
216 | // null handles |
---|
217 | OMPI_DECLSPEC extern const Group GROUP_NULL; |
---|
218 | OMPI_DECLSPEC extern const Win WIN_NULL; |
---|
219 | OMPI_DECLSPEC extern const Info INFO_NULL; |
---|
220 | OMPI_DECLSPEC extern Comm_Null COMM_NULL; |
---|
221 | OMPI_DECLSPEC extern const Datatype DATATYPE_NULL; |
---|
222 | OMPI_DECLSPEC extern Request REQUEST_NULL; |
---|
223 | OMPI_DECLSPEC extern const Op OP_NULL; |
---|
224 | OMPI_DECLSPEC extern const Errhandler ERRHANDLER_NULL; |
---|
225 | #if OMPI_PROVIDE_MPI_FILE_INTERFACE |
---|
226 | OMPI_DECLSPEC extern const File FILE_NULL; |
---|
227 | #endif |
---|
228 | |
---|
229 | // constants specifying empty or ignored input |
---|
230 | OMPI_DECLSPEC extern const char** ARGV_NULL; |
---|
231 | OMPI_DECLSPEC extern const char*** ARGVS_NULL; |
---|
232 | |
---|
233 | // empty group |
---|
234 | OMPI_DECLSPEC extern const Group GROUP_EMPTY; |
---|
235 | |
---|
236 | // topologies |
---|
237 | static const int GRAPH = MPI_GRAPH; |
---|
238 | static const int CART = MPI_CART; |
---|
239 | |
---|
240 | #if OMPI_PROVIDE_MPI_FILE_INTERFACE |
---|
241 | // MPI-2 IO |
---|
242 | static const int MODE_CREATE = MPI_MODE_CREATE; |
---|
243 | static const int MODE_RDONLY = MPI_MODE_RDONLY; |
---|
244 | static const int MODE_WRONLY = MPI_MODE_WRONLY; |
---|
245 | static const int MODE_RDWR = MPI_MODE_RDWR; |
---|
246 | static const int MODE_DELETE_ON_CLOSE = MPI_MODE_DELETE_ON_CLOSE; |
---|
247 | static const int MODE_UNIQUE_OPEN = MPI_MODE_UNIQUE_OPEN; |
---|
248 | static const int MODE_EXCL = MPI_MODE_EXCL; |
---|
249 | static const int MODE_APPEND = MPI_MODE_APPEND; |
---|
250 | static const int MODE_SEQUENTIAL = MPI_MODE_SEQUENTIAL; |
---|
251 | |
---|
252 | static const int DISPLACEMENT_CURRENT = MPI_DISPLACEMENT_CURRENT; |
---|
253 | |
---|
254 | #if !defined(OMPI_IGNORE_CXX_SEEK) && OMPI_WANT_MPI_CXX_SEEK |
---|
255 | static const int SEEK_SET = ::SEEK_SET; |
---|
256 | static const int SEEK_CUR = ::SEEK_CUR; |
---|
257 | static const int SEEK_END = ::SEEK_END; |
---|
258 | #endif |
---|
259 | |
---|
260 | static const int MAX_DATAREP_STRING = MPI_MAX_DATAREP_STRING; |
---|
261 | #endif |
---|
262 | |
---|
263 | // one-sided constants |
---|
264 | static const int MODE_NOCHECK = MPI_MODE_NOCHECK; |
---|
265 | static const int MODE_NOPRECEDE = MPI_MODE_NOPRECEDE; |
---|
266 | static const int MODE_NOPUT = MPI_MODE_NOPUT; |
---|
267 | static const int MODE_NOSTORE = MPI_MODE_NOSTORE; |
---|
268 | static const int MODE_NOSUCCEED = MPI_MODE_NOSUCCEED; |
---|
269 | |
---|
270 | static const int LOCK_EXCLUSIVE = MPI_LOCK_EXCLUSIVE; |
---|
271 | static const int LOCK_SHARED = MPI_LOCK_SHARED; |
---|