1 /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
9 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi,
10 "Logging specific to SMPI (mpi)");
12 /* MPI User level calls */
14 int MPI_Init(int *argc, char ***argv)
16 return PMPI_Init(argc, argv);
19 int MPI_Finalize(void)
21 return PMPI_Finalize();
24 int MPI_Init_thread(int *argc, char ***argv, int required, int *provided)
26 return PMPI_Init_thread(argc, argv, required, provided);
29 int MPI_Query_thread(int *provided)
31 return PMPI_Query_thread(provided);
34 int MPI_Is_thread_main(int *flag)
36 return PMPI_Is_thread_main(flag);
39 int MPI_Abort(MPI_Comm comm, int errorcode)
41 return PMPI_Abort(comm, errorcode);
44 double MPI_Wtime(void)
49 double MPI_Wtick(void)
54 int MPI_Address(void *location, MPI_Aint * address)
56 return PMPI_Address(location, address);
59 int MPI_Type_free(MPI_Datatype * datatype)
61 return PMPI_Type_free(datatype);
64 int MPI_Type_size(MPI_Datatype datatype, int *size)
66 return PMPI_Type_size(datatype, size);
69 int MPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent)
71 return PMPI_Type_get_extent(datatype, lb, extent);
74 int MPI_Type_extent(MPI_Datatype datatype, MPI_Aint * extent)
76 return PMPI_Type_extent(datatype, extent);
79 int MPI_Type_lb(MPI_Datatype datatype, MPI_Aint * disp)
81 return PMPI_Type_lb(datatype, disp);
84 int MPI_Type_ub(MPI_Datatype datatype, MPI_Aint * disp)
86 return PMPI_Type_ub(datatype, disp);
89 int MPI_Op_create(MPI_User_function * function, int commute, MPI_Op * op)
91 return PMPI_Op_create(function, commute, op);
94 int MPI_Op_free(MPI_Op * op)
96 return PMPI_Op_free(op);
99 int MPI_Group_free(MPI_Group * group)
101 return PMPI_Group_free(group);
104 int MPI_Group_size(MPI_Group group, int *size)
106 return PMPI_Group_size(group, size);
109 int MPI_Group_rank(MPI_Group group, int *rank)
111 return PMPI_Group_rank(group, rank);
114 int MPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1,
115 MPI_Group group2, int *ranks2)
117 return PMPI_Group_translate_ranks(group1, n, ranks1, group2, ranks2);
120 int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
122 return PMPI_Group_compare(group1, group2, result);
125 int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group * newgroup)
127 return PMPI_Group_union(group1, group2, newgroup);
130 int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, MPI_Group * newgroup)
132 return PMPI_Group_intersection(group1, group2, newgroup);
135 int MPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group * newgroup)
137 return PMPI_Group_difference(group1, group2, newgroup);
140 int MPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
142 return PMPI_Group_incl(group, n, ranks, newgroup);
145 int MPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
147 return PMPI_Group_excl(group, n, ranks, newgroup);
150 int MPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
151 MPI_Group * newgroup)
153 return PMPI_Group_range_incl(group, n, ranges, newgroup);
156 int MPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
157 MPI_Group * newgroup)
159 return PMPI_Group_range_excl(group, n, ranges, newgroup);
162 int MPI_Comm_rank(MPI_Comm comm, int *rank)
164 return PMPI_Comm_rank(comm, rank);
167 int MPI_Comm_size(MPI_Comm comm, int *size)
169 return PMPI_Comm_size(comm, size);
172 int MPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
174 return PMPI_Comm_get_name(comm, name, len);
177 int MPI_Comm_group(MPI_Comm comm, MPI_Group * group)
179 return PMPI_Comm_group(comm, group);
182 int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
184 return PMPI_Comm_compare(comm1, comm2, result);
187 int MPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm)
189 return PMPI_Comm_dup(comm, newcomm);
192 int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
194 return PMPI_Comm_create(comm, group, newcomm);
197 int MPI_Comm_free(MPI_Comm * comm)
199 return PMPI_Comm_free(comm);
202 int MPI_Comm_disconnect(MPI_Comm * comm)
204 return PMPI_Comm_disconnect(comm);
207 int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* comm_out)
209 return PMPI_Comm_split(comm, color, key, comm_out);
212 int MPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dst,
213 int tag, MPI_Comm comm, MPI_Request * request)
215 return PMPI_Send_init(buf, count, datatype, dst, tag, comm, request);
218 int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int src,
219 int tag, MPI_Comm comm, MPI_Request * request)
221 return PMPI_Recv_init(buf, count, datatype, src, tag, comm, request);
224 int MPI_Start(MPI_Request * request)
226 return PMPI_Start(request);
229 int MPI_Startall(int count, MPI_Request * requests)
231 return PMPI_Startall(count, requests);
234 int MPI_Request_free(MPI_Request * request)
236 return PMPI_Request_free(request);
239 int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src,
240 int tag, MPI_Comm comm, MPI_Request * request)
242 return PMPI_Irecv(buf, count, datatype, src, tag, comm, request);
245 int MPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst,
246 int tag, MPI_Comm comm, MPI_Request * request)
248 return PMPI_Isend(buf, count, datatype, dst, tag, comm, request);
251 int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag,
252 MPI_Comm comm, MPI_Status * status)
254 return PMPI_Recv(buf, count, datatype, src, tag, comm, status);
257 int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag,
260 return PMPI_Send(buf, count, datatype, dst, tag, comm);
263 int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
264 int dst, int sendtag, void *recvbuf, int recvcount,
265 MPI_Datatype recvtype, int src, int recvtag,
266 MPI_Comm comm, MPI_Status * status)
268 return PMPI_Sendrecv(sendbuf, sendcount, sendtype, dst, sendtag,
269 recvbuf, recvcount, recvtype, src, recvtag,
273 int MPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
274 int dst, int sendtag, int src, int recvtag,
275 MPI_Comm comm, MPI_Status * status)
277 return PMPI_Sendrecv_replace(buf, count, datatype, dst, sendtag, src,
278 recvtag, comm, status);
281 int MPI_Test(MPI_Request * request, int *flag, MPI_Status * status)
283 return PMPI_Test(request, flag, status);
286 int MPI_Testany(int count, MPI_Request requests[], int *index, int *flag,
289 return PMPI_Testany(count, requests, index, flag, status);
292 int MPI_Wait(MPI_Request * request, MPI_Status * status)
294 return PMPI_Wait(request, status);
297 int MPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * status)
299 return PMPI_Waitany(count, requests, index, status);
302 int MPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
304 return PMPI_Waitall(count, requests, status);
307 int MPI_Waitsome(int incount, MPI_Request requests[], int *outcount,
308 int *indices, MPI_Status status[])
310 return PMPI_Waitsome(incount, requests, outcount, indices, status);
313 int MPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
315 return PMPI_Bcast(buf, count, datatype, root, comm);
318 int MPI_Barrier(MPI_Comm comm)
320 return PMPI_Barrier(comm);
323 int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
324 void *recvbuf, int recvcount, MPI_Datatype recvtype,
325 int root, MPI_Comm comm)
327 return PMPI_Gather(sendbuf, sendcount, sendtype,
328 recvbuf, recvcount, recvtype,
332 int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
333 void *recvbuf, int *recvcounts, int *displs,
334 MPI_Datatype recvtype, int root, MPI_Comm comm)
336 return PMPI_Gatherv(sendbuf, sendcount, sendtype,
337 recvbuf, recvcounts, displs, recvtype,
341 int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
342 void *recvbuf, int recvcount, MPI_Datatype recvtype,
345 return PMPI_Allgather(sendbuf, sendcount, sendtype,
346 recvbuf, recvcount, recvtype,
350 int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
351 void *recvbuf, int *recvcounts, int *displs,
352 MPI_Datatype recvtype, MPI_Comm comm)
354 return PMPI_Allgatherv(sendbuf, sendcount, sendtype,
355 recvbuf, recvcounts, displs, recvtype,
359 int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
360 void *recvbuf, int recvcount, MPI_Datatype recvtype,
361 int root, MPI_Comm comm)
363 return PMPI_Scatter(sendbuf, sendcount, sendtype,
364 recvbuf, recvcount, recvtype,
368 int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
369 MPI_Datatype sendtype, void *recvbuf, int recvcount,
370 MPI_Datatype recvtype, int root, MPI_Comm comm)
372 return PMPI_Scatterv(sendbuf, sendcounts, displs, sendtype,
373 recvbuf, recvcount, recvtype,
377 int MPI_Reduce(void *sendbuf, void *recvbuf, int count,
378 MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
380 return PMPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
383 int MPI_Allreduce(void *sendbuf, void *recvbuf, int count,
384 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
386 return PMPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm);
389 int MPI_Scan(void *sendbuf, void *recvbuf, int count,
390 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
392 return PMPI_Scan(sendbuf, recvbuf, count, datatype, op, comm);
395 int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
396 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
398 return PMPI_Reduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm);
401 int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
402 void *recvbuf, int recvcount, MPI_Datatype recvtype,
405 return PMPI_Alltoall(sendbuf, sendcount, sendtype,
406 recvbuf, recvcount, recvtype,
410 int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *senddisps,
411 MPI_Datatype sendtype, void *recvbuf, int *recvcounts,
412 int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
414 return PMPI_Alltoallv(sendbuf, sendcounts, senddisps, sendtype,
415 recvbuf, recvcounts, recvdisps, recvtype,
420 int MPI_Get_processor_name(char *name, int *resultlen)
422 return PMPI_Get_processor_name(name, resultlen);
425 int MPI_Get_count(MPI_Status * status, MPI_Datatype datatype, int *count)
427 return PMPI_Get_count(status, datatype, count);
430 int MPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) {
431 return PMPI_Pack_size(incount, datatype, comm, size);
434 int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int* coords) {
435 return PMPI_Cart_coords(comm, rank, maxdims, coords);
438 int MPI_Cart_create(MPI_Comm comm_old, int ndims, int* dims, int* periods, int reorder, MPI_Comm* comm_cart) {
439 return PMPI_Cart_create(comm_old, ndims, dims, periods, reorder, comm_cart);
442 int MPI_Cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords) {
443 return PMPI_Cart_get(comm, maxdims, dims, periods, coords);
446 int MPI_Cart_map(MPI_Comm comm_old, int ndims, int* dims, int* periods, int* newrank) {
447 return PMPI_Cart_map(comm_old, ndims, dims, periods, newrank);
450 int MPI_Cart_rank(MPI_Comm comm, int* coords, int* rank) {
451 return PMPI_Cart_rank(comm, coords, rank);
454 int MPI_Cart_shift(MPI_Comm comm, int direction, int displ, int* source, int* dest) {
455 return PMPI_Cart_shift(comm, direction, displ, source, dest);
458 int MPI_Cart_sub(MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new) {
459 return PMPI_Cart_sub(comm, remain_dims, comm_new);
462 int MPI_Cartdim_get(MPI_Comm comm, int* ndims) {
463 return PMPI_Cartdim_get(comm, ndims);
466 int MPI_Graph_create(MPI_Comm comm_old, int nnodes, int* index, int* edges, int reorder, MPI_Comm* comm_graph) {
467 return PMPI_Graph_create(comm_old, nnodes, index, edges, reorder, comm_graph);
470 int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int* index, int* edges) {
471 return PMPI_Graph_get(comm, maxindex, maxedges, index, edges);
474 int MPI_Graph_map(MPI_Comm comm_old, int nnodes, int* index, int* edges, int* newrank) {
475 return PMPI_Graph_map(comm_old, nnodes, index, edges, newrank);
478 int MPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int* neighbors) {
479 return PMPI_Graph_neighbors(comm, rank, maxneighbors, neighbors);
482 int MPI_Graph_neighbors_count(MPI_Comm comm, int rank, int* nneighbors) {
483 return PMPI_Graph_neighbors_count(comm, rank, nneighbors);
486 int MPI_Graphdims_get(MPI_Comm comm, int* nnodes, int* nedges) {
487 return PMPI_Graphdims_get(comm, nnodes, nedges);
490 int MPI_Topo_test(MPI_Comm comm, int* top_type) {
491 return PMPI_Topo_test(comm, top_type);
494 int MPI_Error_class(int errorcode, int* errorclass) {
495 return PMPI_Error_class(errorcode, errorclass);
498 int MPI_Errhandler_create(MPI_Handler_function* function, MPI_Errhandler* errhandler) {
499 return PMPI_Errhandler_create(function, errhandler);
502 int MPI_Errhandler_free(MPI_Errhandler* errhandler) {
503 return PMPI_Errhandler_free(errhandler);
506 int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler* errhandler) {
507 return PMPI_Errhandler_get(comm, errhandler);
510 int MPI_Error_string(int errorcode, char* string, int* resultlen) {
511 return PMPI_Error_string(errorcode, string, resultlen);
514 int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) {
515 return PMPI_Errhandler_set(comm, errhandler);
518 int MPI_Type_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* newtype) {
519 return PMPI_Type_contiguous(count, old_type, newtype);
522 int MPI_Cancel(MPI_Request* request) {
523 return PMPI_Cancel(request);
526 int MPI_Buffer_attach(void* buffer, int size) {
527 return PMPI_Buffer_attach(buffer, size);
530 int MPI_Buffer_detach(void* buffer, int* size) {
531 return PMPI_Buffer_detach(buffer, size);
534 int MPI_Testsome(int incount, MPI_Request* requests, int* outcount, int* indices, MPI_Status* statuses) {
535 return PMPI_Testsome(incount, requests, outcount, indices, statuses);
538 int MPI_Comm_test_inter(MPI_Comm comm, int* flag) {
539 return PMPI_Comm_test_inter(comm, flag);
542 int MPI_Unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) {
543 return PMPI_Unpack(inbuf, insize, position, outbuf, outcount, type, comm);
546 int MPI_Type_commit(MPI_Datatype* datatype) {
547 return PMPI_Type_commit(datatype);
550 int MPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
551 return PMPI_Type_hindexed(count, blocklens, indices, old_type, newtype);
554 int MPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
555 return PMPI_Type_hvector(count, blocklen, stride, old_type, newtype);
558 int MPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
559 return PMPI_Type_indexed(count, blocklens, indices, old_type, newtype);
562 int MPI_Type_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype) {
563 return PMPI_Type_struct(count, blocklens, indices, old_types, newtype);
566 int MPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
567 return PMPI_Type_vector(count, blocklen, stride, old_type, newtype);
570 int MPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
571 return PMPI_Ssend(buf, count, datatype, dest, tag, comm);
574 int MPI_Ssend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
575 return PMPI_Ssend_init(buf, count, datatype, dest, tag, comm, request);
578 int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm* comm_out) {
579 return PMPI_Intercomm_create(local_comm, local_leader, peer_comm, remote_leader, tag, comm_out);
582 int MPI_Intercomm_merge(MPI_Comm comm, int high, MPI_Comm* comm_out) {
583 return PMPI_Intercomm_merge(comm, high, comm_out);
586 int MPI_Bsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
587 return PMPI_Bsend(buf, count, datatype, dest, tag, comm);
590 int MPI_Bsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
591 return PMPI_Bsend_init(buf, count, datatype, dest, tag, comm, request);
594 int MPI_Ibsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
595 return PMPI_Ibsend(buf, count, datatype, dest, tag, comm, request);
598 int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group* group) {
599 return PMPI_Comm_remote_group(comm, group);
602 int MPI_Comm_remote_size(MPI_Comm comm, int* size) {
603 return PMPI_Comm_remote_size(comm, size);
606 int MPI_Issend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
607 return PMPI_Issend(buf, count, datatype, dest, tag, comm, request);
610 int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status* status) {
611 return PMPI_Probe(source, tag, comm, status);
614 int MPI_Attr_delete(MPI_Comm comm, int keyval) {
615 return PMPI_Attr_delete(comm, keyval);
618 int MPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
619 return PMPI_Attr_get(comm, keyval, attr_value, flag);
622 int MPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) {
623 return PMPI_Attr_put(comm, keyval, attr_value);
626 int MPI_Rsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
627 return PMPI_Rsend(buf, count, datatype, dest, tag, comm);
630 int MPI_Rsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
631 return PMPI_Rsend_init(buf, count, datatype, dest, tag, comm, request);
634 int MPI_Irsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
635 return PMPI_Irsend(buf, count, datatype, dest, tag, comm, request);
638 int MPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_fn, int* keyval, void* extra_state) {
639 return PMPI_Keyval_create(copy_fn, delete_fn, keyval, extra_state);
642 int MPI_Keyval_free(int* keyval) {
643 return PMPI_Keyval_free(keyval);
646 int MPI_Test_cancelled(MPI_Status* status, int* flag) {
647 return PMPI_Test_cancelled(status, flag);
650 int MPI_Pack(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) {
651 return PMPI_Pack(inbuf, incount, type, outbuf, outcount, position, comm);
654 int MPI_Testall(int count, MPI_Request* requests, int* flag, MPI_Status* statuses) {
655 return PMPI_Testall(count, requests, flag, statuses);
658 int MPI_Get_elements(MPI_Status* status, MPI_Datatype datatype, int* elements) {
659 return PMPI_Get_elements(status, datatype, elements);
662 int MPI_Dims_create(int nnodes, int ndims, int* dims) {
663 return PMPI_Dims_create(nnodes, ndims, dims);
666 int MPI_Iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status) {
667 return PMPI_Iprobe(source, tag, comm, flag, status);
670 int MPI_Initialized(int* flag) {
671 return PMPI_Initialized(flag);