Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 3 Jul 2018 20:51:22 +0000 (22:51 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 3 Jul 2018 20:51:22 +0000 (22:51 +0200)
src/plugins/vm/VirtualMachineImpl.cpp
src/simix/ActorImpl.cpp
src/simix/smx_host.cpp
src/smpi/mpi/smpi_comm.cpp
src/surf/HostImpl.cpp
src/surf/HostImpl.hpp
src/surf/sg_platf.cpp
src/xbt/log.c
teshsuite/s4u/actor-autorestart/actor-autorestart.cpp

index 9e7fa1e..ceae075 100644 (file)
@@ -147,11 +147,11 @@ void VirtualMachineImpl::suspend(smx_actor_t issuer)
     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);
   }
@@ -166,11 +166,11 @@ void VirtualMachineImpl::resume()
   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();
   }
@@ -206,9 +206,9 @@ void VirtualMachineImpl::shutdown(smx_actor_t issuer)
     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);
index 6c4f2a1..aed56e7 100644 (file)
@@ -104,7 +104,7 @@ void SIMIX_process_cleanup(smx_actor_t process)
   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);
@@ -316,7 +316,7 @@ smx_actor_t SIMIX_process_create(const char* name, simgrid::simix::ActorCode cod
       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());
 
@@ -373,7 +373,7 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn
       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;
@@ -567,9 +567,9 @@ void SIMIX_process_killall(smx_actor_t issuer)
 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)
index aedf946..3b1cde9 100644 (file)
@@ -40,13 +40,13 @@ void SIMIX_host_add_auto_restart_process(sg_host_t host, simgrid::kernel::actor:
     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());
index f3b50db..8eb30b5 100644 (file)
@@ -300,7 +300,7 @@ void Comm::init_smp(){
   }
   //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) {
index b24d0c0..1084bc0 100644 (file)
@@ -105,20 +105,20 @@ HostImpl::HostImpl(s4u::Host* host) : piface_(host)
 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.
@@ -127,7 +127,7 @@ HostImpl::~HostImpl()
  */
 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);
@@ -140,8 +140,8 @@ void HostImpl::turn_on()
 /** 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());
@@ -152,13 +152,13 @@ void HostImpl::turn_off()
 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()
 {
index a206e76..6672d7a 100644 (file)
@@ -65,9 +65,9 @@ public:
       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_;
 };
 }
 }
index eeb26bc..5f87f2e 100644 (file)
@@ -444,7 +444,7 @@ void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor)
   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()) {
 
index 7853627..3b665d9 100644 (file)
@@ -1,7 +1,6 @@
 /* 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. */
index 5962c5b..bb2d964 100644 (file)
@@ -1,4 +1,4 @@
-/* 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. */