X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3f9587e71330e7471ef675d2652cee260a0e3a96..c159323728cd5c412af5e7bba947e5e002463d73:/src/s4u/s4u_host.cpp
diff --git a/src/s4u/s4u_host.cpp b/src/s4u/s4u_host.cpp
index e602cebe6d..10eec1db8d 100644
--- a/src/s4u/s4u_host.cpp
+++ b/src/s4u/s4u_host.cpp
@@ -55,7 +55,7 @@ Host::~Host()
delete pimpl_;
if (pimpl_netpoint != nullptr) // not removed yet by a children class
- simgrid::s4u::Engine::instance()->netcardUnregister(pimpl_netpoint);
+ simgrid::s4u::Engine::instance()->netpointUnregister(pimpl_netpoint);
delete pimpl_cpu;
delete mounts;
}
@@ -141,6 +141,14 @@ int Host::pstatesCount() const {
* by calling each "get_route" function in each routing component.
*/
void Host::routeTo(Host* dest, std::vector* links, double* latency)
+{
+ std::vector linkImpls;
+ this->routeTo(dest, &linkImpls, latency);
+ for (surf::LinkImpl* l : linkImpls)
+ links->push_back(&l->piface_);
+}
+/** @brief Just like Host::routeTo, but filling an array of link implementations */
+void Host::routeTo(Host* dest, std::vector* links, double* latency)
{
simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
@@ -218,14 +226,14 @@ int Host::coreCount() {
/** @brief Set the pstate at which the host should run */
void Host::setPstate(int pstate_index)
{
- simgrid::simix::kernelImmediate(std::bind(
- &simgrid::surf::Cpu::setPState, pimpl_cpu, pstate_index
- ));
+ simgrid::simix::kernelImmediate([&](){
+ this->pimpl_cpu->setPState(pstate_index);
+ });
}
/** @brief Retrieve the pstate at which the host is currently running */
int Host::pstate()
{
- return pimpl_cpu->getPState();
+ return this->pimpl_cpu->getPState();
}
/**