]> AND Public Git Repository - simgrid.git/blobdiff - src/surf/HostImpl.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
System: fix modified_set_ when selective_update is active
[simgrid.git] / src / surf / HostImpl.cpp
index 4fe0ac99850ce7c0662e549537594104cf924d29..cb63f32b7681001e87f184ef4d1a99e4231788eb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -78,16 +78,7 @@ void HostImpl::turn_on() const
 {
   for (auto const& arg : actors_at_boot_) {
     XBT_DEBUG("Booting Actor %s(%s) right now", arg->name.c_str(), arg->host->get_cname());
-    actor::ActorImplPtr actor = actor::ActorImpl::create(arg->name, arg->code, nullptr, arg->host, nullptr);
-    actor->set_properties(arg->properties);
-    if (arg->on_exit)
-      *actor->on_exit = *arg->on_exit;
-    if (arg->kill_time >= 0)
-      actor->set_kill_time(arg->kill_time);
-    if (arg->auto_restart)
-      actor->set_auto_restart(arg->auto_restart);
-    if (arg->daemon_)
-      actor->daemonize();
+    actor::ActorImplPtr actor = actor::ActorImpl::create(arg);
   }
 }
 
@@ -99,13 +90,13 @@ void HostImpl::turn_off(const actor::ActorImpl* issuer)
               actor.get_host()->get_cname(), issuer->get_cname());
     issuer->kill(&actor);
   }
-  for (auto& activity : EngineImpl::get_instance()->get_maestro()->activities_) {
+  for (const auto& activity : EngineImpl::get_instance()->get_maestro()->activities_) {
     auto* exec = dynamic_cast<activity::ExecImpl*>(activity.get());
     if (exec != nullptr) {
       auto hosts = exec->get_hosts();
       if (std::find(hosts.begin(), hosts.end(), &piface_) != hosts.end()) {
         exec->cancel();
-        exec->state_ = activity::State::FAILED;
+        exec->set_state(activity::State::FAILED);
       }
     }
   }