From c84dc84beaec1cdcf7a49f1247cbc390414feaa0 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 26 Jul 2016 11:33:19 +0200 Subject: [PATCH] Rename the S4U interface stored in internal objects as piface --- src/s4u/s4u_mailbox.cpp | 2 +- src/simix/smx_global.cpp | 4 ++-- src/simix/smx_network_private.h | 4 ++-- src/surf/HostImpl.cpp | 8 ++++---- src/surf/HostImpl.hpp | 4 ++-- src/surf/plugins/energy.cpp | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/s4u/s4u_mailbox.cpp b/src/s4u/s4u_mailbox.cpp index ed93710d70..bba9fd2a13 100644 --- a/src/s4u/s4u_mailbox.cpp +++ b/src/s4u/s4u_mailbox.cpp @@ -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() { diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 1e04e8672a..a995c4502c 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -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) diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index ca85abf0db..fb1e1cf447 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -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 comm_queue; boost::intrusive_ptr permanent_receiver; //process which the mailbox is attached to diff --git a/src/surf/HostImpl.cpp b/src/surf/HostImpl.cpp index 9d83d4bfee..c893a4f37c 100644 --- a/src/surf/HostImpl.cpp +++ b/src/surf/HostImpl.cpp @@ -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); } } diff --git a/src/surf/HostImpl.hpp b/src/surf/HostImpl.hpp index da9970bd00..0849c4368a 100644 --- a/src/surf/HostImpl.hpp +++ b/src/surf/HostImpl.hpp @@ -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; }; diff --git a/src/surf/plugins/energy.cpp b/src/surf/plugins/energy.cpp index d457bcea04..c333364b4f 100644 --- a/src/surf/plugins/energy.cpp +++ b/src/surf/plugins/energy.cpp @@ -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(); - HostEnergy *host_energy = host->p_host->extension(); + HostEnergy *host_energy = host->piface->extension(); if(host_energy->last_updated < surf_get_clock()) host_energy->update(); -- 2.20.1