Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix 'on_exit' preservation which failed when auto_restart was set first (FG#11).
[simgrid.git] / src / surf / HostImpl.cpp
index aa2acd2..09d521b 100644 (file)
@@ -31,7 +31,7 @@ static inline double has_cost(const double* array, size_t pos)
     return -1.0;
 }
 
-kernel::resource::Action* HostModel::execute_parallel(const std::vector<s4u::Host*> host_list,
+kernel::resource::Action* HostModel::execute_parallel(const std::vector<s4u::Host*>& host_list,
                                                       const double* flops_amount, const double* bytes_amount,
                                                       double rate)
 {
@@ -105,6 +105,8 @@ void HostImpl::turn_on()
     XBT_DEBUG("Booting Actor %s(%s) right now", arg->name.c_str(), arg->host->get_cname());
     simgrid::kernel::actor::ActorImplPtr actor = simgrid::kernel::actor::ActorImpl::create(
         arg->name.c_str(), arg->code, nullptr, arg->host, arg->properties.get(), nullptr);
+    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)