Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / simix / smx_host.cpp
index 3e9573a..3a22697 100644 (file)
@@ -61,29 +61,6 @@ namespace simgrid {
 
 }} // namespaces
 
-/** @brief Stop the host if it is on */
-void SIMIX_host_off(sg_host_t h, smx_actor_t issuer)
-{
-  simgrid::simix::Host* host = h->extension<simgrid::simix::Host>();
-
-  xbt_assert((host != nullptr), "Invalid parameters");
-
-  if (h->isOn()) {
-    h->pimpl_cpu->turn_off();
-
-    /* Clean Simulator data */
-    if (not host->process_list.empty()) {
-      for (auto& process : host->process_list) {
-        SIMIX_process_kill(&process, issuer);
-        XBT_DEBUG("Killing %s@%s on behalf of %s which turned off that host.", process.get_cname(),
-                  process.host->get_cname(), issuer->get_cname());
-      }
-    }
-  } else {
-    XBT_INFO("Host %s is already off", h->get_cname());
-  }
-}
-
 /* needs to be public and without simcall for exceptions and logging events */
 const char* sg_host_self_get_name()
 {
@@ -109,7 +86,7 @@ void SIMIX_host_add_auto_restart_process(sg_host_t host, const char* name, std::
       new simgrid::kernel::actor::ProcessArg(name, code, data, host, kill_time, nullptr, auto_restart);
   arg->properties.reset(properties, [](decltype(properties)) {});
 
-  if (host->isOff() && watched_hosts.find(host->get_cname()) == watched_hosts.end()) {
+  if (host->is_off() && watched_hosts.find(host->get_cname()) == watched_hosts.end()) {
     watched_hosts.insert(host->get_cname());
     XBT_DEBUG("Push host %s to watched_hosts because state == SURF_RESOURCE_OFF", host->get_cname());
   }
@@ -255,7 +232,7 @@ void SIMIX_execution_finish(smx_activity_t synchro)
         xbt_die("Internal error in SIMIX_execution_finish: unexpected synchro state %d", (int)exec->state_);
     }
     /* Fail the process if the host is down */
-    if (simcall->issuer->host->isOff())
+    if (simcall->issuer->host->is_off())
       simcall->issuer->context->iwannadie = 1;
 
     simcall->issuer->waiting_synchro = nullptr;