00001 #ifndef _MPI_H
00002 #define _MPI_H
00003
00004 #include "conv-config.h"
00005
00006
00007
00008 #define AMPI
00009
00010
00011
00012
00013
00014
00015 #ifdef __cplusplus
00016 # define main AMPI_Main_cpp
00017 int AMPI_Main_cpp(int argc,char **argv);
00018
00019 extern "C" {
00020 #else
00021 # define main AMPI_Main
00022 #endif
00023
00024 int AMPI_Main(int argc,char **argv);
00025
00026 typedef int MPI_Datatype;
00027 typedef int MPI_Aint;
00028 typedef int MPI_Fint;
00029
00030
00031
00032 #define MPI_SUCCESS 0
00033 #define MPI_ERR_BUFFER 1
00034 #define MPI_ERR_COUNT 2
00035 #define MPI_ERR_TYPE 3
00036 #define MPI_ERR_TAG 4
00037 #define MPI_ERR_COMM 5
00038 #define MPI_ERR_RANK 6
00039 #define MPI_ERR_REQUEST 7
00040 #define MPI_ERR_ROOT 8
00041 #define MPI_ERR_GROUP 9
00042 #define MPI_ERR_OP 10
00043 #define MPI_ERR_TOPOLOGY 11
00044 #define MPI_ERR_DIMS 12
00045 #define MPI_ERR_ARG 13
00046 #define MPI_ERR_UNKNOWN 14
00047 #define MPI_ERR_TRUNCATE 15
00048 #define MPI_ERR_OTHER 16
00049 #define MPI_ERR_INTERN 17
00050 #define MPI_ERR_IN_STATUS 18
00051 #define MPI_ERR_PENDING 19
00052
00053 #define MPI_ERR_ACCESS 20
00054 #define MPI_ERR_AMODE 21
00055 #define MPI_ERR_ASSERT 22
00056 #define MPI_ERR_BAD_FILE 23
00057 #define MPI_ERR_BASE 24
00058 #define MPI_ERR_CONVERSION 25
00059 #define MPI_ERR_DISP 26
00060 #define MPI_ERR_DUP_DATAREP 27
00061 #define MPI_ERR_FILE_EXISTS 28
00062 #define MPI_ERR_FILE_IN_USE 29
00063 #define MPI_ERR_FILE 30
00064 #define MPI_ERR_INFO_KEY 31
00065 #define MPI_ERR_INFO_NOKEY 32
00066 #define MPI_ERR_INFO_VALUE 33
00067 #define MPI_ERR_INFO 34
00068 #define MPI_ERR_IO 35
00069 #define MPI_ERR_KEYVAL 36
00070 #define MPI_ERR_LOCKTYPE 37
00071 #define MPI_ERR_NAME 38
00072 #define MPI_ERR_NO_MEM 39
00073 #define MPI_ERR_NOT_SAME 40
00074 #define MPI_ERR_NO_SPACE 41
00075 #define MPI_ERR_NO_SUCH_FILE 42
00076 #define MPI_ERR_PORT 43
00077 #define MPI_ERR_QUOTA 44
00078 #define MPI_ERR_READ_ONLY 45
00079 #define MPI_ERR_RMA_CONFLICT 46
00080 #define MPI_ERR_RMA_SYNC 47
00081 #define MPI_ERR_SERVICE 48
00082 #define MPI_ERR_SIZE 49
00083 #define MPI_ERR_SPAWN 50
00084 #define MPI_ERR_UNSUPPORTED_DATAREP 51
00085 #define MPI_ERR_UNSUPPORTED_OPERATION 52
00086 #define MPI_ERR_WIN 53
00087 #define MPI_ERR_LASTCODE 53
00088
00089
00090 #define MPI_MAX_PROCESSOR_NAME 256
00091 #define MPI_MAX_ERROR_STRING 256
00092
00093
00094
00095 #define MPI_DATATYPE_NULL -1
00096 #define MPI_DOUBLE 0
00097 #define MPI_INT 1
00098 #define MPI_FLOAT 2
00099 #define MPI_COMPLEX 3
00100 #define MPI_LOGICAL 4
00101 #define MPI_CHAR 5
00102 #define MPI_BYTE 6
00103 #define MPI_PACKED 7
00104 #define MPI_SHORT 8
00105 #define MPI_LONG 9
00106 #define MPI_UNSIGNED_CHAR 10
00107 #define MPI_UNSIGNED_SHORT 11
00108 #define MPI_UNSIGNED 12
00109 #define MPI_UNSIGNED_LONG 13
00110 #define MPI_LONG_DOUBLE 14
00111
00112 #define MPI_FLOAT_INT 15
00113 #define MPI_DOUBLE_INT 16
00114 #define MPI_LONG_INT 17
00115 #define MPI_2INT 18
00116 #define MPI_SHORT_INT 19
00117 #define MPI_LONG_DOUBLE_INT 20
00118 #define MPI_2FLOAT 21
00119 #define MPI_2DOUBLE 22
00120
00121 #define MPI_LB 23
00122 #define MPI_UB 24
00123 #define MPI_LONG_LONG_INT 25
00124 #define MPI_LONG_LONG MPI_LONG_LONG_INT
00125 #define MPI_DOUBLE_COMPLEX 26
00126
00127 #define MPI_ANY_TAG (-1)
00128 #define MPI_REQUEST_NULL (-1)
00129 #define MPI_GROUP_NULL (-1)
00130 #define MPI_GROUP_EMPTY 0
00131 #define MPI_COMM_NULL (-1)
00132 #define MPI_TYPE_NULL (-1)
00133 #define MPI_PROC_NULL (-2)
00134 #define MPI_ANY_SOURCE (-1)
00135 #define MPI_KEYVAL_INVALID (-1)
00136 #define MPI_INFO_NULL (-1)
00137
00138 #define MPI_IN_PLACE ((void *) -1L)
00139
00140 #define MPI_BOTTOM 0
00141 #define MPI_UNDEFINED (-32766)
00142
00143 #define MPI_IDENT 0
00144 #define MPI_SIMILAR 1
00145 #define MPI_CONGRUENT 2
00146 #define MPI_UNEQUAL 3
00147
00148 #define MPI_OP_NULL (MPI_Op)NULL
00149 void MPI_MAX ( void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
00150 void MPI_MIN ( void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
00151 void MPI_SUM ( void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
00152 void MPI_PROD ( void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
00153 void MPI_LAND ( void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
00154 void MPI_BAND ( void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
00155 void MPI_LOR ( void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
00156 void MPI_BOR ( void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
00157 void MPI_LXOR ( void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
00158 void MPI_BXOR ( void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
00159 void MPI_MAXLOC ( void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
00160 void MPI_MINLOC ( void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
00161
00162 #define MPI_GRAPH 1
00163 #define MPI_CART 2
00164
00165
00166
00167
00168
00169 #define MPI_TAG_UB_VALUE 1073741824
00170
00174 #define MPI_TAG_UB -10
00175 #define MPI_HOST -11
00176 #define MPI_IO -12
00177 #define MPI_WTIME_IS_GLOBAL -13
00178
00181 #define AMPI_KEYVAL_MYPE -14
00182 #define AMPI_KEYVAL_NUMPES -15
00183 #define AMPI_KEYVAL_MYNODE -16
00184 #define AMPI_KEYVAL_NUMNODES -17
00185
00186
00190 typedef int MPI_Comm;
00191
00193 typedef int MPI_Group;
00194
00195 #define MPI_COMM_FIRST_SPLIT (MPI_Comm)(1000000)
00196 #define MPI_COMM_FIRST_GROUP (MPI_Comm)(2000000)
00197 #define MPI_COMM_FIRST_CART (MPI_Comm)(3000000)
00198 #define MPI_COMM_FIRST_GRAPH (MPI_Comm)(4000000)
00199 #define MPI_COMM_FIRST_INTER (MPI_Comm)(5000000)
00200 #define MPI_COMM_FIRST_INTRA (MPI_Comm)(6000000)
00201 #define MPI_COMM_FIRST_RESVD (MPI_Comm)(7000000)
00202 #define MPI_COMM_SELF (MPI_Comm)(8000000)
00203 #define MPI_COMM_WORLD (MPI_Comm)(9000000)
00204 #define MPI_MAX_COMM_WORLDS 8
00205 extern MPI_Comm MPI_COMM_UNIVERSE[MPI_MAX_COMM_WORLDS];
00206
00207
00208 struct AmpiMsg;
00209 typedef int MPI_Request;
00210 typedef struct {
00211 int MPI_TAG, MPI_SOURCE, MPI_COMM, MPI_LENGTH, MPI_ERROR;
00212 struct AmpiMsg *msg;
00213 } MPI_Status;
00214
00215 #define stsempty(sts) (sts).MPI_TAG=(sts).MPI_SOURCE=(sts).MPI_COMM=(sts).MPI_LENGTH=0
00216 #define MPI_STATUS_IGNORE (MPI_Status *)0
00217
00218 typedef int MPI_Errhandler;
00219 #define MPI_ERRHANDLER_NULL 0
00220 #define MPI_ERRORS_RETURN 1
00221 #define MPI_ERRORS_ARE_FATAL 2
00222
00223 typedef void (MPI_Handler_function)(MPI_Comm *, int *, ...);
00224 typedef int (MPI_Copy_function)(MPI_Comm oldcomm, int keyval,
00225 void *extra_state, void *attribute_val_in,
00226 void *attribute_val_out, int *flag);
00227 typedef int (MPI_Delete_function)(MPI_Comm comm, int keyval,
00228 void *attribute_val, void *extra_state);
00229 typedef void (MPI_User_function) (void *invec, void *inoutvec,
00230 int *len, MPI_Datatype *datatype);
00231 typedef void (*MPI_Op) (void *invec, void *inoutvec,
00232 int *len, MPI_Datatype *datatype);
00233
00234 #define MPI_NULL_COPY_FN MPI_null_copy_fn
00235 #define MPI_NULL_DELETE_FN MPI_null_delete_fn
00236 #define MPI_DUP_FN MPI_dup_fn
00237 int MPI_NULL_COPY_FN ( MPI_Comm, int, void *, void *, void *, int * );
00238 int MPI_NULL_DELETE_FN ( MPI_Comm, int, void *, void * );
00239 int MPI_DUP_FN ( MPI_Comm, int, void *, void *, void *, int * );
00240
00241 #include "pup_c.h"
00242
00243 typedef void (*MPI_PupFn)(pup_er, void*);
00244
00245
00246
00247
00248 #define MPI_COMBINER_NAMED 1
00249 #define MPI_COMBINER_CONTIGUOUS 2
00250 #define MPI_COMBINER_VECTOR 3
00251 #define MPI_COMBINER_HVECTOR 4
00252 #define MPI_COMBINER_INDEXED 5
00253 #define MPI_COMBINER_HINDEXED 6
00254 #define MPI_COMBINER_STRUCT 7
00255
00256
00257
00258 #define MPI_BSEND_OVERHEAD 0
00259 #define MPI_Send AMPI_Send
00260 int AMPI_Send(void *msg, int count, MPI_Datatype type, int dest,
00261 int tag, MPI_Comm comm);
00262 #define MPI_Ssend AMPI_Ssend
00263 int AMPI_Ssend(void *msg, int count, MPI_Datatype type, int dest,
00264 int tag, MPI_Comm comm);
00265 #define MPI_Recv AMPI_Recv
00266 int AMPI_Recv(void *msg, int count, int type, int src, int tag,
00267 MPI_Comm comm, MPI_Status *status);
00268 #define MPI_Get_count AMPI_Get_count
00269 int AMPI_Get_count(MPI_Status *sts, MPI_Datatype dtype, int *count);
00270 #define AMPI_Bsend AMPI_Send
00271 #define AMPI_Rsend AMPI_Send
00272 #define MPI_Bsend AMPI_Bsend
00273 #define MPI_Rsend AMPI_Rsend
00274 #define MPI_Buffer_attach(buf,len)
00275 #define MPI_Buffer_detach(buf,len)
00276 #define MPI_Isend AMPI_Isend
00277 int AMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dest,
00278 int tag, MPI_Comm comm, MPI_Request *request);
00279 #define MPI_Ibsend AMPI_Isend
00280 #define MPI_Issend AMPI_Issend
00281 int AMPI_Issend(void *buf, int count, MPI_Datatype datatype, int dest,
00282 int tag, MPI_Comm comm, MPI_Request *request);
00283 #define MPI_Irsend AMPI_Isend
00284 #define MPI_Irecv AMPI_Irecv
00285 int AMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src,
00286 int tag, MPI_Comm comm, MPI_Request *request);
00287 #define MPI_Wait AMPI_Wait
00288 int AMPI_Wait(MPI_Request *request, MPI_Status *sts);
00289 #define MPI_Test AMPI_Test
00290 int AMPI_Test(MPI_Request *request, int *flag, MPI_Status *sts);
00291 #define MPI_Waitany AMPI_Waitany
00292 int AMPI_Waitany(int count, MPI_Request *request, int *index, MPI_Status *sts);
00293 #define MPI_Testany AMPI_Testany
00294 int AMPI_Testany(int count, MPI_Request *request, int *index, int *flag, MPI_Status *status);
00295 #define MPI_Waitall AMPI_Waitall
00296 int AMPI_Waitall(int count, MPI_Request *request, MPI_Status *sts);
00297 #define MPI_Testall AMPI_Testall
00298 int AMPI_Testall(int count, MPI_Request *request, int *flag, MPI_Status *sts);
00299 #define MPI_Waitsome AMPI_Waitsome
00300 int AMPI_Waitsome(int incount, MPI_Request *array_of_requests, int *outcount,
00301 int *array_of_indices, MPI_Status *array_of_statuses);
00302 #define MPI_Testsome AMPI_Testsome
00303 int AMPI_Testsome(int incount, MPI_Request *array_of_requests, int *outcount,
00304 int *array_of_indices, MPI_Status *array_of_statuses);
00305 #define MPI_Request_free AMPI_Request_free
00306 int AMPI_Request_free(MPI_Request *request);
00307 #define MPI_Cancel AMPI_Cancel
00308 int AMPI_Cancel(MPI_Request *request);
00309 #define MPI_Test_cancelled AMPI_Test_cancelled
00310 int AMPI_Test_cancelled(MPI_Status *status, int *flag);
00311 #define MPI_Iprobe AMPI_Iprobe
00312 int AMPI_Iprobe(int src, int tag, MPI_Comm comm, int *flag, MPI_Status *sts);
00313 #define MPI_Probe AMPI_Probe
00314 int AMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *sts);
00315 #define MPI_Send_init AMPI_Send_init
00316 int AMPI_Send_init(void *buf, int count, int type, int dest, int tag,
00317 MPI_Comm comm, MPI_Request *req);
00318 #define MPI_Ssend_init AMPI_Ssend_init
00319 int AMPI_Ssend_init(void *buf, int count, int type, int dest, int tag,
00320 MPI_Comm comm, MPI_Request *req);
00321 #define MPI_Bsend_init AMPI_Send_init
00322 #define MPI_Rsend_init AMPI_Send_init
00323 #define MPI_Recv_init AMPI_Recv_init
00324 int AMPI_Recv_init(void *buf, int count, int type, int src, int tag,
00325 MPI_Comm comm, MPI_Request *req);
00326 #define MPI_Start AMPI_Start
00327 int AMPI_Start(MPI_Request *reqnum);
00328 #define MPI_Startall AMPI_Startall
00329 int AMPI_Startall(int count, MPI_Request *array_of_requests);
00330 #define MPI_Sendrecv AMPI_Sendrecv
00331 int AMPI_Sendrecv(void *sbuf, int scount, int stype, int dest,
00332 int stag, void *rbuf, int rcount, int rtype,
00333 int src, int rtag, MPI_Comm comm, MPI_Status *sts);
00334 #define MPI_Sendrecv_replace AMPI_Sendrecv_replace
00335 int AMPI_Sendrecv_replace(void* buf, int count, MPI_Datatype datatype,
00336 int dest, int sendtag, int source, int recvtag,
00337 MPI_Comm comm, MPI_Status *status);
00338 #define MPI_Type_contiguous AMPI_Type_contiguous
00339 int AMPI_Type_contiguous(int count, MPI_Datatype oldtype,
00340 MPI_Datatype *newtype);
00341 #define MPI_Type_vector AMPI_Type_vector
00342 int AMPI_Type_vector(int count, int blocklength, int stride,
00343 MPI_Datatype oldtype, MPI_Datatype *newtype);
00344 #define MPI_Type_hvector AMPI_Type_hvector
00345 int AMPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
00346 MPI_Datatype oldtype, MPI_Datatype *newtype);
00347 #define MPI_Type_indexed AMPI_Type_indexed
00348 int AMPI_Type_indexed(int count, int* arrBlength, int* arrDisp,
00349 MPI_Datatype oldtype, MPI_Datatype *newtype);
00350 #define MPI_Type_hindexed AMPI_Type_hindexed
00351 int AMPI_Type_hindexed(int count, int* arrBlength, MPI_Aint* arrDisp,
00352 MPI_Datatype oldtype, MPI_Datatype *newtype);
00353 #define MPI_Type_struct AMPI_Type_struct
00354
00355 int AMPI_Type_struct(int count, int* arrBLength, MPI_Aint* arrDisp,
00356 MPI_Datatype *oldType, MPI_Datatype *newType);
00357 #define MPI_Type_commit AMPI_Type_commit
00358 int AMPI_Type_commit(MPI_Datatype *datatype);
00359 #define MPI_Type_free AMPI_Type_free
00360 int AMPI_Type_free(MPI_Datatype *datatype);
00361 #define MPI_Type_extent AMPI_Type_extent
00362 int AMPI_Type_extent(MPI_Datatype datatype, MPI_Aint *extent);
00363 #define MPI_Type_size AMPI_Type_size
00364 int AMPI_Type_size(MPI_Datatype datatype, int *size);
00365 #define MPI_Type_lb AMPI_Type_lb
00366 int AMPI_Type_lb(MPI_Datatype datatype, MPI_Aint* displacement);
00367 #define MPI_Type_ub AMPI_Type_ub
00368 int AMPI_Type_ub(MPI_Datatype datatype, MPI_Aint* displacement);
00369 #define MPI_Address AMPI_Address
00370 int AMPI_Address(void* location, MPI_Aint *address);
00371 #define MPI_Get_elements AMPI_Get_elements
00372 int AMPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, int *count);
00373 #define MPI_Pack AMPI_Pack
00374 int AMPI_Pack(void *inbuf, int incount, MPI_Datatype dtype, void *outbuf,
00375 int outsize, int *position, MPI_Comm comm);
00376 #define MPI_Unpack AMPI_Unpack
00377 int AMPI_Unpack(void *inbuf, int insize, int *position, void *outbuf,
00378 int outcount, MPI_Datatype dtype, MPI_Comm comm);
00379 #define MPI_Pack_size AMPI_Pack_size
00380 int AMPI_Pack_size(int incount,MPI_Datatype datatype,MPI_Comm comm,int *sz);
00381
00382
00383 #define MPI_Barrier AMPI_Barrier
00384 int AMPI_Barrier(MPI_Comm comm);
00385 #define MPI_Bcast AMPI_Bcast
00386 int AMPI_Bcast(void *buf, int count, int type, int root, MPI_Comm comm);
00387 #define MPI_Gather AMPI_Gather
00388 int AMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
00389 void *recvbuf, int recvcount, MPI_Datatype recvtype,
00390 int root, MPI_Comm comm);
00391 #define MPI_Gatherv AMPI_Gatherv
00392 int AMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
00393 void *recvbuf, int *recvcounts, int *displs,
00394 MPI_Datatype recvtype, int root, MPI_Comm comm);
00395 #define MPI_Scatter AMPI_Scatter
00396 int AMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
00397 void *recvbuf, int recvcount, MPI_Datatype recvtype,
00398 int root, MPI_Comm comm);
00399 #define MPI_Scatterv AMPI_Scatterv
00400 int AMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype,
00401 void *recvbuf, int recvcount, MPI_Datatype recvtype,
00402 int root, MPI_Comm comm);
00403 #define MPI_Allgather AMPI_Allgather
00404 int AMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
00405 void *recvbuf, int recvcount, MPI_Datatype recvtype,
00406 MPI_Comm comm);
00407 #define MPI_Iallgather AMPI_Iallgather
00408 int AMPI_Iallgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
00409 void *recvbuf, int recvcount, MPI_Datatype recvtype,
00410 MPI_Comm comm, MPI_Request* request);
00411 #define MPI_Allgatherv AMPI_Allgatherv
00412 int AMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
00413 void *recvbuf, int *recvcounts, int *displs,
00414 MPI_Datatype recvtype, MPI_Comm comm) ;
00415 #define MPI_Alltoall AMPI_Alltoall
00416 int AMPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
00417 void *recvbuf, int recvcount, MPI_Datatype recvtype,
00418 MPI_Comm comm);
00419 #define MPI_Alltoall2 AMPI_Alltoall2
00420 int AMPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
00421 void *recvbuf, int recvcount, MPI_Datatype recvtype,
00422 MPI_Comm comm);
00423 #define MPI_Alltoallv AMPI_Alltoallv
00424 int AMPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls,
00425 MPI_Datatype sendtype, void *recvbuf, int *recvcounts,
00426 int *rdispls, MPI_Datatype recvtype, MPI_Comm comm);
00427 #define MPI_Alltoall_long MPICH_AlltoAll_long
00428 int MPICH_AlltoAll_long(void *sendbuf, int sendcount, MPI_Datatype sendtype,
00429 void *recvbuf, int recvcount, MPI_Datatype recvtype,
00430 MPI_Comm comm);
00431 #define MPI_Alltoall_medium MPICH_AlltoAll_medium
00432 int MPICH_AlltoAll_medium(void *sendbuf, int sendcount, MPI_Datatype sendtype,
00433 void *recvbuf, int recvcount, MPI_Datatype recvtype,
00434 MPI_Comm comm);
00435 #define MPI_Ialltoall AMPI_Ialltoall
00436 int AMPI_Ialltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
00437 void *recvbuf, int recvcount, MPI_Datatype recvtype,
00438 MPI_Comm comm, MPI_Request *request);
00439 #define MPI_Reduce AMPI_Reduce
00440 int AMPI_Reduce(void *inbuf, void *outbuf, int count, int type,
00441 MPI_Op op, int root, MPI_Comm comm);
00442 #define MPI_Ireduce AMPI_Ireduce
00443 int AMPI_Ireduce(void *sendbuf, void *recvbuf, int count, int type,
00444 MPI_Op op, int root, MPI_Comm comm, MPI_Request *request);
00445 #define MPI_Allreduce AMPI_Allreduce
00446 int AMPI_Allreduce(void *inbuf, void *outbuf, int count, int type,
00447 MPI_Op op, MPI_Comm comm);
00448 #define MPI_Iallreduce AMPI_Iallreduce
00449 int AMPI_Iallreduce(void *inbuf, void *outbuf, int count, int type,
00450 MPI_Op op, MPI_Comm comm, MPI_Request *request);
00451 #define MPI_Reduce_scatter AMPI_Reduce_scatter
00452 int AMPI_Reduce_scatter(void* sendbuf, void* recvbuf, int *recvcounts,
00453 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
00454 #define MPI_Scan AMPI_Scan
00455 int AMPI_Scan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
00456 MPI_Op op, MPI_Comm comm );
00457 #define MPI_Op_create AMPI_Op_create
00458 int AMPI_Op_create(MPI_User_function *function, int commute, MPI_Op *op);
00459 #define MPI_Op_free AMPI_Op_free
00460 int AMPI_Op_free(MPI_Op *op);
00461
00462
00463 #define MPI_Group_size AMPI_Group_size
00464 int AMPI_Group_size(MPI_Group group, int *size);
00465 #define MPI_Group_rank AMPI_Group_rank
00466 int AMPI_Group_rank(MPI_Group group, int *rank);
00467 #define MPI_Group_translate_ranks AMPI_Group_translate_ranks
00468 int AMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1, MPI_Group group2, int *ranks2);
00469 #define MPI_Group_compare AMPI_Group_compare
00470 int AMPI_Group_compare(MPI_Group group1,MPI_Group group2, int *result);
00471
00472 #define MPI_Comm_group AMPI_Comm_group
00473 int AMPI_Comm_group(MPI_Comm comm, MPI_Group *group);
00474 #define MPI_Group_union AMPI_Group_union
00475 int AMPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup);
00476 #define MPI_Group_intersection AMPI_Group_intersection
00477 int AMPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup);
00478 #define MPI_Group_difference AMPI_Group_difference
00479 int AMPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group *newgroup);
00480 #define MPI_Group_incl AMPI_Group_incl
00481 int AMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup);
00482 #define MPI_Group_excl AMPI_Group_excl
00483 int AMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup);
00484 #define MPI_Group_range_incl AMPI_Group_range_incl
00485 int AMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup);
00486 #define MPI_Group_range_excl AMPI_Group_range_excl
00487 int AMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], MPI_Group *newgroup);
00488 #define MPI_Group_free AMPI_Group_free
00489 int AMPI_Group_free(MPI_Group *group);
00490 #define MPI_Comm_create AMPI_Comm_create
00491 int AMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm* newcomm);
00492
00493 #define MPI_Comm_size AMPI_Comm_size
00494 int AMPI_Comm_size(MPI_Comm comm, int *size);
00495 #define MPI_Comm_rank AMPI_Comm_rank
00496 int AMPI_Comm_rank(MPI_Comm comm, int *rank);
00497 #define MPI_Comm_compare AMPI_Comm_compare
00498 int AMPI_Comm_compare(MPI_Comm comm1,MPI_Comm comm2, int *result);
00499 #define MPI_Comm_split AMPI_Comm_split
00500 int AMPI_Comm_split(MPI_Comm src, int color, int key, MPI_Comm *dest);
00501 #define MPI_Comm_dup AMPI_Comm_dup
00502 int AMPI_Comm_dup(MPI_Comm src, MPI_Comm *dest);
00503 #define MPI_Comm_free AMPI_Comm_free
00504 int AMPI_Comm_free(MPI_Comm *comm);
00505 #define MPI_Comm_test_inter AMPI_Comm_test_inter
00506 int AMPI_Comm_test_inter(MPI_Comm comm, int *flag);
00507 #define MPI_Comm_remote_size AMPI_Comm_remote_size
00508 int AMPI_Comm_remote_size(MPI_Comm comm, int *size);
00509 #define MPI_Comm_remote_group AMPI_Comm_remote_group
00510 int AMPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group);
00511 #define MPI_Intercomm_create AMPI_Intercomm_create
00512 int AMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm,
00513 int remote_leader, int tag, MPI_Comm *newintercomm);
00514 #define MPI_Intercomm_merge AMPI_Intercomm_merge
00515 int AMPI_Intercomm_merge(MPI_Comm intercomm, int high, MPI_Comm *newintracomm);
00516 #define MPI_Keyval_create AMPI_Keyval_create
00517 int AMPI_Keyval_create(MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn,
00518 int *keyval, void* extra_state);
00519 #define MPI_Keyval_free AMPI_Keyval_free
00520 int AMPI_Keyval_free(int *keyval);
00521 #define MPI_Attr_put AMPI_Attr_put
00522 int AMPI_Attr_put(MPI_Comm comm, int keyval, void* attribute_val);
00523 #define MPI_Attr_get AMPI_Attr_get
00524 int AMPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag);
00525 #define MPI_Attr_delete AMPI_Attr_delete
00526 int AMPI_Attr_delete(MPI_Comm comm, int keyval);
00527
00528
00529 #define MPI_Cart_create AMPI_Cart_create
00530 int AMPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods,
00531 int reorder, MPI_Comm *comm_cart);
00532 #define MPI_Graph_create AMPI_Graph_create
00533 int AMPI_Graph_create(MPI_Comm comm_old, int nnodes, int *index, int *edges,
00534 int reorder, MPI_Comm *comm_graph);
00535 #define MPI_Topo_test AMPI_Topo_test
00536 int AMPI_Topo_test(MPI_Comm comm, int *status);
00537 #define MPI_Cart_map AMPI_Cart_map
00538 int AMPI_Cart_map(MPI_Comm comm, int ndims, int *dims, int *periods, int *newrank);
00539 #define MPI_Graph_map AMPI_Graph_map
00540 int AMPI_Graph_map(MPI_Comm comm, int nnodes, int *index, int *edges, int *newrank);
00541 #define MPI_Cartdim_get AMPI_Cartdim_get
00542 int AMPI_Cartdim_get(MPI_Comm comm, int *ndims);
00543 #define MPI_Cart_get AMPI_Cart_get
00544 int AMPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords);
00545 #define MPI_Cart_rank AMPI_Cart_rank
00546 int AMPI_Cart_rank(MPI_Comm comm, int *coords, int *rank);
00547 #define MPI_Cart_coords AMPI_Cart_coords
00548 int AMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords);
00549 #define MPI_Cart_shift AMPI_Cart_shift
00550 int AMPI_Cart_shift(MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest);
00551 #define MPI_Graphdims_get AMPI_Graphdims_get
00552 int AMPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges);
00553 #define MPI_Graph_get AMPI_Graph_get
00554 int AMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int *index, int *edges);
00555 #define MPI_Graph_neighbors_count AMPI_Graph_neighbors_count
00556 int AMPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors);
00557 #define MPI_Graph_neighbors AMPI_Graph_neighbors
00558 int AMPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int *neighbors);
00559 #define MPI_Dims_create AMPI_Dims_create
00560 int AMPI_Dims_create(int nnodes, int ndims, int *dims);
00561 #define MPI_Cart_sub AMPI_Cart_sub
00562 int AMPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *newcomm);
00563
00564
00565 #define MPI_Get_processor_name AMPI_Get_processor_name
00566 int AMPI_Get_processor_name(char *name, int *resultlen);
00567 #define MPI_Errhandler_create AMPI_Errhandler_create
00568 int AMPI_Errhandler_create(MPI_Handler_function *function, MPI_Errhandler *errhandler);
00569 #define MPI_Errhandler_set AMPI_Errhandler_set
00570 int AMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler);
00571 #define MPI_Errhandler_get AMPI_Errhandler_get
00572 int AMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler);
00573 #define MPI_Errhandler_free AMPI_Errhandler_free
00574 int AMPI_Errhandler_free(MPI_Errhandler *errhandler);
00575 #define MPI_Error_string AMPI_Error_string
00576 int AMPI_Error_string(int errorcode, char *string, int *resultlen);
00577 #define MPI_Error_class AMPI_Error_class
00578 int AMPI_Error_class(int errorcode, int *errorclass);
00579 #define MPI_Wtime AMPI_Wtime
00580 double AMPI_Wtime(void);
00581 #define MPI_Wtick AMPI_Wtick
00582 double AMPI_Wtick(void);
00583 #define MPI_Init AMPI_Init
00584 int AMPI_Init(int *argc, char*** argv);
00585 #define MPI_Initialized AMPI_Initialized
00586 int AMPI_Initialized(int *isInit);
00587 #define MPI_Finalize AMPI_Finalize
00588 int AMPI_Finalize(void);
00589 #define MPI_Finalized AMPI_Finalized
00590 int AMPI_Finalized(int *);
00591 #define MPI_Abort AMPI_Abort
00592 int AMPI_Abort(MPI_Comm comm, int errorcode);
00593
00594
00595
00596
00597
00598 #define MPI_Yield AMPI_Yield
00599 int AMPI_Yield(int comm);
00600 #define MPI_Resume AMPI_Resume
00601 int AMPI_Resume(int dest, int comm);
00602 #define MPI_Print AMPI_Print
00603 void AMPI_Print(char *str);
00604
00605
00606 #define MPI_Register AMPI_Register
00607 int AMPI_Register(void *, MPI_PupFn);
00608
00609 #define MPI_Start_measure AMPI_Start_measure
00610 void AMPI_Start_measure();
00611 #define MPI_Stop_measure AMPI_Stop_measure
00612 void AMPI_Stop_measure();
00613 #define MPI_Set_load AMPI_Set_load
00614 void AMPI_Set_load(double load);
00615
00616 #define MPI_Migrate AMPI_Migrate
00617 void AMPI_Migrate(void);
00618
00619 #define MPI_Evacuate AMPI_Evacuate
00620 void AMPI_Evacuate(void);
00621
00622 #define MPI_Migrateto AMPI_Migrateto
00623 void AMPI_Migrateto(int destPE);
00624
00625 #define MPI_Async_Migrate AMPI_Async_Migrate
00626 void AMPI_Async_Migrate(void);
00627 #define MPI_Allow_Migrate AMPI_Allow_Migrate
00628 void AMPI_Allow_Migrate(void);
00629 #define MPI_Setmigratable AMPI_Setmigratable
00630 void AMPI_Setmigratable(int comm, int mig);
00631 #define MPI_Checkpoint AMPI_Checkpoint
00632 void AMPI_Checkpoint(char *dname);
00633 #define MPI_MemCheckpoint AMPI_MemCheckpoint
00634 void AMPI_MemCheckpoint();
00635 #define MPI_Get_userdata AMPI_Get_userdata
00636 void *AMPI_Get_userdata(int);
00637 #define MPI_Datatype_iscontig AMPI_Datatype_iscontig
00638 void AMPI_Datatype_iscontig(MPI_Datatype datatype, int *flag);
00639
00640 typedef void (*MPI_MainFn) (int,char**);
00641 #define MPI_Register_main AMPI_Register_main
00642 void AMPI_Register_main(MPI_MainFn mainFn, const char *name);
00643
00644 int AMPI_System(const char *cmd);
00645
00646
00647 #define MPI_Type_get_envelope AMPI_Type_get_envelope
00648 int AMPI_Type_get_envelope(MPI_Datatype datatype, int *num_integers, int *num_addresses,
00649 int *num_datatypes, int *combiner);
00650 #define MPI_Type_get_contents AMPI_Type_get_contents
00651 int AMPI_Type_get_contents(MPI_Datatype datatype, int max_integers, int max_addresses,
00652 int max_datatypes, int array_of_integers[], MPI_Aint array_of_addresses[],
00653 MPI_Datatype array_of_datatypes[]);
00654
00655 #if CMK_CUDA
00656 typedef struct workRequest workRequest;
00657
00658
00659 int AMPI_GPU_Iinvoke(workRequest *to_call, MPI_Request *request);
00660 int AMPI_GPU_Invoke(workRequest *to_call);
00661 #endif
00662
00663
00664
00665
00666 #define MPI_MAX_OBJECT_NAME 255
00667 #define MPI_MAX_INFO_KEY 255
00668 #define MPI_MAX_INFO_VAL 1024
00669 #define MPI_LOCK_SHARED 54
00670 #define MPI_LOCK_EXCLUSIVE 55
00671 #define MPI_WIN_NULL -1
00672
00673 typedef int MPI_Info;
00674 typedef int MPI_Win;
00675
00676 #define MPI_Win_create AMPI_Win_create
00677 int AMPI_Win_create(void *base, MPI_Aint size, int disp_unit,
00678 MPI_Info info, MPI_Comm comm, MPI_Win *newwin);
00679 #define MPI_Win_free AMPI_Win_free
00680 int AMPI_Win_free(MPI_Win *win);
00681 #define MPI_Win_delete_attr AMPI_Win_delete_attr
00682 int AMPI_Win_delete_attr(MPI_Win win, int key);
00683 #define MPI_Win_get_group AMPI_Win_get_group
00684 int AMPI_Win_get_group(MPI_Win win, MPI_Group *group);
00685 #define MPI_Win_set_name AMPI_Win_set_name
00686 int AMPI_Win_set_name(MPI_Win win, char *name);
00687 #define MPI_Win_get_name AMPI_Win_get_name
00688 int AMPI_Win_get_name(MPI_Win win, char *name, int *length);
00689 #define MPI_Win_fence AMPI_Win_fence
00690 int AMPI_Win_fence(int assertion, MPI_Win win);
00691 #define MPI_Win_lock AMPI_Win_lock
00692 int AMPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win);
00693 #define MPI_Win_unlock AMPI_Win_unlock
00694 int AMPI_Win_unlock(int rank, MPI_Win win);
00695 #define MPI_Win_post AMPI_Win_post
00696 int AMPI_Win_post(MPI_Group group, int assertion, MPI_Win win);
00697 #define MPI_Win_wait AMPI_Win_wait
00698 int AMPI_Win_wait(MPI_Win win);
00699 #define MPI_Win_start AMPI_Win_start
00700 int AMPI_Win_start(MPI_Group group, int assertion, MPI_Win win);
00701 #define MPI_Win_complete AMPI_Win_complete
00702 int AMPI_Win_complete(MPI_Win win);
00703 #define MPI_Alloc_mem AMPI_Alloc_mem
00704 int AMPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr);
00705 #define MPI_Free_mem AMPI_Free_mem
00706 int AMPI_Free_mem(void *base);
00707 #define MPI_Put AMPI_Put
00708 int AMPI_Put(void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank,
00709 MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win);
00710 #define MPI_Get AMPI_Get
00711 int AMPI_Get(void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank,
00712 MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win);
00713 #define MPI_Accumulate AMPI_Accumulate
00714 int AMPI_Accumulate(void *orgaddr, int orgcnt, MPI_Datatype orgtype, int rank,
00715 MPI_Aint targdisp, int targcnt, MPI_Datatype targtype,
00716 MPI_Op op, MPI_Win win);
00717
00718 #define MPI_IGet AMPI_IGet
00719 int AMPI_IGet(MPI_Aint orgdisp, int orgcnt, MPI_Datatype orgtype, int rank,
00720 MPI_Aint targdisp, int targcnt, MPI_Datatype targtype, MPI_Win win,
00721 MPI_Request *request);
00722 #define MPI_IGet_Wait AMPI_IGet_Wait
00723 int AMPI_IGet_Wait(MPI_Request *request, MPI_Status *status, MPI_Win win);
00724 #define MPI_IGet_Free AMPI_IGet_Free
00725 int AMPI_IGet_Free(MPI_Request *request, MPI_Status *status, MPI_Win win);
00726 char* MPI_IGet_Data(MPI_Status status);
00727
00728 #define MPI_Info_create AMPI_Info_create
00729 int AMPI_Info_create(MPI_Info *info);
00730 #define MPI_Info_set AMPI_Info_set
00731 int AMPI_Info_set(MPI_Info info, char *key, char *value);
00732 #define MPI_Info_delete AMPI_Info_delete
00733 int AMPI_Info_delete(MPI_Info info, char *key);
00734 #define MPI_Info_get AMPI_Info_get
00735 int AMPI_Info_get(MPI_Info info, char *key, int valuelen, char *value, int *flag);
00736 #define MPI_Info_get_valuelen AMPI_Info_get_valuelen
00737 int AMPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag);
00738 #define MPI_Info_get_nkeys AMPI_Info_get_nkeys
00739 int AMPI_Info_get_nkeys(MPI_Info info, int *nkeys);
00740 #define MPI_Info_get_nthkey AMPI_Info_get_nthkey
00741 int AMPI_Info_get_nthkey(MPI_Info info, int n, char *key);
00742 #define MPI_Info_dup AMPI_Info_dup
00743 int AMPI_Info_dup(MPI_Info info, MPI_Info *newinfo);
00744 #define MPI_Info_free AMPI_Info_free
00745 int AMPI_Info_free(MPI_Info *info);
00746
00747 #define MPI_Comm_c2f(comm) (MPI_Fint)(comm)
00748 #define MPI_Comm_f2c(comm) (MPI_Comm)(comm)
00749 #define MPI_Type_c2f(datatype) (MPI_Fint)(datatype)
00750 #define MPI_Type_f2c(datatype) (MPI_Datatype)(datatype)
00751 #define MPI_Group_c2f(group) (MPI_Fint)(group)
00752 #define MPI_Group_f2c(group) (MPI_Group)(group)
00753 #define MPI_Info_c2f(info) (MPI_Fint)(info)
00754 #define MPI_Info_f2c(info) (MPI_Info)(info)
00755 #define MPI_Request_f2c(request) (MPI_Request)(request)
00756 #define MPI_Request_c2f(request) (MPI_Fint)(request)
00757 #define MPI_Op_c2f(op) (MPI_Fint)(op)
00758 #define MPI_Op_f2c(op) (MPI_Op)(op)
00759 #define MPI_Errhandler_c2f(errhandler) (MPI_Fint)(errhandler)
00760 #define MPI_Errhandler_f2c(errhandler) (MPI_Errhandler)(errhandler)
00761 #define MPI_Win_c2f(win) (MPI_Fint)(win)
00762 #define MPI_Win_f2c(win) (MPI_Win)(win)
00763
00764 void AMPI_Install_Idle_Timer();
00765 void AMPI_Uninstall_Idle_Timer();
00766
00767 extern int traceRegisterFunction(const char *name, int idx);
00768 extern void traceBeginFuncProj(char *,char *,int);
00769 extern void traceEndFuncProj(char *);
00770 extern void traceBeginFuncIndexProj(int, char *, int);
00771 extern void traceEndFuncIndexProj(int);
00772
00773 #if CMK_BIGSIM_CHARM
00774 #define MPI_Set_startevent AMPI_Set_startevent
00775 int AMPI_Set_startevent(MPI_Comm comm);
00776 #endif
00777
00778
00779 extern long ampiCurrentStackUsage();
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790 #define _TRACE_REGISTER_FUNCTION_ID(x, id) traceRegisterFunction(x, id);
00791 #define _TRACE_BEGIN_FUNCTION_ID(id) traceBeginFuncIndexProj(id, __FILE__, __LINE__);
00792 #define _TRACE_END_FUNCTION_ID(id) traceEndFuncIndexProj(id);
00793
00794 #define _TRACE_REGISTER_FUNCTION_NAME(x) traceRegisterFunction(x, -999);
00795 #define _TRACE_BEGIN_FUNCTION_NAME(name) traceBeginFuncProj(name, __FILE__, __LINE__);
00796 #define _TRACE_END_FUNCTION_NAME(name) traceEndFuncProj(name);
00797
00798 void beginTraceBigSim(char* msg);
00799 void endTraceBigSim(char* msg, char* param);
00800
00801 #include "ampiProjections.h"
00802 #ifdef __cplusplus
00803 }
00804 #endif
00805
00806 #endif
00807