Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'models_type_rework_part2_try2' into 'master'
[simgrid.git] / src / s4u / s4u_Comm.cpp
index 066f4f4263629c9d101ac62fc9761c373ac3b615..23eaf0d2dcdf7f163b66a6d57c69edcf715efb76 100644 (file)
@@ -138,6 +138,11 @@ CommPtr Comm::sendto_async(Host* from, Host* to, double simulated_size_in_bytes)
   return res;
 }
 
+void Comm::sendto(Host* from, Host* to, double simulated_size_in_bytes)
+{
+  sendto_async(from, to, simulated_size_in_bytes)->wait();
+}
+
 Comm* Comm::start()
 {
   xbt_assert(get_state() == State::INITED || get_state() == State::STARTING,
@@ -147,7 +152,7 @@ Comm* Comm::start()
     xbt_assert(src_buff_ == nullptr && dst_buff_ == nullptr,
                "Direct host-to-host communications cannot carry any data.");
     pimpl_ = kernel::actor::simcall([this] {
-      auto res = new kernel::activity::CommImpl(this->from_, this->to_, this->get_remaining());
+      kernel::activity::CommImplPtr res(new kernel::activity::CommImpl(this->from_, this->to_, this->get_remaining()));
       res->start();
       return res;
     });