X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2fc459da5e81c223895e15121c21678aa8f445f1..717bb82fd56727b8a066418eaa654290373736ea:/src/s4u/s4u_Host.cpp diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index 8e5edcbecd..adde454108 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -86,8 +86,8 @@ void Host::turn_on() { if (is_off()) { simgrid::simix::simcall([this] { - this->pimpl_->turn_on(); this->pimpl_cpu->turn_on(); + this->pimpl_->turn_on(); on_state_change(*this); }); } @@ -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 */); @@ -621,3 +626,8 @@ sg_host_t sg_host_self() smx_actor_t process = SIMIX_process_self(); return (process == nullptr) ? nullptr : process->host_; } + +double sg_host_load(sg_host_t host) +{ + return host->get_load(); +} \ No newline at end of file