Skip to content

Commit 2ac3286

Browse files
committed
first iteration
1 parent a3ddbf8 commit 2ac3286

File tree

1 file changed

+397
-0
lines changed

1 file changed

+397
-0
lines changed

include/mpi.h

Lines changed: 397 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,398 @@
11

2+
3+
4+
typedef struct MPI_ABI_Op * MPI_Op;
5+
#define MPI_OP_NULL (MPI_Op)0x00000020
6+
#define MPI_OP_SUM (MPI_Op)0x00000021
7+
#define MPI_OP_MIN (MPI_Op)0x00000022
8+
#define MPI_OP_MAX (MPI_Op)0x00000023
9+
#define MPI_OP_PROD (MPI_Op)0x00000024
10+
#define MPI_OP_BAND (MPI_Op)0x00000028
11+
#define MPI_OP_BOR (MPI_Op)0x00000029
12+
#define MPI_OP_BXOR (MPI_Op)0x0000002a
13+
#define MPI_OP_LAND (MPI_Op)0x00000030
14+
#define MPI_OP_LOR (MPI_Op)0x00000031
15+
#define MPI_OP_LXOR (MPI_Op)0x00000032
16+
#define MPI_OP_MINLOC (MPI_Op)0x00000038
17+
#define MPI_OP_MAXLOC (MPI_Op)0x00000039
18+
#define MPI_OP_REPLACE (MPI_Op)0x0000003c
19+
#define MPI_NO_OP (MPI_Op)0x0000003d
20+
21+
typedef struct MPI_ABI_Comm * MPI_Comm;
22+
#define MPI_COMM_NULL (MPI_Comm)0x00000100
23+
#define MPI_COMM_WORLD (MPI_Comm)0x00000101
24+
#define MPI_COMM_SELF (MPI_Comm)0x00000102
25+
26+
typedef struct MPI_ABI_Group * MPI_Info;
27+
#define MPI_GROUP_NULL (MPI_Group)0x00000108
28+
#define MPI_GROUP_EMPTY (MPI_Group)0x00000109
29+
30+
typedef struct MPI_ABI_Win * MPI_Win;
31+
#define MPI_WIN_NULL (MPI_Win)0x00000110
32+
33+
typedef struct MPI_ABI_Info * MPI_Info;
34+
#define MPI_FILE_NULL (MPI_File)0x00000118
35+
36+
typedef struct MPI_ABI_Session * MPI_Session;
37+
#define MPI_SESSION_NULL (MPI_Session)0x00000120
38+
#define MPI_MESSAGE_NULL (MPI_Message)0x00000128
39+
#define MPI_MESSAGE_NO_PROC (MPI_Message)0x00000129
40+
41+
typedef struct MPI_ABI_Info * MPI_Info;
42+
#define MPI_INFO_NULL (MPI_Info)0x00000130
43+
#define MPI_INFO_ENV (MPI_Info)0x00000131
44+
45+
typedef struct MPI_ABI_Errhandler * MPI_Errhandler;
46+
#define MPI_ERRHANDLER_NULL (MPI_Errhandler)0x00000140
47+
#define MPI_ERRORS_ARE_FATAL (MPI_Errhandler)0x00000141
48+
#define MPI_ERRORS_RETURN (MPI_Errhandler)0x00000142
49+
#define MPI_ERRORS_ABORT (MPI_Errhandler)0x00000143
50+
51+
typedef struct MPI_ABI_Request * MPI_Request;
52+
#define MPI_REQUEST_NULL (MPI_Request)0x00000180
53+
54+
typedef struct MPI_ABI_Datatype * MPI_Datatype;
55+
#define MPI_DATATYPE_NULL (MPI_Datatype)0x00000200
56+
#define MPI_AINT (MPI_Datatype)0x00000201
57+
#define MPI_COUNT (MPI_Datatype)0x00000202
58+
#define MPI_OFFSET (MPI_Datatype)0x00000203
59+
#define MPI_PACKED (MPI_Datatype)0x00000207
60+
#define MPI_SHORT (MPI_Datatype)0x00000208
61+
#define MPI_INT (MPI_Datatype)0x00000209
62+
#define MPI_LONG (MPI_Datatype)0x0000020a
63+
#define MPI_LONG_LONG (MPI_Datatype)0x0000020b
64+
#define MPI_LONG_LONG_INT MPI_LONG_LONG
65+
#define MPI_UNSIGNED_SHORT (MPI_Datatype)0x0000020c
66+
#define MPI_UNSIGNED (MPI_Datatype)0x0000020d
67+
#define MPI_UNSIGNED_LONG (MPI_Datatype)0x0000020e
68+
#define MPI_UNSIGNED_LONG_LONG (MPI_Datatype)0x0000020f
69+
#define MPI_FLOAT (MPI_Datatype)0x00000210
70+
#define MPI_C_FLOAT_COMPLEX (MPI_Datatype)0x00000212
71+
#define MPI_C_COMPLEX MPI_C_FLOAT_COMPLEX
72+
#define MPI_CXX_FLOAT_COMPLEX (MPI_Datatype)0x00000213
73+
#define MPI_DOUBLE (MPI_Datatype)0x00000214
74+
#define MPI_C_DOUBLE_COMPLEX (MPI_Datatype)0x00000216
75+
#define MPI_CXX_DOUBLE_COMPLEX (MPI_Datatype)0x00000217
76+
#define MPI_INTEGER (MPI_Datatype)0x00000218
77+
#define MPI_LOGICAL (MPI_Datatype)0x00000219
78+
#define MPI_REAL (MPI_Datatype)0x0000021a
79+
#define MPI_COMPLEX (MPI_Datatype)0x0000021b
80+
#define MPI_DOUBLE_PRECISION (MPI_Datatype)0x0000021c
81+
#define MPI_DOUBLE_COMPLEX (MPI_Datatype)0x0000021d
82+
#define MPI_LONG_DOUBLE (MPI_Datatype)0x00000220
83+
#define MPI_C_LONG_DOUBLE_COMPLEX (MPI_Datatype)0x00000224
84+
#define MPI_CXX_LONG_DOUBLE_COMPLEX (MPI_Datatype)0x00000225
85+
#define MPI_FLOAT_INT (MPI_Datatype)0x00000228
86+
#define MPI_DOUBLE_INT (MPI_Datatype)0x00000229
87+
#define MPI_LONG_INT (MPI_Datatype)0x0000022a
88+
#define MPI_2INT (MPI_Datatype)0x0000022b
89+
#define MPI_SHORT_INT (MPI_Datatype)0x0000022c
90+
#define MPI_LONG_DOUBLE_INT (MPI_Datatype)0x0000022d
91+
#define MPI_2REAL (MPI_Datatype)0x00000230
92+
#define MPI_2DOUBLE_PRECISION (MPI_Datatype)0x00000231
93+
#define MPI_2INTEGER (MPI_Datatype)0x00000232
94+
#define MPI_C_BOOL (MPI_Datatype)0x00000238
95+
#define MPI_CXX_BOOL (MPI_Datatype)0x00000239
96+
#define MPI_WCHAR (MPI_Datatype)0x0000023c
97+
#define MPI_INT8_T (MPI_Datatype)0x00000240
98+
#define MPI_UINT8_T (MPI_Datatype)0x00000241
99+
#define MPI_CHAR (MPI_Datatype)0x00000243
100+
#define MPI_SIGNED_CHAR (MPI_Datatype)0x00000244
101+
#define MPI_UNSIGNED_CHAR (MPI_Datatype)0x00000245
102+
#define MPI_BYTE (MPI_Datatype)0x00000247
103+
#define MPI_INT16_T (MPI_Datatype)0x00000248
104+
#define MPI_UINT16_T (MPI_Datatype)0x00000249
105+
#define MPI_INT32_T (MPI_Datatype)0x00000250
106+
#define MPI_UINT32_T (MPI_Datatype)0x00000251
107+
#define MPI_INT64_T (MPI_Datatype)0x00000258
108+
#define MPI_UINT64_T (MPI_Datatype)0x00000259
109+
#define MPI_INTEGER1 (MPI_Datatype)0x000002c0
110+
#define MPIX_LOGICAL1 (MPI_Datatype)0x000002c1
111+
#define MPIX_REAL1 (MPI_Datatype)0x000002c2
112+
#define MPI_CHARACTER (MPI_Datatype)0x000002c3
113+
#define MPI_INTEGER2 (MPI_Datatype)0x000002c8
114+
#define MPIX_LOGICAL2 (MPI_Datatype)0x000002c9
115+
#define MPI_REAL2 (MPI_Datatype)0x000002ca
116+
#define MPI_INTEGER4 (MPI_Datatype)0x000002d0
117+
#define MPIX_LOGICAL4 (MPI_Datatype)0x000002d1
118+
#define MPI_REAL4 (MPI_Datatype)0x000002d2
119+
#define MPI_COMPLEX4 (MPI_Datatype)0x000002d3
120+
#define MPI_INTEGER8 (MPI_Datatype)0x000002d8
121+
#define MPIX_LOGICAL8 (MPI_Datatype)0x000002d9
122+
#define MPI_REAL8 (MPI_Datatype)0x000002da
123+
#define MPI_COMPLEX8 (MPI_Datatype)0x000002db
124+
#define MPI_INTEGER16 (MPI_Datatype)0x000002e0
125+
#define MPI_REAL16 (MPI_Datatype)0x000002e2
126+
#define MPI_COMPLEX16 (MPI_Datatype)0x000002e3
127+
#define MPI_COMPLEX32 (MPI_Datatype)0x000002eb
128+
129+
enum {
130+
// Status indexing - must match MPI_Status definition
131+
MPI_F_SOURCE = 0,
132+
MPI_F_TAG = 1,
133+
MPI_F_ERROR = 2,
134+
// Fortran status array size and reserved index values (in C)
135+
MPI_F_STATUS_SIZE = 8
136+
};
137+
138+
// Error classes
139+
enum {
140+
MPI_SUCCESS = 0,
141+
MPI_ERR_BUFFER = 1,
142+
MPI_ERR_COUNT = 2,
143+
MPI_ERR_TYPE = 3,
144+
MPI_ERR_TAG = 4,
145+
MPI_ERR_COMM = 5,
146+
MPI_ERR_RANK = 6,
147+
MPI_ERR_REQUEST = 7,
148+
MPI_ERR_ROOT = 8,
149+
MPI_ERR_GROUP = 9,
150+
MPI_ERR_OP = 10,
151+
MPI_ERR_TOPOLOGY = 11,
152+
MPI_ERR_DIMS = 12,
153+
MPI_ERR_ARG = 13,
154+
MPI_ERR_UNKNOWN = 14,
155+
MPI_ERR_TRUNCATE = 15,
156+
MPI_ERR_OTHER = 16,
157+
MPI_ERR_INTERN = 17,
158+
MPI_ERR_PENDING = 18,
159+
MPI_ERR_IN_STATUS = 19,
160+
MPI_ERR_ACCESS = 20,
161+
MPI_ERR_AMODE = 21,
162+
MPI_ERR_ASSERT = 22,
163+
MPI_ERR_BAD_FILE = 23,
164+
MPI_ERR_BASE = 24,
165+
MPI_ERR_CONVERSION = 25,
166+
MPI_ERR_DISP = 26,
167+
MPI_ERR_DUP_DATAREP = 27,
168+
MPI_ERR_FILE_EXISTS = 28,
169+
MPI_ERR_FILE_IN_USE = 29,
170+
MPI_ERR_FILE = 30,
171+
MPI_ERR_INFO_KEY = 31,
172+
MPI_ERR_INFO_NOKEY = 32,
173+
MPI_ERR_INFO_VALUE = 33,
174+
MPI_ERR_INFO = 34,
175+
MPI_ERR_IO = 35,
176+
MPI_ERR_KEYVAL = 36,
177+
MPI_ERR_LOCKTYPE = 37,
178+
MPI_ERR_NAME = 38,
179+
MPI_ERR_NO_MEM = 39,
180+
MPI_ERR_NOT_SAME = 40,
181+
MPI_ERR_NO_SPACE = 41,
182+
MPI_ERR_NO_SUCH_FILE = 42,
183+
MPI_ERR_PORT = 43,
184+
MPI_ERR_PROC_ABORTED = 44,
185+
MPI_ERR_QUOTA = 45,
186+
MPI_ERR_READ_ONLY = 46,
187+
MPI_ERR_RMA_ATTACH = 47,
188+
MPI_ERR_RMA_CONFLICT = 48,
189+
MPI_ERR_RMA_RANGE = 49,
190+
MPI_ERR_RMA_SHARED = 50,
191+
MPI_ERR_RMA_SYNC = 51,
192+
MPI_ERR_RMA_FLAVOR = 52,
193+
MPI_ERR_SERVICE = 53,
194+
MPI_ERR_SESSION = 54,
195+
MPI_ERR_SIZE = 55,
196+
MPI_ERR_SPAWN = 56,
197+
MPI_ERR_UNSUPPORTED_DATAREP = 57,
198+
MPI_ERR_UNSUPPORTED_OPERATION = 58,
199+
MPI_ERR_VALUE_TOO_LARGE = 59,
200+
MPI_ERR_WIN = 60,
201+
MPI_ERR_ERRHANDLER = 61,
202+
MPI_T_ERR_CANNOT_INIT = 1000,
203+
MPI_T_ERR_NOT_ACCESSIBLE = 1001,
204+
MPI_T_ERR_NOT_INITIALIZED = 1002,
205+
MPI_T_ERR_NOT_SUPPORTED = 1003,
206+
MPI_T_ERR_MEMORY = 1004,
207+
MPI_T_ERR_INVALID = 1005,
208+
MPI_T_ERR_INVALID_INDEX = 1006,
209+
MPI_T_ERR_INVALID_ITEM = 1007,
210+
MPI_T_ERR_INVALID_SESSION = 1008,
211+
MPI_T_ERR_INVALID_HANDLE = 1009,
212+
MPI_T_ERR_INVALID_NAME = 1010,
213+
MPI_T_ERR_OUT_OF_HANDLES = 1011,
214+
MPI_T_ERR_OUT_OF_SESSIONS = 1012,
215+
MPI_T_ERR_CVAR_SET_NOT_NOW = 1013,
216+
MPI_T_ERR_CVAR_SET_NEVER = 1014,
217+
MPI_T_ERR_PVAR_NO_WRITE = 1015,
218+
MPI_T_ERR_PVAR_NO_STARTSTOP = 1016,
219+
MPI_T_ERR_PVAR_NO_ATOMIC = 1017,
220+
MPI_ERR_LASTCODE = 0x3fff // half of the minimum required value of INT_MAX
221+
};
222+
223+
// Buffer Address Constants
224+
#define MPI_BOTTOM ((void*)0)
225+
#define MPI_IN_PLACE ((void*)1)
226+
227+
// Constants Specifying Empty or Ignored Input
228+
#define MPI_ARGV_NULL ((char**)0)
229+
#define MPI_ARGVS_NULL ((char***)0)
230+
#define MPI_ERRCODES_IGNORE ((int*)0)
231+
#define MPI_STATUS_IGNORE ((MPI_Status*)0)
232+
#define MPI_STATUSES_IGNORE ((MPI_Status**)0)
233+
#define MPI_UNWEIGHTED ((int*)2)
234+
#define MPI_WEIGHTS_EMPTY ((int*)3)
235+
236+
// Other constants
237+
#define MPI_BSEND_OVERHEAD 512 // MPICH=96, OMPI=128
238+
239+
// String size constants
240+
#define MPI_MAX_DATAREP_STRING 128 // MPICH=OMPI=128 (MPICH has it in `mpio.h`)
241+
#define MPI_MAX_ERROR_STRING 512 // MPICH was bigger
242+
#define MPI_MAX_INFO_KEY 256 // MPICH was bigger
243+
#define MPI_MAX_INFO_VAL 1024 // MPICH was bigger
244+
#define MPI_MAX_LIBRARY_VERSION_STRING 8192 // MPICH was bigger
245+
#define MPI_MAX_OBJECT_NAME 128 // MPICH was bigger
246+
#define MPI_MAX_PORT_NAME 1024 // OMPI was bigger
247+
#define MPI_MAX_PROCESSOR_NAME 256 // OMPI was bigger
248+
#define MPI_MAX_STRINGTAG_LEN 1024 // OMPI was bigger (v5.0+)
249+
#define MPI_MAX_PSET_NAME_LEN 512 // OMPI was bigger (v5.0+)
250+
251+
// Mode Constants
252+
// must be powers-of-2 to support OR-ing
253+
enum {
254+
// Files
255+
MPI_MODE_APPEND = 1,
256+
MPI_MODE_CREATE = 2,
257+
MPI_MODE_DELETE_ON_CLOSE = 4,
258+
MPI_MODE_EXCL = 8,
259+
MPI_MODE_RDONLY = 16,
260+
MPI_MODE_RDWR = 32,
261+
MPI_MODE_SEQUENTIAL = 64,
262+
MPI_MODE_UNIQUE_OPEN = 128,
263+
MPI_MODE_WRONLY = 256,
264+
// Windows
265+
MPI_MODE_NOCHECK = 1024,
266+
MPI_MODE_NOPRECEDE = 2048,
267+
MPI_MODE_NOPUT = 4096,
268+
MPI_MODE_NOSTORE = 8192,
269+
MPI_MODE_NOSUCCEED = 16384
270+
};
271+
272+
enum {
273+
// rank sentinels - must be negative
274+
MPI_ANY_SOURCE = -1,
275+
MPI_PROC_NULL = -2,
276+
MPI_ROOT = -3,
277+
278+
// tag sentinels - should be negative
279+
MPI_ANY_TAG = -31,
280+
281+
// attribute constant - should be negative
282+
MPI_KEYVAL_INVALID = -127,
283+
284+
// special displacement for sequential access file - should be negative
285+
MPI_DISPLACEMENT_CURRENT = -255,
286+
287+
// multi-purpose sentinel - must be negative
288+
MPI_UNDEFINED = -32766 // make it match OMPI and MPICH
289+
}
290+
291+
enum {
292+
// Environmental inquiry keys and Predefined Attribute Keys
293+
// Threads Constants
294+
// These values are monotonic; i.e., SINGLE < FUNNELED < SERIALIZED < MULTIPLE.
295+
MPI_THREAD_SINGLE = 0,
296+
MPI_THREAD_FUNNELED = 1,
297+
MPI_THREAD_SERIALIZED = 2,
298+
MPI_THREAD_MULTIPLE = 7, // in case we need other threading levels below MULTIPLE
299+
300+
// array order
301+
MPI_ORDER_C = 0xC, // 12
302+
MPI_ORDER_FORTRAN = 0xF, // 15
303+
304+
// RMA lock constants - arbitrary values
305+
MPI_LOCK_SHARED = 21,
306+
MPI_LOCK_EXCLUSIVE = 22,
307+
308+
// MPI Window Models
309+
MPI_WIN_UNIFIED = 31,
310+
MPI_WIN_SEPARATE = 32,
311+
312+
// MPI Window Create Flavors
313+
MPI_WIN_FLAVOR_ALLOCATE = 41,
314+
MPI_WIN_FLAVOR_CREATE = 42,
315+
MPI_WIN_FLAVOR_DYNAMIC = 43,
316+
MPI_WIN_FLAVOR_SHARED = 44,
317+
318+
//Results of communicator and group comparisons
319+
MPI_IDENT = 101,
320+
MPI_CONGRUENT = 102,
321+
MPI_SIMILAR = 103,
322+
MPI_UNEQUAL = 104,
323+
324+
// MPI_Topo_test
325+
MPI_GRAPH = 201,
326+
MPI_DIST_GRAPH = 202,
327+
MPI_CART = 203,
328+
329+
// Datatype Decoding Constants
330+
MPI_COMBINER_NAMED = 301,
331+
MPI_COMBINER_DUP = 302,
332+
MPI_COMBINER_CONTIGUOUS = 303,
333+
MPI_COMBINER_VECTOR = 304,
334+
MPI_COMBINER_HVECTOR = 305,
335+
MPI_COMBINER_INDEXED = 306,
336+
MPI_COMBINER_HINDEXED = 307,
337+
MPI_COMBINER_INDEXED_BLOCK = 308,
338+
MPI_COMBINER_HINDEXED_BLOCK = 309,
339+
MPI_COMBINER_STRUCT = 310,
340+
MPI_COMBINER_SUBARRAY = 311,
341+
MPI_COMBINER_DARRAY = 312,
342+
MPI_COMBINER_F90_REAL = 313,
343+
MPI_COMBINER_F90_COMPLEX = 314,
344+
MPI_COMBINER_F90_INTEGER = 315,
345+
MPI_COMBINER_RESIZED = 316,
346+
347+
// File Operation Constants (?)
348+
MPI_DISTRIBUTE_NONE = 404,
349+
MPI_DISTRIBUTE_BLOCK = 401,
350+
MPI_DISTRIBUTE_CYCLIC = 402,
351+
MPI_DISTRIBUTE_DFLT_DARG = 403,
352+
353+
MPI_SEEK_CUR = 601,
354+
MPI_SEEK_END = 602,
355+
MPI_SEEK_SET = 603,
356+
357+
// F90 Datatype Matching Constants
358+
MPI_TYPECLASS_REAL = 801,
359+
MPI_TYPECLASS_COMPLEX = 802,
360+
MPI_TYPECLASS_INTEGER = 803,
361+
362+
// Communicator split type constants - arbitrary values
363+
MPI_COMM_TYPE_SHARED = 1001,
364+
MPI_COMM_TYPE_HW_UNGUIDED = 1002,
365+
MPI_COMM_TYPE_HW_GUIDED = 1003,
366+
367+
// These apply to MPI_COMM_WORLD
368+
MPI_TAG_UB = 10001,
369+
MPI_IO = 10002,
370+
MPI_HOST = 10003,
371+
MPI_WTIME_IS_GLOBAL = 10004,
372+
MPI_APPNUM = 10005,
373+
MPI_LASTUSEDCODE = 10006,
374+
MPI_UNIVERSE_SIZE = 10007,
375+
376+
// Predefined Attribute Keys
377+
// These apply to Windows
378+
MPI_WIN_BASE = 20001,
379+
MPI_WIN_DISP_UNIT = 20002,
380+
MPI_WIN_SIZE = 20003,
381+
MPI_WIN_CREATE_FLAVOR = 20004,
382+
MPI_WIN_MODEL = 20005
383+
}
384+
385+
#define MPI_NULL_COPY_FN ((MPI_Copy_function*)0x0)
386+
#define MPI_DUP_FN ((MPI_Copy_function*)0x1)
387+
#define MPI_NULL_DELETE_FN ((MPI_Delete_function*)0x0)
388+
#define MPI_COMM_NULL_COPY_FN ((MPI_Comm_copy_attr_function*)0x0)
389+
#define MPI_COMM_DUP_FN ((MPI_Comm_copy_attr_function*)0x1)
390+
#define MPI_COMM_NULL_DELETE_FN ((MPI_Comm_delete_attr_function*)0x0)
391+
#define MPI_TYPE_NULL_COPY_FN ((MPI_Type_copy_attr_function*)0x0)
392+
#define MPI_TYPE_DUP_FN ((MPI_Type_copy_attr_function*)0x1)
393+
#define MPI_TYPE_NULL_DELETE_FN ((MPI_Type_delete_attr_function*)0x0)
394+
#define MPI_WIN_NULL_COPY_FN ((MPI_Win_copy_attr_function*)0x0)
395+
#define MPI_WIN_DUP_FN ((MPI_Win_copy_attr_function*)0x1)
396+
#define MPI_WIN_NULL_DELETE_FN ((MPI_Win_delete_attr_function*)0x0)
397+
#define MPI_CONVERSION_FN_NULL ((MPI_Datarep_conversion_function)0x0)
398+
#define MPI_CONVERSION_FN_NULL_C ((MPI_Datarep_conversion_function_c)0x0)

0 commit comments

Comments
 (0)