+void mpi_comm_dup__(int* comm, int* newcomm, int* ierr) {
+ MPI_Comm tmp;
+
+ *ierr = MPI_Comm_dup(get_comm(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newcomm = new_comm(tmp);
+ }
+}
+
+void mpi_comm_split__(int* comm, int* color, int* key, int* comm_out, int* ierr) {
+ MPI_Comm tmp;
+
+ *ierr = MPI_Comm_split(get_comm(*comm), *color, *key, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *comm_out = new_comm(tmp);
+ }
+}
+
+void mpi_send_init__(void *buf, int* count, int* datatype, int* dst, int* tag,
+ int* comm, int* request, int* ierr) {
+ MPI_Request req;
+
+ *ierr = MPI_Send_init(buf, *count, get_datatype(*datatype), *dst, *tag,
+ get_comm(*comm), &req);
+ if(*ierr == MPI_SUCCESS) {
+ *request = new_request(req);
+ }
+}
+
+void mpi_isend__(void *buf, int* count, int* datatype, int* dst,
+ int* tag, int* comm, int* request, int* ierr) {
+ MPI_Request req;
+
+ *ierr = MPI_Isend(buf, *count, get_datatype(*datatype), *dst, *tag,
+ get_comm(*comm), &req);
+ if(*ierr == MPI_SUCCESS) {
+ *request = new_request(req);
+ }
+}
+
+void mpi_send__(void* buf, int* count, int* datatype, int* dst,
+ int* tag, int* comm, int* ierr) {
+ *ierr = MPI_Send(buf, *count, get_datatype(*datatype), *dst, *tag,
+ get_comm(*comm));
+}
+
+void mpi_recv_init__(void *buf, int* count, int* datatype, int* src, int* tag,
+ int* comm, int* request, int* ierr) {
+ MPI_Request req;
+
+ *ierr = MPI_Recv_init(buf, *count, get_datatype(*datatype), *src, *tag,
+ get_comm(*comm), &req);
+ if(*ierr == MPI_SUCCESS) {
+ *request = new_request(req);
+ }
+}
+
+void mpi_irecv__(void *buf, int* count, int* datatype, int* src, int* tag,
+ int* comm, int* request, int* ierr) {
+ MPI_Request req;
+
+ *ierr = MPI_Irecv(buf, *count, get_datatype(*datatype), *src, *tag,
+ get_comm(*comm), &req);
+ if(*ierr == MPI_SUCCESS) {
+ *request = new_request(req);
+ }
+}
+
+void mpi_recv__(void* buf, int* count, int* datatype, int* src,
+ int* tag, int* comm, MPI_Status* status, int* ierr) {
+ *ierr = MPI_Recv(buf, *count, get_datatype(*datatype), *src, *tag,
+ get_comm(*comm), status);
+}
+
+void mpi_start__(int* request, int* ierr) {
+ MPI_Request req = find_request(*request);
+
+ *ierr = MPI_Start(&req);
+}
+
+void mpi_startall__(int* count, int* requests, int* ierr) {
+ MPI_Request* reqs;
+ int i;
+
+ reqs = xbt_new(MPI_Request, *count);
+ for(i = 0; i < *count; i++) {
+ reqs[i] = find_request(requests[i]);
+ }
+ *ierr = MPI_Startall(*count, reqs);
+ free(reqs);
+}
+
+void mpi_wait__(int* request, MPI_Status* status, int* ierr) {
+ MPI_Request req = find_request(*request);
+
+ *ierr = MPI_Wait(&req, status);
+}
+
+void mpi_waitany__(int* count, int* requests, int* index, MPI_Status* status, int* ierr) {
+ MPI_Request* reqs;
+ int i;
+
+ reqs = xbt_new(MPI_Request, *count);
+ for(i = 0; i < *count; i++) {
+ reqs[i] = find_request(requests[i]);
+ }
+ *ierr = MPI_Waitany(*count, reqs, index, status);
+ free(reqs);
+}
+
+void mpi_waitall__(int* count, int* requests, MPI_Status* status, int* ierr) {
+ MPI_Request* reqs;
+ int i;
+
+ reqs = xbt_new(MPI_Request, *count);
+ for(i = 0; i < *count; i++) {
+ reqs[i] = find_request(requests[i]);
+ }
+ *ierr = MPI_Waitall(*count, reqs, status);
+ free(reqs);
+}
+
+void mpi_barrier__(int* comm, int* ierr) {
+ *ierr = MPI_Barrier(get_comm(*comm));
+}
+
+void mpi_bcast__(void *buf, int* count, int* datatype, int* root, int* comm, int* ierr) {
+ *ierr = MPI_Bcast(buf, *count, get_datatype(*datatype), *root, get_comm(*comm));
+}
+
+void mpi_reduce__(void* sendbuf, void* recvbuf, int* count,
+ int* datatype, int* op, int* root, int* comm, int* ierr) {
+ *ierr = MPI_Reduce(sendbuf, recvbuf, *count,
+ get_datatype(*datatype), get_op(*op), *root, get_comm(*comm));
+}
+
+void mpi_allreduce__(void* sendbuf, void* recvbuf, int* count, int* datatype,
+ int* op, int* comm, int* ierr) {
+ *ierr = MPI_Allreduce(sendbuf, recvbuf, *count, get_datatype(*datatype),
+ get_op(*op), get_comm(*comm));
+}
+
+void mpi_scatter__(void* sendbuf, int* sendcount, int* sendtype,
+ void* recvbuf, int* recvcount, int* recvtype,
+ int* root, int* comm, int* ierr) {
+ *ierr = MPI_Scatter(sendbuf, *sendcount, get_datatype(*sendtype),
+ recvbuf, *recvcount, get_datatype(*recvtype), *root, get_comm(*comm));
+}
+
+void mpi_gather__(void* sendbuf, int* sendcount, int* sendtype,
+ void* recvbuf, int* recvcount, int* recvtype,
+ int* root, int* comm, int* ierr) {
+ *ierr = MPI_Gather(sendbuf, *sendcount, get_datatype(*sendtype),
+ recvbuf, *recvcount, get_datatype(*recvtype), *root, get_comm(*comm));
+}
+
+void mpi_allgather__(void* sendbuf, int* sendcount, int* sendtype,
+ void* recvbuf, int* recvcount, int* recvtype,
+ int* comm, int* ierr) {
+ *ierr = MPI_Allgather(sendbuf, *sendcount, get_datatype(*sendtype),
+ recvbuf, *recvcount, get_datatype(*recvtype), get_comm(*comm));
+}
+
+void mpi_scan__(void* sendbuf, void* recvbuf, int* count, int* datatype,
+ int* op, int* comm, int* ierr) {
+ *ierr = MPI_Scan(sendbuf, recvbuf, *count, get_datatype(*datatype),
+ get_op(*op), get_comm(*comm));