X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9d8612c62eaa05c2a8f916ea84eaab8a30b16826..4052b6d9960bd9792127d006c4f359b946cb7baa:/src/s4u/s4u_Host.cpp diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index 97dd8ba2a1..bd963f4da1 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -92,7 +92,7 @@ Host* Host::current() void Host::turnOn() { if (isOff()) { - simgrid::simix::kernelImmediate([this] { + simgrid::simix::simcall([this] { this->extension()->turnOn(); this->pimpl_cpu->turn_on(); onStateChange(*this); @@ -104,7 +104,7 @@ void Host::turnOff() { if (isOn()) { smx_actor_t self = SIMIX_process_self(); - simgrid::simix::kernelImmediate([this, self] { + simgrid::simix::simcall([this, self] { SIMIX_host_off(this, self); onStateChange(*this); }); @@ -168,7 +168,7 @@ void Host::routeTo(Host* dest, std::vector& links, /** Get the properties assigned to a host */ std::map* Host::getProperties() { - return simgrid::simix::kernelImmediate([this] { return this->pimpl_->getProperties(); }); + return simgrid::simix::simcall([this] { return this->pimpl_->getProperties(); }); } /** Retrieve the property value (or nullptr if not set) */ @@ -179,7 +179,7 @@ const char* Host::getProperty(const char* key) void Host::setProperty(std::string key, std::string value) { - simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); }); + simgrid::simix::simcall([this, key, value] { this->pimpl_->setProperty(key, value); }); } /** Get the processes attached to the host */ @@ -199,8 +199,7 @@ int Host::get_actor_count() /** @brief Get the peak processor speed (in flops/s), at the specified pstate */ double Host::getPstateSpeed(int pstate_index) { - return simgrid::simix::kernelImmediate( - [this, pstate_index] { return this->pimpl_cpu->getPstateSpeed(pstate_index); }); + return simgrid::simix::simcall([this, pstate_index] { return this->pimpl_cpu->getPstateSpeed(pstate_index); }); } /** @brief Get the peak processor speed (under full load (=1.0), in flops/s), at the current pstate */ @@ -218,7 +217,7 @@ int Host::getCoreCount() /** @brief Set the pstate at which the host should run */ void Host::setPstate(int pstate_index) { - simgrid::simix::kernelImmediate([this, pstate_index] { this->pimpl_cpu->setPState(pstate_index); }); + simgrid::simix::simcall([this, pstate_index] { this->pimpl_cpu->setPState(pstate_index); }); } /** @brief Retrieve the pstate at which the host is currently running */ int Host::getPstate() @@ -233,13 +232,13 @@ int Host::getPstate() */ std::vector Host::get_attached_storages() { - return simgrid::simix::kernelImmediate([this] { return this->pimpl_->get_attached_storages(); }); + return simgrid::simix::simcall([this] { return this->pimpl_->get_attached_storages(); }); } void Host::getAttachedStorages(std::vector* storages) { std::vector local_storages = - simgrid::simix::kernelImmediate([this] { return this->pimpl_->get_attached_storages(); }); + simgrid::simix::simcall([this] { return this->pimpl_->get_attached_storages(); }); for (auto elm : local_storages) storages->push_back(elm); }