AMPI: change MPI_BOTTOM's definition to avoid confusing it with NULL
[charm.git] / src / libs / ck-libs / ampi / ampi.h
blobdea66823c8ebbd8ab9ce622cec27b9b8138ea966
1 #ifndef _MPI_H
2 #define _MPI_H
4 #include <stdlib.h> /* for redefinition of exit() below */
5 #include <inttypes.h> /* for intptr_t */
6 #include "conv-config.h"
7 #include "charm-api.h" /* for CLINKAGE */
9 /* NON-standard define: this lets people #ifdef on
10 AMPI, e.g. for our bizarre AMPI_Main. */
11 #define AMPI
13 /* Allow applications to terminate cleanly with exit() */
14 CLINKAGE void AMPI_Exit(int exitCode);
15 #define exit(status) AMPI_Exit(status)
18 Silently rename the user's main routine.
19 This is needed so we can call the routine as a new thread,
20 instead of as an actual "main".
22 #ifdef __cplusplus /* C++ version-- rename "main" as "AMPI_Main_cpp" */
23 # define main AMPI_Main_cpp
24 int AMPI_Main_cpp(int argc,char **argv); /* prototype for C++ main routine */
25 int AMPI_Main_cpp(void); /* prototype for C++ main routines without args, as in autoconf tests */
27 extern "C" {
28 #else /* C version-- rename "main" as "AMPI_Main" */
29 # define main AMPI_Main
30 #endif
32 int AMPI_Main(); /* declaration for C main routine (not a strict prototype!) */
33 void AMPI_Main_c(int argc,char **argv); /* C wrapper for calling AMPI_Main() from C++ */
35 typedef void (*MPI_MainFn) (int,char**);
37 typedef int MPI_Datatype;
38 typedef intptr_t MPI_Aint;
39 typedef int MPI_Fint;
40 typedef MPI_Aint MPI_Count;
42 /********************** MPI-1.1 prototypes and defines ***************************/
43 /* MPI-1 Errors */
44 #define MPI_SUCCESS 0
45 #define MPI_ERR_BUFFER 1
46 #define MPI_ERR_COUNT 2
47 #define MPI_ERR_TYPE 3
48 #define MPI_ERR_TAG 4
49 #define MPI_ERR_COMM 5
50 #define MPI_ERR_RANK 6
51 #define MPI_ERR_REQUEST 7
52 #define MPI_ERR_ROOT 8
53 #define MPI_ERR_GROUP 9
54 #define MPI_ERR_OP 10
55 #define MPI_ERR_TOPOLOGY 11
56 #define MPI_ERR_DIMS 12
57 #define MPI_ERR_ARG 13
58 #define MPI_ERR_UNKNOWN 14
59 #define MPI_ERR_TRUNCATE 15
60 #define MPI_ERR_OTHER 16
61 #define MPI_ERR_INTERN 17
62 #define MPI_ERR_IN_STATUS 18
63 #define MPI_ERR_PENDING 19
64 /* MPI-2 Errors */
65 #define MPI_ERR_ACCESS 20
66 #define MPI_ERR_AMODE 21
67 #define MPI_ERR_ASSERT 22
68 #define MPI_ERR_BAD_FILE 23
69 #define MPI_ERR_BASE 24
70 #define MPI_ERR_CONVERSION 25
71 #define MPI_ERR_DISP 26
72 #define MPI_ERR_DUP_DATAREP 27
73 #define MPI_ERR_FILE_EXISTS 28
74 #define MPI_ERR_FILE_IN_USE 29
75 #define MPI_ERR_FILE 30
76 #define MPI_ERR_INFO_KEY 31
77 #define MPI_ERR_INFO_NOKEY 32
78 #define MPI_ERR_INFO_VALUE 33
79 #define MPI_ERR_INFO 34
80 #define MPI_ERR_IO 35
81 #define MPI_ERR_KEYVAL 36
82 #define MPI_ERR_LOCKTYPE 37
83 #define MPI_ERR_NAME 38
84 #define MPI_ERR_NO_MEM 39
85 #define MPI_ERR_NOT_SAME 40
86 #define MPI_ERR_NO_SPACE 41
87 #define MPI_ERR_NO_SUCH_FILE 42
88 #define MPI_ERR_PORT 43
89 #define MPI_ERR_QUOTA 44
90 #define MPI_ERR_READ_ONLY 45
91 #define MPI_ERR_RMA_CONFLICT 46
92 #define MPI_ERR_RMA_SYNC 47
93 #define MPI_ERR_SERVICE 48
94 #define MPI_ERR_SIZE 49
95 #define MPI_ERR_SPAWN 50
96 #define MPI_ERR_UNSUPPORTED_DATAREP 51
97 #define MPI_ERR_UNSUPPORTED_OPERATION 52
98 #define MPI_ERR_WIN 53
99 #define MPI_ERR_LASTCODE 53
100 #define MPI_LASTUSEDCODE 53
101 /* 0=MPI_SUCCESS<MPI_ERRs(...)<MPI_ERR<=MPI_ERR_LASTCODE<=MPI_LASTUSEDCODE */
103 #define MPI_MAX_PROCESSOR_NAME 256
104 #define MPI_MAX_ERROR_STRING 256
105 #define MPI_MAX_LIBRARY_VERSION_STRING 256
107 #define MPI_VERSION 2
108 #define MPI_SUBVERSION 2
110 #define MPI_THREAD_SINGLE 1
111 #define MPI_THREAD_FUNNELED 2
112 #define MPI_THREAD_SERIALIZED 3
113 #define MPI_THREAD_MULTIPLE 4
115 /* these values have to match values in ampif.h */
116 /* base types */
117 #define MPI_DATATYPE_NULL -1
118 #define MPI_DOUBLE 0
119 #define MPI_INT 1
120 #define MPI_INTEGER MPI_INT
121 #define MPI_FLOAT 2
122 #define MPI_COMPLEX 3
123 #define MPI_LOGICAL 4
124 #define MPI_C_BOOL 5
125 #define MPI_CHAR 6
126 #define MPI_BYTE 7
127 #define MPI_PACKED 8
128 #define MPI_SHORT 9
129 #define MPI_LONG 10
130 #define MPI_UNSIGNED_CHAR 11
131 #define MPI_UNSIGNED_SHORT 12
132 #define MPI_UNSIGNED 13
133 #define MPI_UNSIGNED_LONG 14
134 #define MPI_LONG_DOUBLE 15
135 /* tuple types */
136 #define MPI_FLOAT_INT 16
137 #define MPI_DOUBLE_INT 17
138 #define MPI_LONG_INT 18
139 #define MPI_2INT 19
140 #define MPI_SHORT_INT 20
141 #define MPI_LONG_DOUBLE_INT 21
142 #define MPI_2FLOAT 22
143 #define MPI_2DOUBLE 23
144 /* special types */
145 #define MPI_LB 24
146 #define MPI_UB 25
147 /* mpi-2+ types */
148 #define MPI_LONG_LONG_INT 26
149 #define MPI_LONG_LONG MPI_LONG_LONG_INT
150 #define MPI_OFFSET MPI_LONG_LONG
151 #define MPI_DOUBLE_COMPLEX 27
152 #define MPI_SIGNED_CHAR 28
153 #define MPI_UNSIGNED_LONG_LONG 29
154 #define MPI_WCHAR 30
155 #define MPI_INT8_T 31
156 #define MPI_INT16_T 32
157 #define MPI_INT32_T 33
158 #define MPI_INT64_T 34
159 #define MPI_UINT8_T 35
160 #define MPI_UINT16_T 36
161 #define MPI_UINT32_T 37
162 #define MPI_UINT64_T 38
163 #define MPI_FLOAT_COMPLEX 39
164 #define MPI_LONG_DOUBLE_COMPLEX 40
165 #define MPI_AINT 41
167 #define MPI_MAX_PRIMITIVE_TYPE 41
169 #define MPI_ANY_TAG MPI_TAG_UB_VALUE+1
170 #define MPI_REQUEST_NULL (-1)
171 #define MPI_GROUP_NULL (-1)
172 #define MPI_GROUP_EMPTY 0
173 #define MPI_COMM_NULL (-1)
174 #define MPI_TYPE_NULL (-1)
175 #define MPI_PROC_NULL (-2)
176 #define MPI_ROOT (-3)
177 #define MPI_ANY_SOURCE (-1)
178 #define MPI_KEYVAL_INVALID (-1)
179 #define MPI_INFO_NULL (-1)
181 #define MPI_IN_PLACE ((void *) -1L)
183 #define MPI_BOTTOM ((void *) -2L)
184 #define MPI_UNDEFINED (-32766)
186 #define MPI_IDENT 0
187 #define MPI_SIMILAR 1
188 #define MPI_CONGRUENT 2
189 #define MPI_UNEQUAL 3
191 #define MPI_COMM_TYPE_SHARED 1
192 #define AMPI_COMM_TYPE_HOST 2
193 #define AMPI_COMM_TYPE_PROCESS 3
194 #define AMPI_COMM_TYPE_WTH 4
196 typedef int MPI_Op;
198 typedef void (MPI_User_function)(void *invec, void *inoutvec,
199 int *len, MPI_Datatype *datatype);
201 #define MPI_OP_NULL -1
202 #define MPI_MAX 0
203 #define MPI_MIN 1
204 #define MPI_SUM 2
205 #define MPI_PROD 3
206 #define MPI_LAND 4
207 #define MPI_BAND 5
208 #define MPI_LOR 6
209 #define MPI_BOR 7
210 #define MPI_LXOR 8
211 #define MPI_BXOR 9
212 #define MPI_MAXLOC 10
213 #define MPI_MINLOC 11
214 #define MPI_REPLACE 12
215 #define MPI_NO_OP 13
217 #define MPI_GRAPH 1
218 #define MPI_CART 2
220 /* This is one less than the system-tags defined in ampiimpl.h.
221 * This is so that the tags used by the system don't clash with user-tags.
222 * The MPI 3.1 standard requires this to be at least 32767 (2^15 -1).
224 #define MPI_TAG_UB_VALUE 1073741824
226 /* These are the builtin MPI keyvals, plus some AMPI specific ones. */
227 #define MPI_TAG_UB -1
228 #define MPI_HOST -2
229 #define MPI_IO -3
230 #define MPI_WTIME_IS_GLOBAL -4
231 #define MPI_APPNUM -5
232 #define MPI_UNIVERSE_SIZE -6
233 #define MPI_WIN_BASE -7
234 #define MPI_WIN_SIZE -8
235 #define MPI_WIN_DISP_UNIT -9
236 #define MPI_WIN_MODEL -10
237 #define MPI_WIN_CREATE_FLAVOR -11
238 #define AMPI_MY_WTH -12
239 #define AMPI_NUM_WTHS -13
240 #define AMPI_MY_PROCESS -14
241 #define AMPI_NUM_PROCESSES -15
243 /** Communicators give a communication context to a set of processors.
244 An intercommunicator can be used for point to point messaging between two groups.
245 An intracommunicator can be used to send messages within a single group. */
246 typedef int MPI_Comm;
248 /** Groups represent an set of processors 0...n-1. They can be created locally */
249 typedef int MPI_Group;
251 typedef int MPI_Info;
253 #define MPI_COMM_SELF (MPI_Comm)(1000000) /*MPI_COMM_SELF is the first split comm */
254 #define MPI_COMM_FIRST_SPLIT (MPI_Comm)(1000000) /*Communicator from MPI_Comm_split */
255 #define MPI_COMM_FIRST_GROUP (MPI_Comm)(2000000) /*Communicator from MPI_Comm_group */
256 #define MPI_COMM_FIRST_CART (MPI_Comm)(3000000) /*Communicator from MPI_Cart_create */
257 #define MPI_COMM_FIRST_GRAPH (MPI_Comm)(4000000) /*Communicator from MPI_Graph_create */
258 #define MPI_COMM_FIRST_INTER (MPI_Comm)(5000000) /*Communicator from MPI_Intercomm_create*/
259 #define MPI_COMM_FIRST_INTRA (MPI_Comm)(6000000) /*Communicator from MPI_Intercomm_merge*/
260 #define MPI_COMM_FIRST_RESVD (MPI_Comm)(7000000) /*Communicator reserved for now*/
261 #define MPI_COMM_WORLD (MPI_Comm)(9000000) /*Start of universe*/
262 #define MPI_MAX_COMM_WORLDS 8
263 extern MPI_Comm MPI_COMM_UNIVERSE[MPI_MAX_COMM_WORLDS];
265 /* the size of MPI_Status must conform to MPI_STATUS_SIZE in ampif.h */
266 struct AmpiMsg;
267 typedef int MPI_Request;
268 typedef struct {
269 int MPI_TAG, MPI_SOURCE, MPI_COMM, MPI_LENGTH, MPI_ERROR, MPI_CANCEL; /* FIXME: MPI_ERROR is never used */
270 struct AmpiMsg *msg;
271 } MPI_Status;
273 #define MPI_STATUS_IGNORE (MPI_Status *)0
274 #define MPI_STATUSES_IGNORE (MPI_Status *)0
276 typedef int MPI_Errhandler;
277 #define MPI_ERRHANDLER_NULL 0
278 #define MPI_ERRORS_RETURN 1
279 #define MPI_ERRORS_ARE_FATAL 2
281 typedef void (MPI_Comm_errhandler_fn)(MPI_Comm *, int *, ...);
282 typedef void (MPI_Comm_errhandler_function)(MPI_Comm *, int *, ...);
283 typedef int (MPI_Comm_copy_attr_function)(MPI_Comm oldcomm, int keyval,
284 void *extra_state, void *attribute_val_in,
285 void *attribute_val_out, int *flag);
286 typedef int (MPI_Comm_delete_attr_function)(MPI_Comm comm, int keyval,
287 void *attribute_val, void *extra_state);
289 typedef void (MPI_Handler_function)(MPI_Comm *, int *, ...);
290 typedef int (MPI_Copy_function)(MPI_Comm oldcomm, int keyval,
291 void *extra_state, void *attribute_val_in,
292 void *attribute_val_out, int *flag);
293 typedef int (MPI_Delete_function)(MPI_Comm comm, int keyval,
294 void *attribute_val, void *extra_state);
296 #define MPI_COMM_NULL_COPY_FN MPI_comm_null_copy_fn
297 #define MPI_COMM_NULL_DELETE_FN MPI_comm_null_delete_fn
298 #define MPI_COMM_DUP_FN MPI_comm_dup_fn
300 #define MPI_NULL_COPY_FN MPI_comm_null_copy_fn
301 #define MPI_NULL_DELETE_FN MPI_comm_null_delete_fn
302 #define MPI_DUP_FN MPI_comm_dup_fn
304 int MPI_COMM_NULL_COPY_FN ( MPI_Comm, int, void *, void *, void *, int * );
305 int MPI_COMM_NULL_DELETE_FN ( MPI_Comm, int, void *, void * );
306 int MPI_COMM_DUP_FN ( MPI_Comm, int, void *, void *, void *, int * );
308 typedef int MPI_Type_copy_attr_function(MPI_Datatype oldtype, int type_keyval, void *extra_state,
309 void *attribute_val_in, void *attribute_val_out, int *flag);
310 typedef int MPI_Type_delete_attr_function(MPI_Datatype datatype, int type_keyval,
311 void *attribute_val, void *extra_state);
313 #define MPI_TYPE_NULL_DELETE_FN MPI_type_null_delete_fn
314 #define MPI_TYPE_NULL_COPY_FN MPI_type_null_copy_fn
315 #define MPI_TYPE_DUP_FN MPI_type_dup_fn
317 int MPI_TYPE_NULL_COPY_FN ( MPI_Datatype, int, void *, void *, void *, int * );
318 int MPI_TYPE_NULL_DELETE_FN ( MPI_Datatype, int, void *, void * );
319 int MPI_TYPE_DUP_FN ( MPI_Datatype, int, void *, void *, void *, int * );
321 #include "pup_c.h"
323 typedef void (*MPI_PupFn)(pup_er, void*);
324 typedef void (*MPI_MigrateFn)(void);
326 /********************** MPI-2 prototypes and defines ***************************/
327 /* for the datatype decoders */
328 #define MPI_COMBINER_NAMED 1
329 #define MPI_COMBINER_CONTIGUOUS 2
330 #define MPI_COMBINER_VECTOR 3
331 #define MPI_COMBINER_HVECTOR 4
332 #define MPI_COMBINER_INDEXED 5
333 #define MPI_COMBINER_HINDEXED 6
334 #define MPI_COMBINER_STRUCT 7
335 #define MPI_COMBINER_DARRAY 8
336 #define MPI_COMBINER_RESIZED 9
337 #define MPI_COMBINER_SUBARRAY 10
338 #define MPI_COMBINER_INDEXED_BLOCK 11
339 #define MPI_COMBINER_HINDEXED_BLOCK 12
341 /********************** MPI-1.1 Functions ***************************/
342 /***pt2pt***/
343 #define MPI_BSEND_OVERHEAD 0
344 #define MPI_Send AMPI_Send
345 int AMPI_Send(const void *msg, int count, MPI_Datatype type, int dest,
346 int tag, MPI_Comm comm);
347 #define MPI_Ssend AMPI_Ssend
348 int AMPI_Ssend(const void *msg, int count, MPI_Datatype type, int dest,
349 int tag, MPI_Comm comm);
350 #define MPI_Recv AMPI_Recv
351 int AMPI_Recv(void *msg, int count, MPI_Datatype type, int src, int tag,
352 MPI_Comm comm, MPI_Status *status);
353 #define MPI_Get_count AMPI_Get_count
354 int AMPI_Get_count(const MPI_Status *sts, MPI_Datatype dtype, int *count);
355 #define AMPI_Bsend AMPI_Send
356 #define AMPI_Rsend AMPI_Send
357 #define MPI_Bsend AMPI_Bsend
358 #define MPI_Rsend AMPI_Rsend /* FIXME: MPI_Rsend can be posted only after recv */
359 #define MPI_Buffer_attach(buf,len) /*LIE: empty*/ /*Silly: default send is buffering in Charm++*/
360 #define MPI_Buffer_detach(buf,len) /*LIE: empty*/
361 #define MPI_Isend AMPI_Isend
362 int AMPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest,
363 int tag, MPI_Comm comm, MPI_Request *request);
364 #define MPI_Ibsend AMPI_Isend
365 #define MPI_Issend AMPI_Issend
366 int AMPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest,
367 int tag, MPI_Comm comm, MPI_Request *request);
368 #define MPI_Irsend AMPI_Isend /* FIXME: see MPI_Rsend */
369 #define MPI_Irecv AMPI_Irecv
370 int AMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src,
371 int tag, MPI_Comm comm, MPI_Request *request);
372 #define MPI_Wait AMPI_Wait
373 int AMPI_Wait(MPI_Request *request, MPI_Status *sts);
374 #define MPI_Test AMPI_Test
375 int AMPI_Test(MPI_Request *request, int *flag, MPI_Status *sts);
376 #define MPI_Waitany AMPI_Waitany
377 int AMPI_Waitany(int count, MPI_Request *request, int *index, MPI_Status *sts);
378 #define MPI_Testany AMPI_Testany
379 int AMPI_Testany(int count, MPI_Request *request, int *index, int *flag, MPI_Status *status);
380 #define MPI_Waitall AMPI_Waitall
381 int AMPI_Waitall(int count, MPI_Request *request, MPI_Status *sts);
382 #define MPI_Testall AMPI_Testall
383 int AMPI_Testall(int count, MPI_Request *request, int *flag, MPI_Status *sts);
384 #define MPI_Waitsome AMPI_Waitsome
385 int AMPI_Waitsome(int incount, MPI_Request *array_of_requests, int *outcount,
386 int *array_of_indices, MPI_Status *array_of_statuses);
387 #define MPI_Testsome AMPI_Testsome
388 int AMPI_Testsome(int incount, MPI_Request *array_of_requests, int *outcount,
389 int *array_of_indices, MPI_Status *array_of_statuses);
390 #define MPI_Request_get_status AMPI_Request_get_status
391 int AMPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *sts);
392 #define MPI_Request_free AMPI_Request_free
393 int AMPI_Request_free(MPI_Request *request);
394 #define MPI_Cancel AMPI_Cancel
395 int AMPI_Cancel(MPI_Request *request);
396 #define MPI_Test_cancelled AMPI_Test_cancelled
397 int AMPI_Test_cancelled(const MPI_Status *status, int *flag); /* FIXME: always returns success */
398 #define MPI_Status_set_cancelled AMPI_Status_set_cancelled
399 int AMPI_Status_set_cancelled(MPI_Status *status, int flag);
400 #define MPI_Iprobe AMPI_Iprobe
401 int AMPI_Iprobe(int src, int tag, MPI_Comm comm, int *flag, MPI_Status *sts);
402 #define MPI_Probe AMPI_Probe
403 int AMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *sts);
404 #define MPI_Send_init AMPI_Send_init
405 int AMPI_Send_init(const void *buf, int count, MPI_Datatype type, int dest, int tag,
406 MPI_Comm comm, MPI_Request *req);
407 #define MPI_Ssend_init AMPI_Ssend_init
408 int AMPI_Ssend_init(const void *buf, int count, MPI_Datatype type, int dest, int tag,
409 MPI_Comm comm, MPI_Request *req);
410 #define MPI_Bsend_init AMPI_Send_init
411 #define MPI_Rsend_init AMPI_Send_init /* FIXME: see MPI_Rsend */
412 #define MPI_Recv_init AMPI_Recv_init
413 int AMPI_Recv_init(void *buf, int count, MPI_Datatype type, int src, int tag,
414 MPI_Comm comm, MPI_Request *req);
415 #define MPI_Start AMPI_Start
416 int AMPI_Start(MPI_Request *reqnum);
417 #define MPI_Startall AMPI_Startall
418 int AMPI_Startall(int count, MPI_Request *array_of_requests);
419 #define MPI_Sendrecv AMPI_Sendrecv
420 int AMPI_Sendrecv(const void *sbuf, int scount, MPI_Datatype stype, int dest,
421 int stag, void *rbuf, int rcount, MPI_Datatype rtype,
422 int src, int rtag, MPI_Comm comm, MPI_Status *sts);
423 #define MPI_Sendrecv_replace AMPI_Sendrecv_replace
424 int AMPI_Sendrecv_replace(void* buf, int count, MPI_Datatype datatype,
425 int dest, int sendtag, int source, int recvtag,
426 MPI_Comm comm, MPI_Status *status);
427 #define MPI_Type_contiguous AMPI_Type_contiguous
428 int AMPI_Type_contiguous(int count, MPI_Datatype oldtype,
429 MPI_Datatype *newtype);
430 #define MPI_Type_vector AMPI_Type_vector
431 int AMPI_Type_vector(int count, int blocklength, int stride,
432 MPI_Datatype oldtype, MPI_Datatype *newtype);
433 #define MPI_Type_create_hvector AMPI_Type_create_hvector
434 int AMPI_Type_create_hvector(int count, int blocklength, MPI_Aint stride,
435 MPI_Datatype oldtype, MPI_Datatype *newtype);
436 #define MPI_Type_hvector AMPI_Type_hvector
437 int AMPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
438 MPI_Datatype oldtype, MPI_Datatype *newtype);
439 #define MPI_Type_indexed AMPI_Type_indexed
440 int AMPI_Type_indexed(int count, const int* arrBlength, const int* arrDisp,
441 MPI_Datatype oldtype, MPI_Datatype *newtype);
442 #define MPI_Type_create_hindexed AMPI_Type_create_hindexed
443 int AMPI_Type_create_hindexed(int count, const int* arrBlength, const MPI_Aint* arrDisp,
444 MPI_Datatype oldtype, MPI_Datatype *newtype);
445 #define MPI_Type_create_indexed_block AMPI_Type_create_indexed_block
446 int AMPI_Type_create_indexed_block(int count, int Blength, const MPI_Aint *arrDisp,
447 MPI_Datatype oldtype, MPI_Datatype *newtype);
448 #define MPI_Type_create_hindexed_block AMPI_Type_create_hindexed_block
449 int AMPI_Type_create_hindexed_block(int count, int Blength, const MPI_Aint *arrDisp,
450 MPI_Datatype oldtype, MPI_Datatype *newtype);
451 #define MPI_Type_hindexed AMPI_Type_hindexed
452 int AMPI_Type_hindexed(int count, int* arrBlength, MPI_Aint* arrDisp,
453 MPI_Datatype oldtype, MPI_Datatype *newtype);
454 #define MPI_Type_create_struct AMPI_Type_create_struct
455 int AMPI_Type_create_struct(int count, const int* arrBLength, const MPI_Aint* arrDisp,
456 const MPI_Datatype *oldType, MPI_Datatype *newType);
457 #define MPI_Type_struct AMPI_Type_struct
458 int AMPI_Type_struct(int count, int* arrBLength, MPI_Aint* arrDisp,
459 MPI_Datatype *oldType, MPI_Datatype *newType);
460 #define MPI_Type_get_envelope AMPI_Type_get_envelope
461 int AMPI_Type_get_envelope(MPI_Datatype datatype, int *num_integers, int *num_addresses,
462 int *num_datatypes, int *combiner);
463 #define MPI_Type_get_contents AMPI_Type_get_contents
464 int AMPI_Type_get_contents(MPI_Datatype datatype, int max_integers, int max_addresses,
465 int max_datatypes, int array_of_integers[], MPI_Aint array_of_addresses[],
466 MPI_Datatype array_of_datatypes[]);
467 #define MPI_Type_commit AMPI_Type_commit
468 int AMPI_Type_commit(MPI_Datatype *datatype);
469 #define MPI_Type_free AMPI_Type_free
470 int AMPI_Type_free(MPI_Datatype *datatype);
471 #define MPI_Type_get_extent AMPI_Type_get_extent
472 int AMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent);
473 #define MPI_Type_extent AMPI_Type_extent
474 int AMPI_Type_extent(MPI_Datatype datatype, MPI_Aint *extent);
475 #define MPI_Type_get_true_extent AMPI_Type_get_true_extent
476 int AMPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent);
477 #define MPI_Type_size AMPI_Type_size
478 int AMPI_Type_size(MPI_Datatype datatype, int *size);
479 #define MPI_Type_lb AMPI_Type_lb
480 int AMPI_Type_lb(MPI_Datatype datatype, MPI_Aint* displacement);
481 #define MPI_Type_ub AMPI_Type_ub
482 int AMPI_Type_ub(MPI_Datatype datatype, MPI_Aint* displacement);
483 #define MPI_Type_set_name AMPI_Type_set_name
484 int AMPI_Type_set_name(MPI_Datatype datatype, const char *name);
485 #define MPI_Type_get_name AMPI_Type_get_name
486 int AMPI_Type_get_name(MPI_Datatype datatype, char *name, int *resultlen);
487 #define MPI_Type_dup AMPI_Type_dup
488 int AMPI_Type_dup(MPI_Datatype oldtype, MPI_Datatype *newtype);
489 #define MPI_Type_create_resized AMPI_Type_create_resized
490 int AMPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype);
491 #define MPI_Type_set_attr AMPI_Type_set_attr
492 int AMPI_Type_set_attr(MPI_Datatype datatype, int type_keyval, void *attribute_val);
493 #define MPI_Type_get_attr AMPI_Type_get_attr
494 int AMPI_Type_get_attr(MPI_Datatype datatype, int type_keyval, void *attribute_val, int *flag);
495 #define MPI_Type_delete_attr AMPI_Type_delete_attr
496 int AMPI_Type_delete_attr(MPI_Datatype datatype, int type_keyval);
497 #define MPI_Type_create_keyval AMPI_Type_create_keyval
498 int AMPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn,
499 MPI_Type_delete_attr_function *type_delete_attr_fn,
500 int *type_keyval, void *extra_state);
501 #define MPI_Type_free_keyval AMPI_Type_free_keyval
502 int AMPI_Type_free_keyval(int *type_keyval);
503 #define MPI_Get_address AMPI_Get_address
504 int AMPI_Get_address(const void* location, MPI_Aint *address);
505 #define MPI_Address AMPI_Address
506 int AMPI_Address(void* location, MPI_Aint *address);
507 #define MPI_Status_set_elements AMPI_Status_set_elements
508 int AMPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count);
509 #define MPI_Get_elements AMPI_Get_elements
510 int AMPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count);
511 #define MPI_Get_elements_x AMPI_Get_elements_x
512 int AMPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
513 #define MPI_Pack AMPI_Pack
514 int AMPI_Pack(const void *inbuf, int incount, MPI_Datatype dtype, void *outbuf,
515 int outsize, int *position, MPI_Comm comm);
516 #define MPI_Unpack AMPI_Unpack
517 int AMPI_Unpack(const void *inbuf, int insize, int *position, void *outbuf,
518 int outcount, MPI_Datatype dtype, MPI_Comm comm);
519 #define MPI_Pack_size AMPI_Pack_size
520 int AMPI_Pack_size(int incount,MPI_Datatype datatype,MPI_Comm comm,int *sz);
521 #define MPI_Aint_add(addr, disp) ((MPI_Aint)((char*)(addr) + (disp)))
522 #define MPI_Aint_diff(addr1, addr2) ((MPI_Aint)((char*)(addr1) - (char*)(addr2)))
524 /***collective***/
525 #define MPI_Barrier AMPI_Barrier
526 int AMPI_Barrier(MPI_Comm comm);
527 #define MPI_Ibarrier AMPI_Ibarrier
528 int AMPI_Ibarrier(MPI_Comm comm, MPI_Request *request);
529 #define MPI_Bcast AMPI_Bcast
530 int AMPI_Bcast(void *buf, int count, MPI_Datatype type, int root, MPI_Comm comm);
531 #define MPI_Ibcast AMPI_Ibcast
532 int AMPI_Ibcast(void *buf, int count, MPI_Datatype type, int root, MPI_Comm comm,
533 MPI_Request *request);
534 #define MPI_Gather AMPI_Gather
535 int AMPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
536 void *recvbuf, int recvcount, MPI_Datatype recvtype,
537 int root, MPI_Comm comm);
538 #define MPI_Igather AMPI_Igather
539 int AMPI_Igather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
540 void *recvbuf, int recvcount, MPI_Datatype recvtype,
541 int root, MPI_Comm comm, MPI_Request *request);
542 #define MPI_Gatherv AMPI_Gatherv
543 int AMPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
544 void *recvbuf, const int *recvcounts, const int *displs,
545 MPI_Datatype recvtype, int root, MPI_Comm comm);
546 #define MPI_Igatherv AMPI_Igatherv
547 int AMPI_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
548 void *recvbuf, const int *recvcounts, const int *displs,
549 MPI_Datatype recvtype, int root, MPI_Comm comm,
550 MPI_Request *request);
551 #define MPI_Scatter AMPI_Scatter
552 int AMPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
553 void *recvbuf, int recvcount, MPI_Datatype recvtype,
554 int root, MPI_Comm comm);
555 #define MPI_Iscatter AMPI_Iscatter
556 int AMPI_Iscatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
557 void *recvbuf, int recvcount, MPI_Datatype recvtype,
558 int root, MPI_Comm comm, MPI_Request *request);
559 #define MPI_Scatterv AMPI_Scatterv
560 int AMPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype,
561 void *recvbuf, int recvcount, MPI_Datatype recvtype,
562 int root, MPI_Comm comm);
563 #define MPI_Iscatterv AMPI_Iscatterv
564 int AMPI_Iscatterv(const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype,
565 void *recvbuf, int recvcount, MPI_Datatype recvtype,
566 int root, MPI_Comm comm, MPI_Request *request);
567 #define MPI_Allgather AMPI_Allgather
568 int AMPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
569 void *recvbuf, int recvcount, MPI_Datatype recvtype,
570 MPI_Comm comm);
571 #define MPI_Iallgather AMPI_Iallgather
572 int AMPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
573 void *recvbuf, int recvcount, MPI_Datatype recvtype,
574 MPI_Comm comm, MPI_Request* request);
575 #define MPI_Allgatherv AMPI_Allgatherv
576 int AMPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
577 void *recvbuf, const int *recvcounts, const int *displs,
578 MPI_Datatype recvtype, MPI_Comm comm) ;
579 #define MPI_Iallgatherv AMPI_Iallgatherv
580 int AMPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
581 void *recvbuf, const int *recvcounts, const int *displs,
582 MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request);
583 #define MPI_Alltoall AMPI_Alltoall
584 int AMPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
585 void *recvbuf, int recvcount, MPI_Datatype recvtype,
586 MPI_Comm comm);
587 #define MPI_Ialltoall AMPI_Ialltoall
588 int AMPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
589 void *recvbuf, int recvcount, MPI_Datatype recvtype,
590 MPI_Comm comm, MPI_Request *request);
591 #define MPI_Alltoallv AMPI_Alltoallv
592 int AMPI_Alltoallv(const void *sendbuf, const int *sendcounts, const int *sdispls,
593 MPI_Datatype sendtype, void *recvbuf, const int *recvcounts,
594 const int *rdispls, MPI_Datatype recvtype, MPI_Comm comm);
595 #define MPI_Ialltoallv AMPI_Ialltoallv
596 int AMPI_Ialltoallv(void *sendbuf, int *sendcounts, int *sdispls,
597 MPI_Datatype sendtype, void *recvbuf, int *recvcounts,
598 int *rdispls, MPI_Datatype recvtype, MPI_Comm comm,
599 MPI_Request *request);
600 #define MPI_Alltoallw AMPI_Alltoallw
601 int AMPI_Alltoallw(const void *sendbuf, const int *sendcounts, const int *sdispls,
602 const MPI_Datatype *sendtypes, void *recvbuf, const int *recvcounts,
603 const int *rdispls, const MPI_Datatype *recvtypes, MPI_Comm comm);
604 #define MPI_Ialltoallw AMPI_Ialltoallw
605 int AMPI_Ialltoallw(const void *sendbuf, const int *sendcounts, const int *sdispls,
606 const MPI_Datatype *sendtypes, void *recvbuf, const int *recvcounts,
607 const int *rdispls, const MPI_Datatype *recvtypes, MPI_Comm comm,
608 MPI_Request *request);
609 #define MPI_Reduce AMPI_Reduce
610 int AMPI_Reduce(const void *inbuf, void *outbuf, int count, MPI_Datatype type,
611 MPI_Op op, int root, MPI_Comm comm);
612 #define MPI_Ireduce AMPI_Ireduce
613 int AMPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype type,
614 MPI_Op op, int root, MPI_Comm comm, MPI_Request *request);
615 #define MPI_Allreduce AMPI_Allreduce
616 int AMPI_Allreduce(const void *inbuf, void *outbuf, int count, MPI_Datatype type,
617 MPI_Op op, MPI_Comm comm);
618 #define MPI_Iallreduce AMPI_Iallreduce
619 int AMPI_Iallreduce(const void *inbuf, void *outbuf, int count, MPI_Datatype type,
620 MPI_Op op, MPI_Comm comm, MPI_Request *request);
621 #define MPI_Reduce_local AMPI_Reduce_local
622 int AMPI_Reduce_local(const void *inbuf, void *outbuf, int count,
623 MPI_Datatype datatype, MPI_Op op);
624 #define MPI_Reduce_scatter_block AMPI_Reduce_scatter_block
625 int AMPI_Reduce_scatter_block(const void* sendbuf, void* recvbuf, int count,
626 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
627 #define MPI_Reduce_scatter AMPI_Reduce_scatter
628 int AMPI_Reduce_scatter(const void* sendbuf, void* recvbuf, const int *recvcounts,
629 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
630 #define MPI_Scan AMPI_Scan
631 int AMPI_Scan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
632 MPI_Op op, MPI_Comm comm );
633 #define MPI_Exscan AMPI_Exscan
634 int AMPI_Exscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
635 MPI_Op op, MPI_Comm comm);
636 #define MPI_Neighbor_alltoall AMPI_Neighbor_alltoall
637 int AMPI_Neighbor_alltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype,
638 void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
639 #define MPI_Ineighbor_alltoall AMPI_Ineighbor_alltoall
640 int AMPI_Ineighbor_alltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype,
641 void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm,
642 MPI_Request* request);
643 #define MPI_Neighbor_alltoallv AMPI_Neighbor_alltoallv
644 int AMPI_Neighbor_alltoallv(const void* sendbuf, const int* sendcounts, const int* sdispls,
645 MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* rdispls,
646 MPI_Datatype recvtype, MPI_Comm comm);
647 #define MPI_Ineighbor_alltoallv AMPI_Ineighbor_alltoallv
648 int AMPI_Ineighbor_alltoallv(const void* sendbuf, const int* sendcounts, const int* sdispls,
649 MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* rdispls,
650 MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request);
651 #define MPI_Neighbor_alltoallw AMPI_Neighbor_alltoallw
652 int AMPI_Neighbor_alltoallw(const void* sendbuf, const int* sendcounts, const MPI_Aint* sdipls,
653 const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcounts, const MPI_Aint* rdispls,
654 const MPI_Datatype* recvtypes, MPI_Comm comm);
655 #define MPI_Ineighbor_alltoallw AMPI_Ineighbor_alltoallw
656 int AMPI_Ineighbor_alltoallw(const void* sendbuf, const int* sendcounts, const MPI_Aint* sdispls,
657 const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcounts, const MPI_Aint* rdispls,
658 const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request* request);
659 #define MPI_Neighbor_allgather AMPI_Neighbor_allgather
660 int AMPI_Neighbor_allgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype,
661 void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm);
662 #define MPI_Ineighbor_allgather AMPI_Ineighbor_allgather
663 int AMPI_Ineighbor_allgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype,
664 void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm,
665 MPI_Request *request);
666 #define MPI_Neighbor_allgatherv AMPI_Neighbor_allgatherv
667 int AMPI_Neighbor_allgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype,
668 void* recvbuf, const int* recvcounts, const int* displs, MPI_Datatype recvtype,
669 MPI_Comm comm);
670 #define MPI_Ineighbor_allgatherv AMPI_Ineighbor_allgatherv
671 int AMPI_Ineighbor_allgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype,
672 void* recvbuf, const int* recvcounts, const int* displs, MPI_Datatype recvtype,
673 MPI_Comm comm, MPI_Request *request);
674 #define MPI_Op_create AMPI_Op_create
675 int AMPI_Op_create(MPI_User_function *function, int commute, MPI_Op *op);
676 #define MPI_Op_free AMPI_Op_free
677 int AMPI_Op_free(MPI_Op *op);
678 #define MPI_Op_commutative AMPI_Op_commutative
679 int AMPI_Op_commutative(MPI_Op op, int* commute);
681 /***groups,contexts and communicators***/
682 #define MPI_Group_size AMPI_Group_size
683 int AMPI_Group_size(MPI_Group group, int *size);
684 #define MPI_Group_rank AMPI_Group_rank
685 int AMPI_Group_rank(MPI_Group group, int *rank);
686 #define MPI_Group_translate_ranks AMPI_Group_translate_ranks
687 int AMPI_Group_translate_ranks(MPI_Group group1, int n, const int *ranks1, MPI_Group group2, int *ranks2);
688 #define MPI_Group_compare AMPI_Group_compare
689 int AMPI_Group_compare(MPI_Group group1,MPI_Group group2, int *result);
690 #define MPI_Comm_group AMPI_Comm_group
691 int AMPI_Comm_group(MPI_Comm comm, MPI_Group *group);
692 #define MPI_Group_union AMPI_Group_union
693 int AMPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup);
694 #define MPI_Group_intersection AMPI_Group_intersection
695 int AMPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup);
696 #define MPI_Group_difference AMPI_Group_difference
697 int AMPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup);
698 #define MPI_Group_incl AMPI_Group_incl
699 int AMPI_Group_incl(MPI_Group group, int n, const int *ranks, MPI_Group *newgroup);
700 #define MPI_Group_excl AMPI_Group_excl
701 int AMPI_Group_excl(MPI_Group group, int n, const int *ranks, MPI_Group *newgroup);
702 #define MPI_Group_range_incl AMPI_Group_range_incl
703 int AMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup);
704 #define MPI_Group_range_excl AMPI_Group_range_excl
705 int AMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup);
706 #define MPI_Group_free AMPI_Group_free
707 int AMPI_Group_free(MPI_Group *group);
709 #define MPI_Intercomm_create AMPI_Intercomm_create
710 int AMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm,
711 int remote_leader, int tag, MPI_Comm *newintercomm);
712 #define MPI_Intercomm_merge AMPI_Intercomm_merge
713 int AMPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintracomm);
715 #define MPI_Comm_create AMPI_Comm_create
716 int AMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm* newcomm);
717 #define MPI_Comm_size AMPI_Comm_size
718 int AMPI_Comm_size(MPI_Comm comm, int *size);
719 #define MPI_Comm_rank AMPI_Comm_rank
720 int AMPI_Comm_rank(MPI_Comm comm, int *rank);
721 #define MPI_Comm_compare AMPI_Comm_compare
722 int AMPI_Comm_compare(MPI_Comm comm1,MPI_Comm comm2, int *result);
723 #define MPI_Comm_split AMPI_Comm_split
724 int AMPI_Comm_split(MPI_Comm src, int color, int key, MPI_Comm *dest);
725 #define MPI_Comm_split_type AMPI_Comm_split_type
726 int AMPI_Comm_split_type(MPI_Comm src, int split_type, int key, MPI_Info info, MPI_Comm *dest);
727 #define MPI_Comm_dup AMPI_Comm_dup
728 int AMPI_Comm_dup(MPI_Comm src, MPI_Comm *dest);
729 #define MPI_Comm_dup_with_info AMPI_Comm_dup_with_info
730 int AMPI_Comm_dup_with_info(MPI_Comm src, MPI_Info info, MPI_Comm *dest);
731 #define MPI_Comm_free AMPI_Comm_free
732 int AMPI_Comm_free(MPI_Comm *comm);
733 #define MPI_Comm_test_inter AMPI_Comm_test_inter
734 int AMPI_Comm_test_inter(MPI_Comm comm, int *flag);
735 #define MPI_Comm_remote_size AMPI_Comm_remote_size
736 int AMPI_Comm_remote_size(MPI_Comm comm, int *size);
737 #define MPI_Comm_remote_group AMPI_Comm_remote_group
738 int AMPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group);
739 #define MPI_Comm_set_name AMPI_Comm_set_name
740 int AMPI_Comm_set_name(MPI_Comm comm, const char *name);
741 #define MPI_Comm_get_name AMPI_Comm_get_name
742 int AMPI_Comm_get_name(MPI_Comm comm, char *comm_name, int *resultlen);
743 #define MPI_Comm_set_info AMPI_Comm_set_info
744 int AMPI_Comm_set_info(MPI_Comm comm, MPI_Info info);
745 #define MPI_Comm_get_info AMPI_Comm_get_info
746 int AMPI_Comm_get_info(MPI_Comm comm, MPI_Info *info);
747 #define MPI_Comm_call_errhandler AMPI_Comm_call_errhandler
748 int AMPI_Comm_call_errhandler(MPI_Comm comm, int errorcode);
749 #define MPI_Comm_create_errhandler AMPI_Comm_create_errhandler
750 int AMPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler);
751 #define MPI_Comm_set_errhandler AMPI_Comm_set_errhandler
752 int AMPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler);
753 #define MPI_Comm_get_errhandler AMPI_Comm_get_errhandler
754 int AMPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler);
755 #define MPI_Comm_free_errhandler AMPI_Comm_free_errhandler
756 int AMPI_Comm_free_errhandler(MPI_Errhandler *errhandler);
757 #define MPI_Comm_create_keyval AMPI_Comm_create_keyval
758 int AMPI_Comm_create_keyval(MPI_Comm_copy_attr_function *copy_fn, MPI_Comm_delete_attr_function *delete_fn,
759 int *keyval, void* extra_state);
760 #define MPI_Comm_free_keyval AMPI_Comm_free_keyval
761 int AMPI_Comm_free_keyval(int *keyval);
762 #define MPI_Comm_set_attr AMPI_Comm_set_attr
763 int AMPI_Comm_set_attr(MPI_Comm comm, int keyval, void* attribute_val);
764 #define MPI_Comm_get_attr AMPI_Comm_get_attr
765 int AMPI_Comm_get_attr(MPI_Comm comm, int keyval, void *attribute_val, int *flag);
766 #define MPI_Comm_delete_attr AMPI_Comm_delete_attr
767 int AMPI_Comm_delete_attr(MPI_Comm comm, int keyval);
769 #define MPI_Keyval_create AMPI_Keyval_create
770 int AMPI_Keyval_create(MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn,
771 int *keyval, void* extra_state);
772 #define MPI_Keyval_free AMPI_Keyval_free
773 int AMPI_Keyval_free(int *keyval);
774 #define MPI_Attr_put AMPI_Attr_put
775 int AMPI_Attr_put(MPI_Comm comm, int keyval, void* attribute_val);
776 #define MPI_Attr_get AMPI_Attr_get
777 int AMPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag);
778 #define MPI_Attr_delete AMPI_Attr_delete
779 int AMPI_Attr_delete(MPI_Comm comm, int keyval);
781 /***topologies***/
782 #define MPI_Cart_create AMPI_Cart_create
783 int AMPI_Cart_create(MPI_Comm comm_old, int ndims, const int *dims,
784 const int *periods, int reorder, MPI_Comm *comm_cart);
785 #define MPI_Graph_create AMPI_Graph_create
786 int AMPI_Graph_create(MPI_Comm comm_old, int nnodes, const int *index,
787 const int *edges, int reorder, MPI_Comm *comm_graph);
788 #define MPI_Topo_test AMPI_Topo_test
789 int AMPI_Topo_test(MPI_Comm comm, int *status);
790 #define MPI_Cart_map AMPI_Cart_map
791 int AMPI_Cart_map(MPI_Comm comm, int ndims, const int *dims, const int *periods,
792 int *newrank);
793 #define MPI_Graph_map AMPI_Graph_map
794 int AMPI_Graph_map(MPI_Comm comm, int nnodes, const int *index, const int *edges,
795 int *newrank);
796 #define MPI_Cartdim_get AMPI_Cartdim_get
797 int AMPI_Cartdim_get(MPI_Comm comm, int *ndims);
798 #define MPI_Cart_get AMPI_Cart_get
799 int AMPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords);
800 #define MPI_Cart_rank AMPI_Cart_rank
801 int AMPI_Cart_rank(MPI_Comm comm, const int *coords, int *rank);
802 #define MPI_Cart_coords AMPI_Cart_coords
803 int AMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords);
804 #define MPI_Cart_shift AMPI_Cart_shift
805 int AMPI_Cart_shift(MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest);
806 #define MPI_Graphdims_get AMPI_Graphdims_get
807 int AMPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges);
808 #define MPI_Graph_get AMPI_Graph_get
809 int AMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int *index, int *edges);
810 #define MPI_Graph_neighbors_count AMPI_Graph_neighbors_count
811 int AMPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors);
812 #define MPI_Graph_neighbors AMPI_Graph_neighbors
813 int AMPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int *neighbors);
814 #define MPI_Dims_create AMPI_Dims_create
815 int AMPI_Dims_create(int nnodes, int ndims, int *dims);
816 #define MPI_Cart_sub AMPI_Cart_sub
817 int AMPI_Cart_sub(MPI_Comm comm, const int *remain_dims, MPI_Comm *newcomm);
819 /***environment management***/
820 #define MPI_Get_version AMPI_Get_version
821 int AMPI_Get_version(int *version, int *subversion);
822 #define MPI_Get_library_version AMPI_Get_library_version
823 int AMPI_Get_library_version(char *version, int *resultlen);
824 #define MPI_Get_processor_name AMPI_Get_processor_name
825 int AMPI_Get_processor_name(char *name, int *resultlen);
826 #define MPI_Errhandler_create AMPI_Errhandler_create
827 int AMPI_Errhandler_create(MPI_Handler_function *function, MPI_Errhandler *errhandler);
828 #define MPI_Errhandler_set AMPI_Errhandler_set
829 int AMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler);
830 #define MPI_Errhandler_get AMPI_Errhandler_get
831 int AMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler);
832 #define MPI_Errhandler_free AMPI_Errhandler_free
833 int AMPI_Errhandler_free(MPI_Errhandler *errhandler);
834 #define MPI_Add_error_code AMPI_Add_error_code
835 int AMPI_Add_error_code(int errorclass, int *errorcode);
836 #define MPI_Add_error_class AMPI_Add_error_class
837 int AMPI_Add_error_class(int *errorclass);
838 #define MPI_Add_error_string AMPI_Add_error_string
839 int AMPI_Add_error_string(int errorcode, const char *errorstring);
840 #define MPI_Error_class AMPI_Error_class
841 int AMPI_Error_class(int errorcode, int *errorclass);
842 #define MPI_Error_string AMPI_Error_string
843 int AMPI_Error_string(int errorcode, char *string, int *resultlen);
844 #define MPI_Wtime AMPI_Wtime
845 double AMPI_Wtime(void);
846 #define MPI_Wtick AMPI_Wtick
847 double AMPI_Wtick(void);
848 #define MPI_Is_thread_main AMPI_Is_thread_main
849 int AMPI_Is_thread_main(int *flag);
850 #define MPI_Query_thread AMPI_Query_thread
851 int AMPI_Query_thread(int *provided);
852 #define MPI_Init_thread AMPI_Init_thread
853 int AMPI_Init_thread(int *argc, char*** argv, int required, int *provided);
854 #define MPI_Init AMPI_Init
855 int AMPI_Init(int *argc, char*** argv);
856 #define MPI_Initialized AMPI_Initialized
857 int AMPI_Initialized(int *isInit);
858 #define MPI_Finalize AMPI_Finalize
859 int AMPI_Finalize(void);
860 #define MPI_Finalized AMPI_Finalized
861 int AMPI_Finalized(int *);
862 #define MPI_Abort AMPI_Abort
863 int AMPI_Abort(MPI_Comm comm, int errorcode);
865 /*** Profiling ***/
866 #define MPI_Pcontrol AMPI_Pcontrol
867 int AMPI_Pcontrol(const int level, ...);
869 /*********************One sided communication routines *****************/
870 /* MPI_Win : an index into a list in ampiParent (just like MPI_Group) */
871 /* name length for COMM, TYPE and WIN */
872 #define MPI_MAX_OBJECT_NAME 255
873 #define MPI_MAX_INFO_KEY 255
874 #define MPI_MAX_INFO_VAL 1024
875 #define MPI_LOCK_SHARED 54
876 #define MPI_LOCK_EXCLUSIVE 55
877 #define MPI_WIN_NULL -1
879 #define MPI_WIN_FLAVOR_CREATE 1
880 #define MPI_WIN_FLAVOR_ALLOCATE 2
881 #define MPI_WIN_FLAVOR_DYNAMIC 3
882 #define MPI_WIN_FLAVOR_SHARED 4
884 #define MPI_WIN_UNIFIED 0
885 #define MPI_WIN_SEPARATE 1
887 #define MPI_MODE_NOCHECK 1
888 #define MPI_MODE_NOPRECEDE 2
889 #define MPI_MODE_NOPUT 4
890 #define MPI_MODE_NOSTORE 8
891 #define MPI_MODE_NOSUCCEED 16
893 typedef int MPI_Win;
895 typedef void (MPI_Win_errhandler_fn)(MPI_Win *, int *, ...);
896 typedef void (MPI_Win_errhandler_function)(MPI_Win *, int *, ...);
898 typedef int (MPI_Win_copy_attr_function)(MPI_Win oldwin, int keyval,
899 void *extra_state, void *attribute_val_in,
900 void *attribute_val_out, int *flag);
901 typedef int (MPI_Win_delete_attr_function)(MPI_Win win, int keyval,
902 void *attribute_val, void *extra_state);
904 #define MPI_WIN_NULL_DELETE_FN MPI_win_null_delete_fn
905 #define MPI_WIN_NULL_COPY_FN MPI_win_null_copy_fn
906 #define MPI_WIN_DUP_FN MPI_win_dup_fn
908 int MPI_WIN_NULL_COPY_FN ( MPI_Win, int, void *, void *, void *, int * );
909 int MPI_WIN_NULL_DELETE_FN ( MPI_Win, int, void *, void * );
910 int MPI_WIN_DUP_FN ( MPI_Win, int, void *, void *, void *, int * );
912 #define MPI_Win_create AMPI_Win_create
913 int AMPI_Win_create(void *base, MPI_Aint size, int disp_unit,
914 MPI_Info info, MPI_Comm comm, MPI_Win *newwin);
915 #define MPI_Win_free AMPI_Win_free
916 int AMPI_Win_free(MPI_Win *win);
917 #define MPI_Win_create_errhandler AMPI_Win_create_errhandler
918 int AMPI_Win_create_errhandler(MPI_Win_errhandler_function *win_errhandler_fn,
919 MPI_Errhandler *errhandler);
920 #define MPI_Win_get_errhandler AMPI_Win_get_errhandler
921 int AMPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler);
922 #define MPI_Win_set_errhandler AMPI_Win_set_errhandler
923 int AMPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler);
924 #define MPI_Win_create_keyval AMPI_Win_create_keyval
925 int AMPI_Win_create_keyval(MPI_Win_copy_attr_function *copy_fn,
926 MPI_Win_delete_attr_function *delete_fn,
927 int *keyval, void *extra_state);
928 #define MPI_Win_free_keyval AMPI_Win_free_keyval
929 int AMPI_Win_free_keyval(int *keyval);
930 #define MPI_Win_delete_attr AMPI_Win_delete_attr
931 int AMPI_Win_delete_attr(MPI_Win win, int key);
932 #define MPI_Win_get_attr AMPI_Win_get_attr
933 int AMPI_Win_get_attr(MPI_Win win, int win_keyval, void *attribute_val, int *flag);
934 #define MPI_Win_set_attr AMPI_Win_set_attr
935 int AMPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val);
936 #define MPI_Win_get_group AMPI_Win_get_group
937 int AMPI_Win_get_group(MPI_Win win, MPI_Group *group);
938 #define MPI_Win_set_name AMPI_Win_set_name
939 int AMPI_Win_set_name(MPI_Win win, const char *name);
940 #define MPI_Win_get_name AMPI_Win_get_name
941 int AMPI_Win_get_name(MPI_Win win, char *name, int *length);
942 #define MPI_Win_set_info AMPI_Win_set_info
943 int AMPI_Win_set_info(MPI_Win win, MPI_Info info);
944 #define MPI_Win_get_info AMPI_Win_get_info
945 int AMPI_Win_get_info(MPI_Win win, MPI_Info *info);
946 #define MPI_Win_fence AMPI_Win_fence
947 int AMPI_Win_fence(int assertion, MPI_Win win);
948 #define MPI_Win_lock AMPI_Win_lock
949 int AMPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win);
950 #define MPI_Win_unlock AMPI_Win_unlock
951 int AMPI_Win_unlock(int rank, MPI_Win win);
952 #define MPI_Win_post AMPI_Win_post
953 int AMPI_Win_post(MPI_Group group, int assertion, MPI_Win win);
954 #define MPI_Win_wait AMPI_Win_wait
955 int AMPI_Win_wait(MPI_Win win);
956 #define MPI_Win_start AMPI_Win_start
957 int AMPI_Win_start(MPI_Group group, int assertion, MPI_Win win);
958 #define MPI_Win_complete AMPI_Win_complete
959 int AMPI_Win_complete(MPI_Win win);
960 #define MPI_Win_test AMPI_Win_test
961 int AMPI_Win_test(MPI_Win win, int *flag);
962 #define MPI_Alloc_mem AMPI_Alloc_mem
963 int AMPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr);
964 #define MPI_Free_mem AMPI_Free_mem
965 int AMPI_Free_mem(void *base);
966 #define MPI_Put AMPI_Put
967 int AMPI_Put(const void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank,
968 MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win);
969 #define MPI_Get AMPI_Get
970 int AMPI_Get(void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank,
971 MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win);
972 #define MPI_Accumulate AMPI_Accumulate
973 int AMPI_Accumulate(const void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank,
974 MPI_Aint targdisp, int targcnt, MPI_Datatype targtype,
975 MPI_Op op, MPI_Win win);
976 #define MPI_Get_accumulate AMPI_Get_accumulate
977 int AMPI_Get_accumulate(const void *orgaddr, int orgcnt, MPI_Datatype orgtype,
978 void *resaddr, int rescnt, MPI_Datatype restype,
979 int rank, MPI_Aint targdisp, int targcnt,
980 MPI_Datatype targtype, MPI_Op op, MPI_Win win);
981 #define MPI_Rput AMPI_Rput
982 int MPI_Rput(const void *orgaddr, int orgcnt, MPI_Datatype orgtype, int targrank,
983 MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win,
984 MPI_Request *request);
985 #define MPI_Rget AMPI_Rget
986 int AMPI_Rget(void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank,
987 MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win,
988 MPI_Request *request);
989 #define MPI_Raccumulate AMPI_Raccumulate
990 int AMPI_Raccumulate(const void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank,
991 MPI_Aint targdisp, int targcnt, MPI_Datatype targtype,
992 MPI_Op op, MPI_Win win, MPI_Request *request);
993 #define MPI_Rget_accumulate AMPI_Rget_accumulate
994 int AMPI_Rget_accumulate(const void *orgaddr, int orgcnt, MPI_Datatype orgtype,
995 void *resaddr, int rescnt, MPI_Datatype restype,
996 int rank, MPI_Aint targdisp, int targcnt,
997 MPI_Datatype targtype, MPI_Op op, MPI_Win win,
998 MPI_Request *request);
999 #define MPI_Fetch_and_op AMPI_Fetch_and_op
1000 int AMPI_Fetch_and_op(const void *orgaddr, void *resaddr, MPI_Datatype type,
1001 int rank, MPI_Aint targdisp, MPI_Op op, MPI_Win win);
1002 #define MPI_Compare_and_swap AMPI_Compare_and_swap
1003 int AMPI_Compare_and_swap(const void *orgaddr, const void *compaddr, void *resaddr,
1004 MPI_Datatype type, int rank, MPI_Aint targdisp,
1005 MPI_Win win);
1007 #define MPI_Info_create AMPI_Info_create
1008 int AMPI_Info_create(MPI_Info *info);
1009 #define MPI_Info_set AMPI_Info_set
1010 int AMPI_Info_set(MPI_Info info, const char *key, const char *value);
1011 #define MPI_Info_delete AMPI_Info_delete
1012 int AMPI_Info_delete(MPI_Info info, const char *key);
1013 #define MPI_Info_get AMPI_Info_get
1014 int AMPI_Info_get(MPI_Info info, const char *key, int valuelen, char *value, int *flag);
1015 #define MPI_Info_get_valuelen AMPI_Info_get_valuelen
1016 int AMPI_Info_get_valuelen(MPI_Info info, const char *key, int *valuelen, int *flag);
1017 #define MPI_Info_get_nkeys AMPI_Info_get_nkeys
1018 int AMPI_Info_get_nkeys(MPI_Info info, int *nkeys);
1019 #define MPI_Info_get_nthkey AMPI_Info_get_nthkey
1020 int AMPI_Info_get_nthkey(MPI_Info info, int n, char *key);
1021 #define MPI_Info_dup AMPI_Info_dup
1022 int AMPI_Info_dup(MPI_Info info, MPI_Info *newinfo);
1023 #define MPI_Info_free AMPI_Info_free
1024 int AMPI_Info_free(MPI_Info *info);
1026 #define MPI_Comm_c2f(comm) (MPI_Fint)(comm)
1027 #define MPI_Comm_f2c(comm) (MPI_Comm)(comm)
1028 #define MPI_Type_c2f(datatype) (MPI_Fint)(datatype)
1029 #define MPI_Type_f2c(datatype) (MPI_Datatype)(datatype)
1030 #define MPI_Group_c2f(group) (MPI_Fint)(group)
1031 #define MPI_Group_f2c(group) (MPI_Group)(group)
1032 #define MPI_Info_c2f(info) (MPI_Fint)(info)
1033 #define MPI_Info_f2c(info) (MPI_Info)(info)
1034 #define MPI_Request_f2c(request) (MPI_Request)(request)
1035 #define MPI_Request_c2f(request) (MPI_Fint)(request)
1036 #define MPI_Op_c2f(op) (MPI_Fint)(op)
1037 #define MPI_Op_f2c(op) (MPI_Op)(op)
1038 #define MPI_Errhandler_c2f(errhandler) (MPI_Fint)(errhandler)
1039 #define MPI_Errhandler_f2c(errhandler) (MPI_Errhandler)(errhandler)
1040 #define MPI_Win_c2f(win) (MPI_Fint)(win)
1041 #define MPI_Win_f2c(win) (MPI_Win)(win)
1043 #include "mpio.h"
1045 /*** AMPI Extensions ***/
1046 int AMPI_Migrate(MPI_Info hints);
1047 int AMPI_Load_start_measure(void);
1048 int AMPI_Load_stop_measure(void);
1049 int AMPI_Load_reset_measure(void);
1050 int AMPI_Load_set_value(double value);
1051 int AMPI_Migrate_to_pe(int dest);
1052 int AMPI_Set_migratable(int mig);
1053 int AMPI_Register_pup(MPI_PupFn fn, void *data, int *idx);
1054 int AMPI_Get_pup_data(int idx, void *data);
1055 int AMPI_Register_main(MPI_MainFn mainFn, const char *name);
1056 int AMPI_Register_about_to_migrate(MPI_MigrateFn fn);
1057 int AMPI_Register_just_migrated(MPI_MigrateFn fn);
1058 int AMPI_Iget(MPI_Aint orgdisp, int orgcnt, MPI_Datatype orgtype, int rank,
1059 MPI_Aint targdisp, int targcnt, MPI_Datatype targtype,
1060 MPI_Win win, MPI_Request *request);
1061 int AMPI_Iget_wait(MPI_Request *request, MPI_Status *status, MPI_Win win);
1062 int AMPI_Iget_free(MPI_Request *request, MPI_Status *status, MPI_Win win);
1063 int AMPI_Iget_data(void *data, MPI_Status status);
1064 int AMPI_Type_is_contiguous(MPI_Datatype datatype, int *flag);
1065 int AMPI_Evacuate(void);
1066 int AMPI_Yield(void);
1067 int AMPI_Suspend(void);
1068 int AMPI_Resume(int dest, MPI_Comm comm);
1069 int AMPI_Print(const char *str);
1070 int AMPI_Trace_begin(void);
1071 int AMPI_Trace_end(void);
1072 int AMPI_Alltoall_iget(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1073 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1074 MPI_Comm comm);
1075 int AMPI_Alltoall_medium(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1076 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1077 MPI_Comm comm);
1078 int AMPI_Alltoall_long(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1079 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1080 MPI_Comm comm);
1082 #if CMK_BIGSIM_CHARM
1083 int AMPI_Set_start_event(MPI_Comm comm);
1084 int AMPI_Set_end_event(void);
1085 void beginTraceBigSim(char* msg);
1086 void endTraceBigSim(char* msg, char* param);
1087 #endif
1089 #if CMK_CUDA
1090 typedef struct workRequest workRequest;
1091 int AMPI_GPU_Iinvoke(workRequest *to_call, MPI_Request *request);
1092 int AMPI_GPU_Invoke(workRequest *to_call);
1093 #endif
1095 /* Execute this shell command (just like "system()") */
1096 int AMPI_System(const char *cmd);
1098 extern int traceRegisterFunction(const char *name, int idx);
1099 extern void traceBeginFuncProj(const char *, const char *, int);
1100 extern void traceEndFuncProj(const char *);
1101 extern void traceBeginFuncIndexProj(int, const char *, int);
1102 extern void traceEndFuncIndexProj(int);
1104 /* Determine approximate depth of stack at the point of this call */
1105 extern long ampiCurrentStackUsage(void);
1107 #define AMPI_Trace_register_function_id(x, id) traceRegisterFunction(x, id);
1108 #define AMPI_Trace_begin_function_id(id) traceBeginFuncIndexProj(id, __FILE__, __LINE__);
1109 #define AMPI_Trace_end_function_id(id) traceEndFuncIndexProj(id);
1111 #define AMPI_Trace_register_function_name(x) traceRegisterFunction(x, -999);
1112 #define AMPI_Trace_begin_function_name(name) traceBeginFuncProj(name, __FILE__, __LINE__);
1113 #define AMPI_Trace_end_function_name(name) traceEndFuncProj(name);
1115 #include "ampiProjections.h"
1116 #ifdef __cplusplus
1118 #endif
1120 #endif
1122 /* MPI 3.1 standards compliance overview
1123 * This overview contains all MPI 3.1 sections and lists all MPI functions not
1124 * supported in AMPI currently.
1127 /* A.2.1 Point-to-Point Communication C Bindings */
1129 int MPI_Improbe(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status);
1130 int MPI_Imrecv(void* buf, int count, MPI_Datatype datatype, MPI_Message *message, MPI_Request *request);
1131 int MPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Status *status);
1132 int MPI_Mrecv(void* buf, int count, MPI_Datatype datatype, MPI_Message *message, MPI_Status *status);
1135 /* A.2.2 Datatypes C Bindings */
1137 int MPI_Pack_external(const char datarep[], const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outsize, MPI_Aint *position);
1138 int MPI_Pack_external_size(const char datarep[], int incount, MPI_Datatype datatype, MPI_Aint *size);
1139 int MPI_Type_create_darray(int size, int rank, int ndims, const int array_of_gsizes[], const int array_of_distribs[], const int array_of_dargs[], const int array_of_psizes[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype); //provided by ROMIO
1140 int MPI_Type_create_subarray(int ndims, const int array_of_sizes[], const int array_of_subsizes[], const int array_of_starts[], int order, MPI_Datatype oldtype, MPI_Datatype *newtype); //provided by ROMIO
1141 int MPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent);
1142 int MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent);
1143 int MPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size);
1144 int MPI_Unpack_external(const char datarep[], const void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype);
1147 /* A.2.3 Collective Communication C Bindings */
1149 int MPI_Iexscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
1150 int MPI_Ireduce_scatter(const void* sendbuf, void* recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
1151 int MPI_Ireduce_scatter_block(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
1152 int MPI_Iscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
1155 /* A.2.4 Groups, Contexts, Communicators, and Caching C Bindings */
1157 int MPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm *newcomm);
1158 int MPI_Comm_idup(MPI_Comm comm, MPI_Comm *newcomm, MPI_Request *request);
1161 /* A.2.5 Process Topologies C Bindings */
1163 int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[], const int degrees[], const int destinations[], const int weights[], MPI_Info info, int reorder, MPI_Comm *comm_dist_graph);
1164 int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old, int indegree, const int sources[], const int sourceweights[], int outdegree, const int destinations[], const int destweights[], MPI_Info info, int reorder, MPI_Comm *comm_dist_graph);
1165 int MPI_Dist_graph_neighbors(MPI_Comm comm, int maxindegree, int sources[], int sourceweights[], int maxoutdegree, int destinations[], int destweights[]);
1166 int MPI_Dist_graph_neighbors_count(MPI_Comm comm, int *indegree, int *outdegree, int *weighted);
1170 /* A.2.6 MPI Environmental Management C Bindings */
1172 int MPI_File_call_errhandler(MPI_File fh, int errorcode);
1173 int MPI_File_create_errhandler(MPI_File_errhandler_function *file_errhandler_fn, MPI_Errhandler *errhandler);
1174 int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler);
1175 int MPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler);
1176 int MPI_Win_call_errhandler(MPI_Win win, int errorcode);
1179 /* A.2.7 The Info Object C Bindings */
1181 /* A.2.8 Process Creation and Management C Bindings */
1183 int MPI_Close_port(const char *port_name);
1184 int MPI_Comm_accept(const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm);
1185 int MPI_Comm_connect(const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm);
1186 int MPI_Comm_disconnect(MPI_Comm *comm);
1187 int MPI_Comm_get_parent(MPI_Comm *parent);
1188 int MPI_Comm_join(int fd, MPI_Comm *intercomm);
1189 int MPI_Comm_spawn(const char *command, char *argv[], int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int array_of_errcodes[]);
1190 int MPI_Comm_spawn_multiple(int count, char *array_of_commands[], char **array_of_argv[], const int array_of_maxprocs[], const MPI_Info array_of_info[], int root, MPI_Comm comm, MPI_Comm *intercomm, int array_of_errcodes[]);
1191 int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name);
1192 int MPI_Open_port(MPI_Info info, char *port_name);
1193 int MPI_Publish_name(const char *service_name, MPI_Info info, const char *port_name);
1194 int MPI_Unpublish_name(const char *service_name, MPI_Info info, const char *port_name);
1197 /* A.2.9 One-Sided Communications C Bindings */
1199 int MPI_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win);
1200 int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *baseptr, MPI_Win *win);
1201 int MPI_Win_attach(MPI_Win win, void *base, MPI_Aint size);
1202 int MPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win);
1203 int MPI_Win_detach(MPI_Win win, const void *base);
1204 int MPI_Win_flush(int rank, MPI_Win win);
1205 int MPI_Win_flush_all(MPI_Win win);
1206 int MPI_Win_flush_local(int rank, MPI_Win win);
1207 int MPI_Win_flush_local_all(MPI_Win win);
1209 int MPI_Win_lock_all(int assert, MPI_Win win);
1210 int MPI_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size, int *disp_unit, void *baseptr);
1211 int MPI_Win_sync(MPI_Win win);
1212 int MPI_Win_unlock_all(MPI_Win win);
1215 /* A.2.10 External Interfaces C Bindings */
1217 int MPI_Grequest_complete(MPI_Request request);
1218 int MPI_Grequest_start(MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request);
1219 int MPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Count count);
1222 /* A.2.11 I/O C Bindings */
1224 int MPI_CONVERSION_FN_NULL(void *userbuf, MPI_Datatype datatype, int count, void *filebuf, MPI_Offset position, void *extra_state);
1225 int MPI_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request);
1226 int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request);
1227 int MPI_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request);
1228 int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request);
1229 int MPI_Register_datarep(const char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state);
1232 /* A.2.12 Language Bindings C Bindings */
1234 int MPI_Status_f082f(MPI_F08_status *f08_status, MPI_Fint *f_status);
1235 int MPI_Status_f2f08(MPI_Fint *f_status, MPI_F08_status *f08_status);
1236 int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype);
1237 int MPI_Type_create_f90_integer(int r, MPI_Datatype *newtype);
1238 int MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype);
1239 int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *datatype);
1240 MPI_Fint MPI_Message_c2f(MPI_Message message);
1241 MPI_Message MPI_Message_f2c(MPI_Fint message);
1242 int MPI_Status_c2f(const MPI_Status *c_status, MPI_Fint *f_status);
1243 int MPI_Status_c2f08(const MPI_Status *c_status, MPI_F08_status *f08_status);
1244 int MPI_Status_f082c(const MPI_F08_status *f08_status, MPI_Status *c_status);
1245 int MPI_Status_f2c(const MPI_Fint *f_status, MPI_Status *c_status);
1248 /* A.2.13 Tools / Profiling Interface C Bindings */
1249 /* NB: PMPI is not yet supported */
1251 /* A.2.14 Tools / MPI Tool Information Interface C Bindings */
1253 int MPI_T_category_changed(int *stamp);
1254 int MPI_T_category_get_categories(int cat_index, int len, int indices[]);
1255 int MPI_T_category_get_cvars(int cat_index, int len, int indices[]);
1256 int MPI_T_category_get_index(const char *name, int *cat_index);
1257 int MPI_T_category_get_info(int cat_index, char *name, int *name_len, char *desc, int *desc_len, int *num_cvars, int *num_pvars, int *num_categories);
1258 int MPI_T_category_get_num(int *num_cat);
1259 int MPI_T_category_get_pvars(int cat_index, int len, int indices[]);
1260 int MPI_T_cvar_get_index(const char *name, int *cvar_index);
1261 int MPI_T_cvar_get_info(int cvar_index, char *name, int *name_len, int *verbosity, MPI_Datatype *datatype, MPI_T_enum *enumtype, char *desc, int *desc_len, int *bind, int *scope);
1262 int MPI_T_cvar_get_num(int *num_cvar);
1263 int MPI_T_cvar_handle_alloc(int cvar_index, void *obj_handle, MPI_T_cvar_handle *handle, int *count);
1264 int MPI_T_cvar_handle_free(MPI_T_cvar_handle *handle);
1265 int MPI_T_cvar_read(MPI_T_cvar_handle handle, void* buf);
1266 int MPI_T_cvar_write(MPI_T_cvar_handle handle, const void* buf);
1267 int MPI_T_enum_get_info(MPI_T_enum enumtype, int *num, char *name, int *name_len);
1268 int MPI_T_enum_get_item(MPI_T_enum enumtype, int index, int *value, char *name, int *name_len);
1269 int MPI_T_finalize(void);
1270 int MPI_T_init_thread(int required, int *provided);
1271 int MPI_T_pvar_get_index(const char *name, int var_class, int *pvar_index);
1272 int MPI_T_pvar_get_info(int pvar_index, char *name, int *name_len, int *verbosity, int *var_class, MPI_Datatype *datatype, MPI_T_enum *enumtype, char *desc, int *desc_len, int *bind, int *readonly, int *continuous, int *atomic);
1273 int MPI_T_pvar_get_num(int *num_pvar);
1274 int MPI_T_pvar_handle_alloc(MPI_T_pvar_session session, int pvar_index, void *obj_handle, MPI_T_pvar_handle *handle, int *count);
1275 int MPI_T_pvar_handle_free(MPI_T_pvar_session session,MPI_T_pvar_handle *handle);
1276 int MPI_T_pvar_read(MPI_T_pvar_session session, MPI_T_pvar_handle handle,void* buf);
1277 int MPI_T_pvar_readreset(MPI_T_pvar_session session,MPI_T_pvar_handle handle, void* buf);
1278 int MPI_T_pvar_reset(MPI_T_pvar_session session, MPI_T_pvar_handle handle);
1279 int MPI_T_pvar_session_create(MPI_T_pvar_session *session);
1280 int MPI_T_pvar_session_free(MPI_T_pvar_session *session);
1281 int MPI_T_pvar_start(MPI_T_pvar_session session, MPI_T_pvar_handle handle);
1282 int MPI_T_pvar_stop(MPI_T_pvar_session session, MPI_T_pvar_handle handle);
1283 int MPI_T_pvar_write(MPI_T_pvar_session session, MPI_T_pvar_handle handle, const void* buf);
1286 /* A.2.15 Deprecated C Bindings */