Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
laste batch tonight
[simgrid.git] / src / smpi / mpi / smpi_request.cpp
index a248921..c961ef2 100644 (file)
@@ -200,10 +200,12 @@ MPI_Request Request::rma_send_init(void *buf, int count, MPI_Datatype datatype,
 {
   MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
   if(op==MPI_OP_NULL){
-    request = new Request(buf==MPI_BOTTOM ? nullptr : buf , count, datatype, src, dst, tag,
+    request = new Request(buf==MPI_BOTTOM ? nullptr : buf , count, datatype, comm->group()->actor(src)->getPid(),
+                            comm->group()->actor(dst)->getPid(), tag,
                             comm, RMA | NON_PERSISTENT | ISEND | SEND | PREPARED);
   }else{
-    request = new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype,  src, dst, tag,
+    request = new Request(buf==MPI_BOTTOM ? nullptr : buf, count, datatype, comm->group()->actor(src)->getPid(),
+                            comm->group()->actor(dst)->getPid(), tag,
                             comm, RMA | NON_PERSISTENT | ISEND | SEND | PREPARED | ACCUMULATE);
     request->op_ = op;
   }
@@ -222,10 +224,10 @@ MPI_Request Request::rma_recv_init(void *buf, int count, MPI_Datatype datatype,
 {
   MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
   if(op==MPI_OP_NULL){
-    request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, src, dst, tag, comm,
+    request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, comm->group()->actor(src)->getPid(), comm->group()->actor(dst)->getPid(), tag, comm,
                           RMA | NON_PERSISTENT | RECV | PREPARED);
   }else{
-    request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, src, dst, tag, comm,
+    request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, comm->group()->actor(src)->getPid(), comm->group()->actor(dst)->getPid(), tag, comm,
                           RMA | NON_PERSISTENT | RECV | PREPARED | ACCUMULATE);
     request->op_ = op;
   }
@@ -304,9 +306,15 @@ void Request::sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,int d
 {
   MPI_Request requests[2];
   MPI_Status stats[2];
-  unsigned int myid = simgrid::s4u::Actor::self()->getPid();
+  int myid = simgrid::s4u::Actor::self()->getPid();
   if ((comm->group()->actor(dst)->getPid() == myid) && (comm->group()->actor(src)->getPid() == myid)){
       Datatype::copy(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype);
+      if(status !=MPI_STATUS_IGNORE){
+          status->MPI_SOURCE = src;
+          status->MPI_TAG = recvtag;
+          status->MPI_ERROR = MPI_SUCCESS;
+          status->count = sendcount*sendtype->size();
+      }
       return;
   }
   requests[0] = isend_init(sendbuf, sendcount, sendtype, dst, sendtag, comm);