Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename the S4U interface stored in internal objects as piface
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 26 Jul 2016 09:33:19 +0000 (11:33 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 26 Jul 2016 09:33:19 +0000 (11:33 +0200)
src/s4u/s4u_mailbox.cpp
src/simix/smx_global.cpp
src/simix/smx_network_private.h
src/surf/HostImpl.cpp
src/surf/HostImpl.hpp
src/surf/plugins/energy.cpp

index ed93710..bba9fd2 100644 (file)
@@ -31,7 +31,7 @@ MailboxPtr Mailbox::byName(const char*name) {
   smx_mailbox_t mbox = simcall_mbox_get_by_name(name);
   if (mbox == nullptr)
     mbox = simcall_mbox_create(name);
-  return MailboxPtr(&mbox->mbox_, true);
+  return MailboxPtr(&mbox->piface_, true);
 }
 
 bool Mailbox::empty() {
index 1e04e86..a995c45 100644 (file)
@@ -357,12 +357,12 @@ static void SIMIX_wake_processes()
   surf_action_t action;
 
   xbt_dynar_foreach(all_existing_models, iter, model) {
-    XBT_DEBUG("Handling process whose action failed");
+    XBT_DEBUG("Handling the processes whose action failed (if any)");
     while ((action = surf_model_extract_failed_action_set(model))) {
       XBT_DEBUG("   Handling Action %p",action);
       SIMIX_simcall_exit((smx_synchro_t) action->getData());
     }
-    XBT_DEBUG("Handling process whose action terminated normally");
+    XBT_DEBUG("Handling the processes whose action terminated normally (if any)");
     while ((action = surf_model_extract_done_action_set(model))) {
       XBT_DEBUG("   Handling Action %p",action);
       if (action->getData() == nullptr)
index ca85abf..fb1e1cf 100644 (file)
@@ -27,12 +27,12 @@ namespace simix {
 
 class Mailbox {
 public:
-  Mailbox(const char* name) : mbox_(this), name(xbt_strdup(name)) {}
+  Mailbox(const char* name) : piface_(this), name(xbt_strdup(name)) {}
   ~Mailbox() {
     xbt_free(name);
   }
 
-  simgrid::s4u::Mailbox mbox_;
+  simgrid::s4u::Mailbox piface_; // Our interface
   char* name;
   std::deque<smx_synchro_t> comm_queue;
   boost::intrusive_ptr<simgrid::simix::Process> permanent_receiver; //process which the mailbox is attached to
index 9d83d4b..c893a4f 100644 (file)
@@ -151,10 +151,10 @@ HostImpl::~HostImpl()
 
 void HostImpl::attach(simgrid::s4u::Host* host)
 {
-  if (p_host != nullptr)
+  if (piface != nullptr)
     xbt_die("Already attached to host %s", host->name().c_str());
   host->extension_set(this);
-  p_host = host;
+  piface = host;
 }
 
 bool HostImpl::isOn() const {
@@ -166,13 +166,13 @@ bool HostImpl::isOff() const {
 void HostImpl::turnOn(){
   if (isOff()) {
     p_cpu->turnOn();
-    simgrid::s4u::Host::onStateChange(*this->p_host);
+    simgrid::s4u::Host::onStateChange(*this->piface);
   }
 }
 void HostImpl::turnOff(){
   if (isOn()) {
     p_cpu->turnOff();
-    simgrid::s4u::Host::onStateChange(*this->p_host);
+    simgrid::s4u::Host::onStateChange(*this->piface);
   }
 }
 
index da9970b..0849c43 100644 (file)
@@ -229,7 +229,7 @@ public:
 public:
   xbt_dynar_t p_storage;
   Cpu *p_cpu;
-  simgrid::s4u::Host* p_host = nullptr;
+  simgrid::s4u::Host* piface = nullptr;
 
   /** @brief Get the list of virtual machines on the current Host */
   xbt_dynar_t getVms();
@@ -240,7 +240,7 @@ public:
   void getParams(vm_params_t params);
   /** @brief Sets the params of that VM/PM */
   void setParams(vm_params_t params);
-  simgrid::s4u::Host* getHost() { return p_host; }
+  simgrid::s4u::Host* getHost() { return piface; }
 private:
   s_vm_params_t p_params;
 };
index d457bce..c333364 100644 (file)
@@ -219,7 +219,7 @@ static void onActionStateChange(simgrid::surf::CpuAction *action, simgrid::surf:
     if (vm) // If it's a VM, take the corresponding PM
       host = vm->getPm()->extension<simgrid::surf::HostImpl>();
 
-    HostEnergy *host_energy = host->p_host->extension<HostEnergy>();
+    HostEnergy *host_energy = host->piface->extension<HostEnergy>();
 
     if(host_energy->last_updated < surf_get_clock())
       host_energy->update();