Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
auto-restart daemons as daemons (untested)
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 15 Aug 2018 00:43:37 +0000 (02:43 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 15 Aug 2018 00:43:37 +0000 (02:43 +0200)
src/simix/ActorImpl.hpp
src/surf/HostImpl.cpp

index 5c1bfca..fda93c2 100644 (file)
@@ -112,6 +112,7 @@ public:
   double kill_time                                                         = 0.0;
   std::shared_ptr<std::unordered_map<std::string, std::string>> properties = nullptr;
   bool auto_restart                                                        = false;
+  bool daemon_                                                             = false;
   ProcessArg()                                                             = default;
 
   explicit ProcessArg(std::string name, std::function<void()> code, void* data, s4u::Host* host, double kill_time,
@@ -133,6 +134,7 @@ public:
       , host(host)
       , kill_time(SIMIX_timer_get_date(actor->kill_timer))
       , auto_restart(actor->auto_restart_)
+      , daemon_(actor->is_daemon())
   {
     properties.reset(actor->get_properties(), [](decltype(actor->get_properties())) {});
   }
index 8fa9326..26acadd 100644 (file)
@@ -132,10 +132,11 @@ void HostImpl::turn_on()
                                                               arg->properties.get(), nullptr);
     if (arg->kill_time >= 0)
       simcall_process_set_kill_time(actor, arg->kill_time);
-    if (arg->auto_restart)
-      actor->auto_restart_ = arg->auto_restart;
+    if (arg->daemon_)
+      actor->daemonize();
   }
 }
+
 /** Kill all actors hosted here */
 void HostImpl::turn_off()
 {