Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New: s4u::Host.execute() for remote executions
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 14 Sep 2017 14:07:40 +0000 (16:07 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 14 Sep 2017 14:07:40 +0000 (16:07 +0200)
ChangeLog
include/simgrid/s4u/Host.hpp
src/s4u/s4u_host.cpp

index 44c39b1..fe4f599 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ SimGrid (3.17) UNRELEASED (release target: September 22 2017)
   - Comm.detach(): start and forget about asynchronous emission
   - this_actor::send(mailbox) is now mailbox->put()
   - New: simgrid::s4u::Comm::wait_all()
+  - New: Host.execute() for remote executions.
 
  SURF
   - Unused option network/sender-gap is removed.
index b27c954..09c55ec 100644 (file)
@@ -105,6 +105,13 @@ public:
   void routeTo(Host * dest, std::vector<Link*> * links, double* latency);
   void routeTo(Host * dest, std::vector<surf::LinkImpl*> * links, double* latency);
 
+  /** Block the calling actor on an execution located on the called host
+   *
+   * It is not a problem if the actor is not located on the called host.
+   * The actor will not be migrated in this case. Such remote execution are easy in simulation.
+   */
+  void execute(double flops);
+
 private:
   simgrid::xbt::string name_ = "noname";
   std::unordered_map<std::string, Storage*>* mounts = nullptr; // caching
index 2bb3ab1..763fe98 100644 (file)
@@ -255,5 +255,14 @@ std::unordered_map<std::string, Storage*> const& Host::getMountedStorages()
   return *mounts;
 }
 
+void Host::execute(double flops)
+{
+  Host* host_list[1]   = {this};
+  double flops_list[1] = {flops};
+  smx_activity_t s     = simcall_execution_parallel_start(nullptr /*name*/, 1, host_list, flops_list,
+                                                      nullptr /*comm_sizes */, -1.0, -1 /*timeout*/);
+  simcall_execution_wait(s);
+}
+
 } // namespace simgrid
 } // namespace s4u