Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Host::exec_async was an init(), fix that.
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 4 Feb 2021 11:57:22 +0000 (12:57 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 4 Feb 2021 11:57:22 +0000 (12:57 +0100)
examples/s4u/io-dependent/s4u-io-dependent.cpp
include/simgrid/s4u/Host.hpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_Host.cpp

index 58e4228..5923adb 100644 (file)
@@ -16,7 +16,7 @@ static void test()
       simgrid::s4u::Host::current()->get_disks().front()->io_init(4000000, simgrid::s4u::Io::OpType::WRITE);
   simgrid::s4u::IoPtr carl_read =
       simgrid::s4u::Host::by_name("carl")->get_disks().front()->io_init(4000000, simgrid::s4u::Io::OpType::READ);
-  simgrid::s4u::ExecPtr carl_compute = simgrid::s4u::Host::by_name("carl")->exec_async(1e9);
+  simgrid::s4u::ExecPtr carl_compute = simgrid::s4u::Host::by_name("carl")->exec_init(1e9);
 
   // Name the activities (for logging purposes only)
   bob_compute->set_name("bob compute");
index eede647..b4c98e2 100644 (file)
@@ -182,6 +182,7 @@ public:
    */
   void execute(double flops) const;
   /** Start an asynchronous computation on that host (possibly remote) */
+  ExecPtr exec_init(double flops_amounts) const;
   ExecPtr exec_async(double flops_amounts) const;
 
   /** Block the calling actor on an execution located on the called host (with explicit priority) */
index 3c4b899..46eff09 100644 (file)
@@ -404,7 +404,7 @@ ExecPtr exec_init(const std::vector<s4u::Host*>& hosts, const std::vector<double
 ExecPtr exec_async(double flops)
 {
   ExecPtr res = exec_init(flops);
-  res->start();
+  res->vetoable_start();
   return res;
 }
 
index 589438c..13b6b95 100644 (file)
@@ -274,11 +274,16 @@ void Host::remove_disk(const std::string& disk_name)
   kernel::actor::simcall([this, disk_name] { this->pimpl_->remove_disk(disk_name); });
 }
 
-ExecPtr Host::exec_async(double flops) const
+ExecPtr Host::exec_init(double flops) const
 {
   return this_actor::exec_init(flops);
 }
 
+ExecPtr Host::exec_async(double flops) const
+{
+  return this_actor::exec_async(flops);
+}
+
 void Host::execute(double flops) const
 {
   execute(flops, 1.0 /* priority */);