X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/220230a3d6da87b71f2e2d09ceaf166d75f3a6a8..387f0d33929229d58e854595762a9951d880b9fb:/src/simgrid/host.cpp?ds=sidebyside diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index 9e24002bf7..32f2e5d1cf 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -19,8 +19,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sg_host, sd, "Logging specific to sg_hosts"); -extern "C" { - size_t sg_host_count() { return simgrid::s4u::Engine::getInstance()->getHostCount(); @@ -153,7 +151,7 @@ int sg_host_core_count(sg_host_t host) double sg_host_get_available_speed(sg_host_t host) { - return host->pimpl_cpu->getAvailableSpeed(); + return host->pimpl_cpu->get_available_speed(); } /** @brief Returns the number of power states for a host. @@ -333,4 +331,8 @@ void sg_host_get_actor_list(sg_host_t host, xbt_dynar_t whereto) } } -} // extern "C" +sg_host_t sg_host_self() +{ + smx_actor_t process = SIMIX_process_self(); + return (process == nullptr) ? nullptr : process->host; +}