THROWF(vm_error, 0, "Actor %s cannot suspend the VM %s in which it runs", issuer->get_cname(),
piface_->get_cname());
- XBT_DEBUG("suspend VM(%s), where %zu processes exist", piface_->get_cname(), process_list.size());
+ XBT_DEBUG("suspend VM(%s), where %zu processes exist", piface_->get_cname(), process_list_.size());
action_->suspend();
- for (auto& smx_process : process_list) {
+ for (auto& smx_process : process_list_) {
XBT_DEBUG("suspend %s", smx_process.get_cname());
smx_process.suspend(issuer);
}
if (get_state() != s4u::VirtualMachine::state::SUSPENDED)
THROWF(vm_error, 0, "Cannot resume VM %s: it was not suspended", piface_->get_cname());
- XBT_DEBUG("Resume VM %s, containing %zu processes.", piface_->get_cname(), process_list.size());
+ XBT_DEBUG("Resume VM %s, containing %zu processes.", piface_->get_cname(), process_list_.size());
action_->resume();
- for (auto& smx_process : process_list) {
+ for (auto& smx_process : process_list_) {
XBT_DEBUG("resume %s", smx_process.get_cname());
smx_process.resume();
}
XBT_VERB("Shutting down the VM %s even if it's not running but %s", piface_->get_cname(), stateName);
}
- XBT_DEBUG("shutdown VM %s, that contains %zu processes", piface_->get_cname(), process_list.size());
+ XBT_DEBUG("shutdown VM %s, that contains %zu processes", piface_->get_cname(), process_list_.size());
- for (auto& smx_process : process_list) {
+ for (auto& smx_process : process_list_) {
XBT_DEBUG("kill %s@%s on behalf of %s which shutdown that VM.", smx_process.get_cname(),
smx_process.host_->get_cname(), issuer->get_cname());
SIMIX_process_kill(&smx_process, issuer);
XBT_DEBUG("%p should not be run anymore",process);
simix_global->process_list.erase(process->pid_);
if (process->host_ && process->host_process_list_hook.is_linked())
- simgrid::xbt::intrusive_erase(process->host_->pimpl_->process_list, *process);
+ simgrid::xbt::intrusive_erase(process->host_->pimpl_->process_list_, *process);
if (not process->smx_destroy_list_hook.is_linked()) {
#if SIMGRID_HAVE_MC
xbt_dynar_push_as(simix_global->dead_actors_vector, smx_actor_t, process);
process->set_property(kv.first, kv.second);
/* Add the process to its host's process list */
- host->pimpl_->process_list.push_back(*process);
+ host->pimpl_->process_list_.push_back(*process);
XBT_DEBUG("Start context '%s'", process->get_cname());
process->set_property(kv.first, kv.second);
/* Add the process to it's host process list */
- host->pimpl_->process_list.push_back(*process);
+ host->pimpl_->process_list_.push_back(*process);
/* Now insert it in the global process list and in the process to run list */
simix_global->process_list[process->pid_] = process;
void SIMIX_process_change_host(smx_actor_t actor, sg_host_t dest)
{
xbt_assert((actor != nullptr), "Invalid parameters");
- simgrid::xbt::intrusive_erase(actor->host_->pimpl_->process_list, *actor);
+ simgrid::xbt::intrusive_erase(actor->host_->pimpl_->process_list_, *actor);
actor->host_ = dest;
- dest->pimpl_->process_list.push_back(*actor);
+ dest->pimpl_->process_list_.push_back(*actor);
}
void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_actor_t process)
XBT_DEBUG("Push host %s to watched_hosts because state == SURF_RESOURCE_OFF", host->get_cname());
}
XBT_DEBUG("Adding Process %s to the auto-restart list of Host %s", arg->name.c_str(), arg->host->get_cname());
- host->pimpl_->auto_restart_processes.push_back(arg);
+ host->pimpl_->auto_restart_processes_.push_back(arg);
}
/** @brief Restart the list of processes that have been registered to the host */
void SIMIX_host_autorestart(sg_host_t host)
{
- std::vector<simgrid::kernel::actor::ProcessArg*> process_list = host->pimpl_->auto_restart_processes;
+ std::vector<simgrid::kernel::actor::ProcessArg*> process_list = host->pimpl_->auto_restart_processes_;
for (auto const& arg : process_list) {
XBT_DEBUG("Restarting Process %s@%s right now", arg->name.c_str(), arg->host->get_cname());
}
//identify neighbours in comm
//get the indices of all processes sharing the same simix host
- auto& process_list = sg_host_self()->pimpl_->process_list;
+ auto& process_list = sg_host_self()->pimpl_->process_list_;
int intra_comm_size = 0;
int min_index = INT_MAX; // the minimum index will be the leader
for (auto& actor : process_list) {
HostImpl::~HostImpl()
{
/* All processes should be gone when the host is turned off (by the end of the simulation). */
- if (not process_list.empty()) {
+ if (not process_list_.empty()) {
std::string msg = std::string("Shutting down host, but it's not empty:");
- for (auto const& process : process_list)
+ for (auto const& process : process_list_)
msg += "\n\t" + std::string(process.get_name());
SIMIX_display_process_status();
THROWF(arg_error, 0, "%s", msg.c_str());
}
- for (auto const& arg : auto_restart_processes)
+ for (auto const& arg : auto_restart_processes_)
delete arg;
- auto_restart_processes.clear();
- for (auto const& arg : boot_processes)
+ auto_restart_processes_.clear();
+ for (auto const& arg : boot_processes_)
delete arg;
- boot_processes.clear();
+ boot_processes_.clear();
}
/** Re-starts all the actors that are marked as restartable.
*/
void HostImpl::turn_on()
{
- for (auto const& arg : boot_processes) {
+ for (auto const& arg : boot_processes_) {
XBT_DEBUG("Booting Process %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);
/** Kill all actors hosted here */
void HostImpl::turn_off()
{
- if (not process_list.empty()) {
- for (auto& actor : process_list) {
+ 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(),
actor.host_->get_cname(), SIMIX_process_self()->get_cname());
std::vector<s4u::ActorPtr> HostImpl::get_all_actors()
{
std::vector<s4u::ActorPtr> res;
- for (auto& actor : process_list)
+ for (auto& actor : process_list_)
res.push_back(actor.ciface());
return res;
}
int HostImpl::get_actor_count()
{
- return process_list.size();
+ return process_list_.size();
}
std::vector<const char*> HostImpl::get_attached_storages()
{
ActorList;
// FIXME: make these private
- ActorList process_list;
- std::vector<kernel::actor::ProcessArg*> auto_restart_processes;
- std::vector<kernel::actor::ProcessArg*> boot_processes;
+ ActorList process_list_;
+ std::vector<kernel::actor::ProcessArg*> auto_restart_processes_;
+ std::vector<kernel::actor::ProcessArg*> boot_processes_;
};
}
}
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_->boot_processes_.push_back(arg);
if (start_time > SIMIX_get_clock()) {
/* log - a generic logging facility in the spirit of log4j */
-/* Copyright (c) 2004-2018. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2004-2018. 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. */
-/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2017-2018. 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. */