Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
some process to actor renaming
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 24 Oct 2019 11:03:55 +0000 (13:03 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 24 Oct 2019 11:03:55 +0000 (13:03 +0200)
src/kernel/actor/ActorImpl.cpp
src/kernel/actor/ActorImpl.hpp
src/plugins/vm/VirtualMachineImpl.cpp
src/smpi/mpi/smpi_comm.cpp
src/surf/HostImpl.cpp
src/surf/HostImpl.hpp

index 8ac6401..afb141f 100644 (file)
@@ -98,7 +98,7 @@ ActorImplPtr ActorImpl::attach(const std::string& name, void* data, s4u::Host* h
     actor->set_properties(*properties);
 
   /* Add the process to it's host process list */
-  host->pimpl_->process_list_.push_back(*actor);
+  host->pimpl_->actor_list_.push_back(*actor);
 
   /* Now insert it in the global process list and in the process to run list */
   simix_global->process_list[actor->get_pid()] = actor;
@@ -171,8 +171,8 @@ void ActorImpl::cleanup()
   simix_global->mutex.lock();
 
   simix_global->process_list.erase(pid_);
-  if (host_ && host_process_list_hook.is_linked())
-    simgrid::xbt::intrusive_erase(host_->pimpl_->process_list_, *this);
+  if (host_ && host_actor_list_hook.is_linked())
+    simgrid::xbt::intrusive_erase(host_->pimpl_->actor_list_, *this);
   if (not smx_destroy_list_hook.is_linked()) {
 #if SIMGRID_HAVE_MC
     xbt_dynar_push_as(simix_global->dead_actors_vector, ActorImpl*, this);
@@ -443,9 +443,9 @@ void ActorImpl::simcall_answer()
 
 void ActorImpl::set_host(s4u::Host* dest)
 {
-  xbt::intrusive_erase(host_->pimpl_->process_list_, *this);
+  xbt::intrusive_erase(host_->pimpl_->actor_list_, *this);
   host_ = dest;
-  dest->pimpl_->process_list_.push_back(*this);
+  dest->pimpl_->actor_list_.push_back(*this);
 }
 
 ActorImplPtr ActorImpl::init(const std::string& name, s4u::Host* host)
@@ -477,7 +477,7 @@ ActorImpl* ActorImpl::start(const simix::ActorCode& code)
   XBT_DEBUG("Start context '%s'", get_cname());
 
   /* Add the actor to its host's actor list */
-  host_->pimpl_->process_list_.push_back(*this);
+  host_->pimpl_->actor_list_.push_back(*this);
   simix_global->process_list[pid_] = this;
 
   /* Now insert it in the global actor list and in the actor to run list */
index ee082de..21373ea 100644 (file)
@@ -36,7 +36,7 @@ public:
 
   double get_kill_time();
   void set_kill_time(double kill_time);
-  boost::intrusive::list_member_hook<> host_process_list_hook; /* simgrid::simix::Host::process_list */
+  boost::intrusive::list_member_hook<> host_actor_list_hook;   /* simgrid::simix::Host::process_list */
   boost::intrusive::list_member_hook<> smx_destroy_list_hook;  /* simix_global->actors_to_destroy */
   boost::intrusive::list_member_hook<> smx_synchro_hook;       /* {mutex,cond,sem}->sleeping */
 
index 51fae17..bcbe62a 100644 (file)
@@ -200,16 +200,16 @@ void VirtualMachineImpl::suspend(smx_actor_t issuer)
     throw VmFailureException(XBT_THROW_POINT, xbt::string_printf("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 actors exist", piface_->get_cname(), actor_list_.size());
 
   action_->suspend();
 
-  for (auto& smx_process : process_list_) {
-    XBT_DEBUG("suspend %s", smx_process.get_cname());
-    smx_process.suspend();
+  for (auto& actor : actor_list_) {
+    XBT_DEBUG("suspend %s", actor.get_cname());
+    actor.suspend();
   }
 
-  XBT_DEBUG("suspend all processes on the VM done done");
+  XBT_DEBUG("suspend all actors on the VM done done");
 
   vm_state_ = s4u::VirtualMachine::state::SUSPENDED;
 }
@@ -220,13 +220,13 @@ void VirtualMachineImpl::resume()
     throw VmFailureException(XBT_THROW_POINT,
                              xbt::string_printf("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 actors.", piface_->get_cname(), actor_list_.size());
 
   action_->resume();
 
-  for (auto& smx_process : process_list_) {
-    XBT_DEBUG("resume %s", smx_process.get_cname());
-    smx_process.resume();
+  for (auto& actor : actor_list_) {
+    XBT_DEBUG("resume %s", actor.get_cname());
+    actor.resume();
   }
 
   vm_state_ = s4u::VirtualMachine::state::RUNNING;
@@ -259,12 +259,12 @@ 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 actors", piface_->get_cname(), actor_list_.size());
 
-  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.get_host()->get_cname(), issuer->get_cname());
-    issuer->kill(&smx_process);
+  for (auto& actor : actor_list_) {
+    XBT_DEBUG("kill %s@%s on behalf of %s which shutdown that VM.", actor.get_cname(), actor.get_host()->get_cname(),
+              issuer->get_cname());
+    issuer->kill(&actor);
   }
 
   set_state(s4u::VirtualMachine::state::DESTROYED);
index c404c1b..e8e893f 100644 (file)
@@ -340,10 +340,10 @@ void Comm::unref(Comm* comm){
 
 MPI_Comm Comm::find_intra_comm(int * leader){
   //get the indices of all processes sharing the same simix host
-  auto& process_list      = sg_host_self()->pimpl_->process_list_;
+  auto& actor_list        = sg_host_self()->pimpl_->actor_list_;
   int intra_comm_size     = 0;
   int min_index           = INT_MAX; // the minimum index will be the leader
-  for (auto& actor : process_list) {
+  for (auto& actor : actor_list) {
     int index = actor.get_pid();
     if (this->group()->rank(actor.ciface()) != MPI_UNDEFINED) { // Is this process in the current group?
       intra_comm_size++;
@@ -354,7 +354,7 @@ MPI_Comm Comm::find_intra_comm(int * leader){
   XBT_DEBUG("number of processes deployed on my node : %d", intra_comm_size);
   MPI_Group group_intra = new  Group(intra_comm_size);
   int i = 0;
-  for (auto& actor : process_list) {
+  for (auto& actor : actor_list) {
     if (this->group()->rank(actor.ciface()) != MPI_UNDEFINED) {
       group_intra->set_mapping(actor.ciface(), i);
       i++;
index c5817fe..1b96df7 100644 (file)
@@ -81,9 +81,9 @@ 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 actor_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 : actor_list_)
       msg += "\n\t" + std::string(process.get_name());
 
     SIMIX_display_process_status();
@@ -121,8 +121,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 actor_list_.empty()) {
+    for (auto& actor : actor_list_) {
       XBT_DEBUG("Killing Actor %s@%s on behalf of %s which turned off that host.", actor.get_cname(),
                 actor.get_host()->get_cname(), SIMIX_process_self()->get_cname());
       SIMIX_process_self()->kill(&actor);
@@ -142,13 +142,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 : actor_list_)
     res.push_back(actor.ciface());
   return res;
 }
 size_t HostImpl::get_actor_count()
 {
-  return process_list_.size();
+  return actor_list_.size();
 }
 
 std::vector<s4u::Disk*> HostImpl::get_disks()
index 6583e66..1d39ec6 100644 (file)
@@ -68,11 +68,11 @@ public:
   typedef boost::intrusive::list<
       kernel::actor::ActorImpl,
       boost::intrusive::member_hook<kernel::actor::ActorImpl, boost::intrusive::list_member_hook<>,
-                                    &kernel::actor::ActorImpl::host_process_list_hook>>
+                                    &kernel::actor::ActorImpl::host_actor_list_hook>>
       ActorList;
 
   // FIXME: make these private
-  ActorList process_list_;
+  ActorList actor_list_;
   std::vector<kernel::actor::ProcessArg*> actors_at_boot_;
 };
 }