Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Program against s4u::Actor and not smx_actor_t
[simgrid.git] / src / smpi / mpi / smpi_request.cpp
index 64c3574..57e5a6b 100644 (file)
@@ -14,6 +14,7 @@
 #include "smpi_process.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/mc/mc_replay.hpp"
+#include "src/simix/ActorImpl.hpp"
 
 #include <algorithm>
 
@@ -377,7 +378,7 @@ void Request::start()
     // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
     real_size_=size_;
     action_   = simcall_comm_irecv(
-        process->process(), mailbox, buf_, &real_size_, &match_recv,
+        process->process()->getImpl(), mailbox, buf_, &real_size_, &match_recv,
         process->replaying() ? &smpi_comm_null_copy_buffer_callback : smpi_comm_copy_data_callback, this, -1.0);
     XBT_DEBUG("recv simcall posted");
 
@@ -464,7 +465,7 @@ void Request::start()
     // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
     real_size_=size_;
     action_   = simcall_comm_isend(
-        SIMIX_process_from_PID(src_ + 1), mailbox, size_, -1.0, buf, real_size_, &match_send,
+        simgrid::s4u::Actor::byPid(src_ + 1)->getImpl(), mailbox, size_, -1.0, buf, real_size_, &match_send,
         &xbt_free_f, // how to free the userdata if a detached send fails
         not process->replaying() ? smpi_comm_copy_data_callback : &smpi_comm_null_copy_buffer_callback, this,
         // detach if msg size < eager/rdv switch limit
@@ -629,7 +630,9 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
   MPI_Request request = new Request(nullptr, 0, MPI_CHAR, source == MPI_ANY_SOURCE ? MPI_ANY_SOURCE :
                  comm->group()->index(source), comm->rank(), tag, comm, PERSISTENT | RECV);
   if (smpi_iprobe_sleep > 0) {
-    smx_activity_t iprobe_sleep = simcall_execution_start("iprobe", /* flops to executek*/nsleeps*smpi_iprobe_sleep*speed*maxrate, /* priority */1.0, /* performance bound */maxrate*speed);
+    smx_activity_t iprobe_sleep = simcall_execution_start(
+        "iprobe", /* flops to executek*/ nsleeps * smpi_iprobe_sleep * speed * maxrate, /* priority */ 1.0,
+        /* performance bound */ maxrate * speed, smpi_process()->process()->getImpl()->host);
     simcall_execution_wait(iprobe_sleep);
   }
   // behave like a receive, but don't do it