From 66c9e04ef6dbd72bb5dbc76dfaeb7ed02d6a8c57 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Fri, 24 Aug 2018 14:13:16 +0200 Subject: [PATCH] new function: Host::exec_async --- include/simgrid/s4u/Host.hpp | 3 +++ src/s4u/s4u_Host.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/include/simgrid/s4u/Host.hpp b/include/simgrid/s4u/Host.hpp index d46e69912c..9153fbe01f 100644 --- a/include/simgrid/s4u/Host.hpp +++ b/include/simgrid/s4u/Host.hpp @@ -153,6 +153,9 @@ public: * The actor will not be migrated in this case. Such remote execution are easy in simulation. */ void execute(double flops); + /** Start an asynchronous computation on that host (possibly remote) */ + ExecPtr exec_async(double flops_amounts); + /** Block the calling actor on an execution located on the called host (with explicit priority) */ void execute(double flops, double priority); diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index e78c4eb956..27d5e96402 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -284,6 +284,11 @@ std::unordered_map const& Host::get_mounted_storages() return *mounts_; } +ExecPtr Host::exec_async(double flops) +{ + return this_actor::exec_init(flops)->set_host(this); +} + void Host::execute(double flops) { execute(flops, 1.0 /* priority */); -- 2.20.1