Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Replay: Use std::bind / std::function for the wait action
[simgrid.git] / src / simgrid / host.cpp
index 9e24002..346a1c4 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();
@@ -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;
+}