delete piface_->pimpl_;
piface_->pimpl_ = this;
}
+
HostImpl::~HostImpl()
{
/* All processes should be gone when the host is turned off (by the end of the simulation). */
for (auto const& arg : auto_restart_processes_)
delete arg;
auto_restart_processes_.clear();
- for (auto const& arg : boot_processes_)
- delete arg;
- boot_processes_.clear();
+ for (auto const& arg : actors_at_boot_)
+ delete arg.second;
+ actors_at_boot_.clear();
}
/** Re-starts all the actors that are marked as restartable.
*/
void HostImpl::turn_on()
{
- for (auto const& arg : boot_processes_) {
- XBT_DEBUG("Booting Process %s(%s) right now", arg->name.c_str(), arg->host->get_cname());
+ for (auto const& elm : actors_at_boot_) {
+ kernel::actor::ProcessArg* arg = elm.second;
+ XBT_DEBUG("Booting Actor %s(%s) right now", arg->name.c_str(), arg->host->get_cname());
smx_actor_t actor = simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->host,
arg->properties.get(), nullptr);
if (arg->kill_time >= 0)
{
if (not process_list_.empty()) {
for (auto& actor : process_list_) {
- SIMIX_process_kill(&actor, SIMIX_process_self());
- XBT_DEBUG("Killing %s@%s on behalf of %s which turned off that host.", actor.get_cname(),
+ XBT_DEBUG("Killing Actor %s@%s on behalf of %s which turned off that host.", actor.get_cname(),
actor.host_->get_cname(), SIMIX_process_self()->get_cname());
+ SIMIX_process_kill(&actor, SIMIX_process_self());
}
}
}
simgrid::kernel::actor::ProcessArg* arg =
new simgrid::kernel::actor::ProcessArg(actor_name, code, nullptr, host, kill_time, properties, auto_restart);
- host->pimpl_->boot_processes_.push_back(arg);
+ host->pimpl_->actors_at_boot_.insert({actor_name, arg});
if (start_time > SIMIX_get_clock()) {