]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/activity/CommImpl.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make CommDet a plugin on top of Safety
[simgrid.git] / src / kernel / activity / CommImpl.cpp
index 15b5cdf64c8bdc6db618a25b4b886d79a3ddd752..842d6699571234be8bcdca9a0f1f16132cfcef73 100644 (file)
@@ -280,7 +280,7 @@ ActivityImplPtr CommImpl::isend(actor::CommIsendSimcall* observer)
    *
    * If it is not found then push our communication into the rendez-vous point */
   CommImplPtr other_comm =
-      mbox->find_matching_comm(CommImpl::Type::RECEIVE, observer->match_fun_, observer->get_payload(), this_comm,
+      mbox->find_matching_comm(CommImpl::Type::RECEIVE, observer->get_match_fun(), observer->get_payload(), this_comm,
                                /*done*/ false, /*remove_matching*/ true);
 
   if (not other_comm) {
@@ -301,10 +301,11 @@ ActivityImplPtr CommImpl::isend(actor::CommIsendSimcall* observer)
 
     other_comm->set_state(State::READY);
   }
+  observer->set_comm(other_comm.get());
 
   if (observer->is_detached()) {
     other_comm->detach();
-    other_comm->clean_fun = observer->clean_fun_;
+    other_comm->clean_fun = observer->get_clean_fun();
   } else {
     other_comm->clean_fun = nullptr;
     observer->get_issuer()->activities_.emplace_back(other_comm);
@@ -318,8 +319,8 @@ ActivityImplPtr CommImpl::isend(actor::CommIsendSimcall* observer)
       .set_size(observer->get_payload_size())
       .set_rate(observer->get_rate());
 
-  other_comm->match_fun     = observer->match_fun_;
-  other_comm->copy_data_fun = observer->copy_data_fun_;
+  other_comm->match_fun     = observer->get_match_fun();
+  other_comm->copy_data_fun = observer->get_copy_data_fun();
 
   if (MC_is_active() || MC_record_replay_is_active())
     other_comm->set_state(simgrid::kernel::activity::State::RUNNING);
@@ -340,7 +341,7 @@ ActivityImplPtr CommImpl::irecv(actor::CommIrecvSimcall* observer)
   if (mbox->is_permanent() && mbox->has_some_done_comm()) {
     XBT_DEBUG("We have a comm that has probably already been received, trying to match it, to skip the communication");
     // find a match in the list of already received comms
-    other_comm = mbox->find_matching_comm(CommImpl::Type::SEND, observer->match_fun_, observer->get_payload(),
+    other_comm = mbox->find_matching_comm(CommImpl::Type::SEND, observer->get_match_fun(), observer->get_payload(),
                                           this_synchro, /*done*/ true, /*remove_matching*/ true);
     // if not found, assume the receiver came first, register it to the mailbox in the classical way
     if (not other_comm) {
@@ -362,7 +363,7 @@ ActivityImplPtr CommImpl::irecv(actor::CommIrecvSimcall* observer)
      * ourself so that the other side also gets a chance of choosing if it wants to match with us.
      *
      * If it is not found then push our communication into the rendez-vous point */
-    other_comm = mbox->find_matching_comm(CommImpl::Type::SEND, observer->match_fun_, observer->get_payload(),
+    other_comm = mbox->find_matching_comm(CommImpl::Type::SEND, observer->get_match_fun(), observer->get_payload(),
                                           this_synchro, /*done*/ false, /*remove_matching*/ true);
 
     if (other_comm == nullptr) {
@@ -376,6 +377,7 @@ ActivityImplPtr CommImpl::irecv(actor::CommIrecvSimcall* observer)
     }
     observer->get_issuer()->activities_.emplace_back(other_comm);
   }
+  observer->set_comm(other_comm.get());
 
   /* Setup communication synchro */
   other_comm->dst_actor_ = observer->get_issuer();
@@ -385,8 +387,8 @@ ActivityImplPtr CommImpl::irecv(actor::CommIrecvSimcall* observer)
   if (observer->get_rate() > -1.0 && (other_comm->get_rate() < 0.0 || observer->get_rate() < other_comm->get_rate()))
     other_comm->set_rate(observer->get_rate());
 
-  other_comm->match_fun     = observer->match_fun_;
-  other_comm->copy_data_fun = observer->copy_data_fun_;
+  other_comm->match_fun     = observer->get_match_fun();
+  other_comm->copy_data_fun = observer->get_copy_data_fun();
 
   if (MC_is_active() || MC_record_replay_is_active()) {
     other_comm->set_state(State::RUNNING);