Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics in cpu_ti
[simgrid.git] / src / simgrid / host.cpp
index 9e24002bf7bfb7de5d8652e6c8285d908be3ca8c..32f2e5d1cf8c9d2aa98c2eff171d88e51cac402e 100644 (file)
@@ -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;
+}