Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reorder loop processing in CommWait ex(C) comp
[simgrid.git] / src / s4u / s4u_Comm.cpp
index 47a3de687fbfd5f672c975a917c4254d12b98522..ac97c56ce3bd022ae4175bb61d430d94b5c3cefd 100644 (file)
@@ -58,8 +58,6 @@ Comm::~Comm()
       XBT_INFO("pimpl_ is null");
     xbt_backtrace_display_current();
   }
-  if (pimpl_ != nullptr)
-    pimpl_->set_iface(nullptr);
 }
 
 void Comm::send(kernel::actor::ActorImpl* sender, const Mailbox* mbox, double task_size, double rate, void* src_buff,
@@ -314,10 +312,8 @@ Comm* Comm::do_start()
     xbt_assert(src_buff_ == nullptr && dst_buff_ == nullptr,
                "Direct host-to-host communications cannot carry any data.");
     XBT_DEBUG("host-to-host Comm. Pimpl already created and set, just start it.");
-    on_send(*this);
-    on_this_send(*this);
-    on_recv(*this);
-    on_this_recv(*this);
+    on_start(*this);
+    on_this_start(*this);
     kernel::actor::simcall_answered([this] {
       pimpl_->set_state(kernel::activity::State::READY);
       boost::static_pointer_cast<kernel::activity::CommImpl>(pimpl_)->start();
@@ -472,7 +468,7 @@ ssize_t Comm::wait_any_for(const std::vector<CommPtr>& comms, double timeout)
 void Comm::wait_all(const std::vector<CommPtr>& comms)
 {
   // TODO: this should be a simcall or something
-  for (auto& comm : comms)
+  for (const auto& comm : comms)
     comm->wait();
 }