+void smpi_mpi_start(MPI_Request request)
+{
+ smx_rdv_t mailbox;
+
+ xbt_assert(!request->action,
+ "Cannot (re)start a non-finished communication");
+ if(request->flags & RECV) {
+ print_request("New recv", request);
+ mailbox = smpi_process_mailbox();
+ request->action = SIMIX_req_comm_irecv(mailbox, request->buf, &request->size, &match_recv, request);
+ } else {
+ print_request("New send", request);
+ mailbox = smpi_process_remote_mailbox(request->dst);
+ request->action = SIMIX_req_comm_isend(mailbox, request->size, -1.0,
+ request->buf, request->size, &match_send, request, 0);
+#ifdef HAVE_TRACING
+ SIMIX_req_set_category (request->action, TRACE_internal_smpi_get_category());
+#endif
+ }
+}
+
+void smpi_mpi_startall(int count, MPI_Request * requests)
+{
+ int i;
+
+ for(i = 0; i < count; i++) {
+ smpi_mpi_start(requests[i]);
+ }
+}
+
+void smpi_mpi_request_free(MPI_Request * request)
+{
+ xbt_free(*request);
+ *request = MPI_REQUEST_NULL;
+}
+
+MPI_Request smpi_isend_init(void *buf, int count, MPI_Datatype datatype,
+ int dst, int tag, MPI_Comm comm)
+{
+ MPI_Request request =
+ build_request(buf, count, datatype, smpi_comm_rank(comm), dst, tag,
+ comm, NON_PERSISTENT | SEND);
+
+ return request;
+}
+
+MPI_Request smpi_mpi_isend(void *buf, int count, MPI_Datatype datatype,
+ int dst, int tag, MPI_Comm comm)
+{
+ MPI_Request request =
+ smpi_isend_init(buf, count, datatype, dst, tag, comm);
+
+ smpi_mpi_start(request);
+ return request;
+}
+
+MPI_Request smpi_irecv_init(void *buf, int count, MPI_Datatype datatype,
+ int src, int tag, MPI_Comm comm)
+{
+ MPI_Request request =
+ build_request(buf, count, datatype, src, smpi_comm_rank(comm), tag,
+ comm, NON_PERSISTENT | RECV);
+
+ return request;
+}
+
+MPI_Request smpi_mpi_irecv(void *buf, int count, MPI_Datatype datatype,
+ int src, int tag, MPI_Comm comm)
+{
+ MPI_Request request =
+ smpi_irecv_init(buf, count, datatype, src, tag, comm);
+
+ smpi_mpi_start(request);
+ return request;
+}
+
+void smpi_mpi_recv(void *buf, int count, MPI_Datatype datatype, int src,
+ int tag, MPI_Comm comm, MPI_Status * status)
+{