Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case some easy parts of s4u::Host
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 23 May 2018 16:04:28 +0000 (18:04 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 23 May 2018 16:04:33 +0000 (18:04 +0200)
This will make the interesting parts of the commit more readable.

15 files changed:
examples/s4u/energy-boot/s4u-energy-boot.cpp
examples/s4u/energy-exec/s4u-energy-exec.cpp
examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp
examples/s4u/plugin-hostload/s4u-plugin-hostload.cpp
examples/simdag/test/sd_test.cpp
include/simgrid/s4u/Host.hpp
src/instr/instr_platform.cpp
src/plugins/vm/s4u_VirtualMachine.cpp
src/s4u/s4u_Host.cpp
src/surf/network_cm02.cpp
src/surf/plugins/host_dvfs.cpp
src/surf/plugins/host_energy.cpp
src/surf/plugins/host_load.cpp
src/surf/ptask_L07.cpp
teshsuite/simdag/flatifier/flatifier.cpp

index d631c00..9db9435 100644 (file)
@@ -37,10 +37,10 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this example");
 
 static void simulate_bootup(simgrid::s4u::Host* host)
 {
 
 static void simulate_bootup(simgrid::s4u::Host* host)
 {
-  int previous_pstate = host->getPstate();
+  int previous_pstate = host->get_pstate();
 
   XBT_INFO("Switch to virtual pstate 3, that encodes the 'booting up' state in that platform");
 
   XBT_INFO("Switch to virtual pstate 3, that encodes the 'booting up' state in that platform");
-  host->setPstate(3);
+  host->set_pstate(3);
 
   XBT_INFO("Actually start the host");
   host->turn_on();
 
   XBT_INFO("Actually start the host");
   host->turn_on();
@@ -49,21 +49,21 @@ static void simulate_bootup(simgrid::s4u::Host* host)
   simgrid::s4u::this_actor::sleep_for(150);
 
   XBT_INFO("The host is now up and running. Switch back to previous pstate %d", previous_pstate);
   simgrid::s4u::this_actor::sleep_for(150);
 
   XBT_INFO("The host is now up and running. Switch back to previous pstate %d", previous_pstate);
-  host->setPstate(previous_pstate);
+  host->set_pstate(previous_pstate);
 }
 
 static void simulate_shutdown(simgrid::s4u::Host* host)
 {
 }
 
 static void simulate_shutdown(simgrid::s4u::Host* host)
 {
-  int previous_pstate = host->getPstate();
+  int previous_pstate = host->get_pstate();
 
   XBT_INFO("Switch to virtual pstate 4, that encodes the 'shutting down' state in that platform");
 
   XBT_INFO("Switch to virtual pstate 4, that encodes the 'shutting down' state in that platform");
-  host->setPstate(4);
+  host->set_pstate(4);
 
   XBT_INFO("Wait 7 seconds to simulate the shutdown time.");
   simgrid::s4u::this_actor::sleep_for(7);
 
   XBT_INFO("Switch back to previous pstate %d, that will be used on reboot.", previous_pstate);
 
   XBT_INFO("Wait 7 seconds to simulate the shutdown time.");
   simgrid::s4u::this_actor::sleep_for(7);
 
   XBT_INFO("Switch back to previous pstate %d, that will be used on reboot.", previous_pstate);
-  host->setPstate(previous_pstate);
+  host->set_pstate(previous_pstate);
 
   XBT_INFO("Actually shutdown the host");
   host->turn_off();
 
   XBT_INFO("Actually shutdown the host");
   host->turn_off();
@@ -73,25 +73,25 @@ static int monitor()
 {
   simgrid::s4u::Host* host1 = simgrid::s4u::Host::by_name("MyHost1");
 
 {
   simgrid::s4u::Host* host1 = simgrid::s4u::Host::by_name("MyHost1");
 
-  XBT_INFO("Initial pstate: %d; Energy dissipated so far:%.0E J", host1->getPstate(),
+  XBT_INFO("Initial pstate: %d; Energy dissipated so far:%.0E J", host1->get_pstate(),
            sg_host_get_consumed_energy(host1));
 
   XBT_INFO("Sleep for 10 seconds");
   simgrid::s4u::this_actor::sleep_for(10);
            sg_host_get_consumed_energy(host1));
 
   XBT_INFO("Sleep for 10 seconds");
   simgrid::s4u::this_actor::sleep_for(10);
-  XBT_INFO("Done sleeping. Current pstate: %d; Energy dissipated so far: %.2f J", host1->getPstate(),
+  XBT_INFO("Done sleeping. Current pstate: %d; Energy dissipated so far: %.2f J", host1->get_pstate(),
            sg_host_get_consumed_energy(host1));
 
   simulate_shutdown(host1);
            sg_host_get_consumed_energy(host1));
 
   simulate_shutdown(host1);
-  XBT_INFO("Host1 is now OFF. Current pstate: %d; Energy dissipated so far: %.2f J", host1->getPstate(),
+  XBT_INFO("Host1 is now OFF. Current pstate: %d; Energy dissipated so far: %.2f J", host1->get_pstate(),
            sg_host_get_consumed_energy(host1));
 
   XBT_INFO("Sleep for 10 seconds");
   simgrid::s4u::this_actor::sleep_for(10);
            sg_host_get_consumed_energy(host1));
 
   XBT_INFO("Sleep for 10 seconds");
   simgrid::s4u::this_actor::sleep_for(10);
-  XBT_INFO("Done sleeping. Current pstate: %d; Energy dissipated so far: %.2f J", host1->getPstate(),
+  XBT_INFO("Done sleeping. Current pstate: %d; Energy dissipated so far: %.2f J", host1->get_pstate(),
            sg_host_get_consumed_energy(host1));
 
   simulate_bootup(host1);
            sg_host_get_consumed_energy(host1));
 
   simulate_bootup(host1);
-  XBT_INFO("Host1 is now ON again. Current pstate: %d; Energy dissipated so far: %.2f J", host1->getPstate(),
+  XBT_INFO("Host1 is now ON again. Current pstate: %d; Energy dissipated so far: %.2f J", host1->get_pstate(),
            sg_host_get_consumed_energy(host1));
 
   return 0;
            sg_host_get_consumed_energy(host1));
 
   return 0;
index 846bc6d..1a30be2 100644 (file)
@@ -31,12 +31,12 @@ static void dvfs()
   XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Current consumption: from %.0fW to %.0fW"
            " depending on load; Energy dissipated=%.0f J",
            simgrid::s4u::Engine::get_clock() - start, host1->getSpeed(),
   XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Current consumption: from %.0fW to %.0fW"
            " depending on load; Energy dissipated=%.0f J",
            simgrid::s4u::Engine::get_clock() - start, host1->getSpeed(),
-           sg_host_get_wattmin_at(host1, host1->getPstate()), sg_host_get_wattmax_at(host1, host1->getPstate()),
+           sg_host_get_wattmin_at(host1, host1->get_pstate()), sg_host_get_wattmax_at(host1, host1->get_pstate()),
            sg_host_get_consumed_energy(host1));
 
   // ========= Change power peak =========
   int pstate = 2;
            sg_host_get_consumed_energy(host1));
 
   // ========= Change power peak =========
   int pstate = 2;
-  host1->setPstate(pstate);
+  host1->set_pstate(pstate);
   XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s)", pstate,
            host1->getPstateSpeed(pstate), host1->getSpeed());
 
   XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s)", pstate,
            host1->getPstateSpeed(pstate), host1->getSpeed());
 
index c9d712f..81abcf6 100644 (file)
@@ -12,7 +12,7 @@ static int dvfs()
   double workload = 100E6;
   simgrid::s4u::Host* host = simgrid::s4u::this_actor::get_host();
 
   double workload = 100E6;
   simgrid::s4u::Host* host = simgrid::s4u::this_actor::get_host();
 
-  int nb = host->getPstatesCount();
+  int nb = host->get_pstate_count();
   XBT_INFO("Count of Processor states=%d", nb);
 
   XBT_INFO("Current power peak=%f", host->getSpeed());
   XBT_INFO("Count of Processor states=%d", nb);
 
   XBT_INFO("Current power peak=%f", host->getSpeed());
@@ -28,7 +28,7 @@ static int dvfs()
 
   XBT_INFO("Changing power peak value to %f (at index %d)", host->getPstateSpeed(new_pstate), new_pstate);
 
 
   XBT_INFO("Changing power peak value to %f (at index %d)", host->getPstateSpeed(new_pstate), new_pstate);
 
-  host->setPstate(new_pstate);
+  host->set_pstate(new_pstate);
 
   XBT_INFO("Current power peak=%f", host->getSpeed());
 
 
   XBT_INFO("Current power peak=%f", host->getSpeed());
 
@@ -40,7 +40,7 @@ static int dvfs()
 
   // Verify that the default pstate is set to 0
   host = simgrid::s4u::Host::by_name_or_null("MyHost2");
 
   // Verify that the default pstate is set to 0
   host = simgrid::s4u::Host::by_name_or_null("MyHost2");
-  XBT_INFO("Count of Processor states=%d", host->getPstatesCount());
+  XBT_INFO("Count of Processor states=%d", host->get_pstate_count());
 
   XBT_INFO("Current power peak=%f", host->getSpeed());
   return 0;
 
   XBT_INFO("Current power peak=%f", host->getSpeed());
   return 0;
index c185785..ac8962a 100644 (file)
@@ -35,12 +35,12 @@ static void execute_load_test()
            simgrid::s4u::Engine::get_clock() - start, host->getSpeed(), speed, sg_host_get_computed_flops(host),
            sg_host_get_avg_load(host),
            static_cast<double>(200E6) /
            simgrid::s4u::Engine::get_clock() - start, host->getSpeed(), speed, sg_host_get_computed_flops(host),
            sg_host_get_avg_load(host),
            static_cast<double>(200E6) /
-               (10.5 * speed * host->getCoreCount() +
-                (simgrid::s4u::Engine::get_clock() - start - 0.5) * host->getSpeed() * host->getCoreCount()));
+               (10.5 * speed * host->get_core_count() +
+                (simgrid::s4u::Engine::get_clock() - start - 0.5) * host->getSpeed() * host->get_core_count()));
 
   // ========= Change power peak =========
   int pstate = 1;
 
   // ========= Change power peak =========
   int pstate = 1;
-  host->setPstate(pstate);
+  host->set_pstate(pstate);
   XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s, average load is %.5f)", pstate,
            host->getPstateSpeed(pstate), host->getSpeed(), sg_host_get_avg_load(host));
 
   XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s, average load is %.5f)", pstate,
            host->getPstateSpeed(pstate), host->getSpeed(), sg_host_get_avg_load(host));
 
@@ -78,7 +78,7 @@ static void change_speed()
   simgrid::s4u::this_actor::sleep_for(10.5);
   XBT_INFO("I slept until now, but now I'll change the speed of this host "
       "while the other process is still computing! This should slow the computation down.");
   simgrid::s4u::this_actor::sleep_for(10.5);
   XBT_INFO("I slept until now, but now I'll change the speed of this host "
       "while the other process is still computing! This should slow the computation down.");
-  host->setPstate(2);
+  host->set_pstate(2);
 }
 
 int main(int argc, char* argv[])
 }
 
 int main(int argc, char* argv[])
index ea379dc..35ce7c0 100644 (file)
@@ -39,7 +39,7 @@ int main(int argc, char **argv)
   XBT_INFO("Route between %s and %s:", h1->get_cname(), h2->get_cname());
   std::vector<sg_link_t> route;
   double latency = 0;
   XBT_INFO("Route between %s and %s:", h1->get_cname(), h2->get_cname());
   std::vector<sg_link_t> route;
   double latency = 0;
-  h1->routeTo(h2, route, &latency);
+  h1->route_to(h2, route, &latency);
 
   for (auto const& link : route)
     XBT_INFO("   Link %s: latency = %f, bandwidth = %f", sg_link_name(link), sg_link_latency(link),
 
   for (auto const& link : route)
     XBT_INFO("   Link %s: latency = %f, bandwidth = %f", sg_link_name(link), sg_link_latency(link),
index ab6cb8b..87f6cbb 100644 (file)
@@ -102,12 +102,12 @@ public:
 
   double getSpeed();
   double get_available_speed();
 
   double getSpeed();
   double get_available_speed();
-  int getCoreCount();
+  int get_core_count();
 
   double getPstateSpeed(int pstate_index);
 
   double getPstateSpeed(int pstate_index);
-  int getPstatesCount() const;
-  void setPstate(int pstate_index);
-  int getPstate();
+  int get_pstate_count() const;
+  void set_pstate(int pstate_index);
+  int get_pstate();
 
   std::vector<const char*> get_attached_storages();
   XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_attached_storages() instead.") void getAttachedStorages(
 
   std::vector<const char*> get_attached_storages();
   XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_attached_storages() instead.") void getAttachedStorages(
@@ -119,8 +119,8 @@ public:
    */
   std::unordered_map<std::string, Storage*> const& getMountedStorages();
 
    */
   std::unordered_map<std::string, Storage*> const& getMountedStorages();
 
-  void routeTo(Host* dest, std::vector<Link*>& links, double* latency);
-  void routeTo(Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency);
+  void route_to(Host* dest, std::vector<Link*>& links, double* latency);
+  void route_to(Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency);
 
   /** Block the calling actor on an execution located on the called host
    *
 
   /** Block the calling actor on an execution located on the called host
    *
@@ -159,6 +159,24 @@ public:
   {
     set_property(key, value);
   }
   {
     set_property(key, value);
   }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::set_pstate()") void setPstate(int idx) { set_pstate(idx); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_pstate()") int getPstate() { return get_pstate(); }
+
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::route_to()") void routeTo(Host* dest, std::vector<Link*>& links,
+                                                                         double* latency)
+  {
+    route_to(dest, links, latency);
+  }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::route_to()") void routeTo(
+      Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency)
+  {
+    route_to(dest, links, latency);
+  }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_core_count()") int getCoreCount() { return get_core_count(); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_pstate_count()") int getPstatesCount() const
+  {
+    return get_pstate_count();
+  }
 
 private:
   simgrid::xbt::string name_{"noname"};
 
 private:
   simgrid::xbt::string name_{"noname"};
index 7bbf6bf..985c506 100644 (file)
@@ -229,7 +229,7 @@ static void instr_host_on_speed_change(simgrid::s4u::Host& host)
 {
   simgrid::instr::Container::by_name(host.get_cname())
       ->get_variable("power")
 {
   simgrid::instr::Container::by_name(host.get_cname())
       ->get_variable("power")
-      ->set_event(surf_get_clock(), host.getCoreCount() * host.get_available_speed());
+      ->set_event(surf_get_clock(), host.get_core_count() * host.get_available_speed());
 }
 
 static void instr_cpu_action_on_state_change(simgrid::surf::CpuAction* action,
 }
 
 static void instr_cpu_action_on_state_change(simgrid::surf::CpuAction* action,
index 5119271..af76685 100644 (file)
@@ -36,12 +36,12 @@ VirtualMachine::VirtualMachine(const char* name, s4u::Host* pm, int coreAmount,
 
   // Create a VCPU for this VM
   std::vector<double> speeds;
 
   // Create a VCPU for this VM
   std::vector<double> speeds;
-  for (int i = 0; i < pm->getPstatesCount(); i++)
+  for (int i = 0; i < pm->get_pstate_count(); i++)
     speeds.push_back(pm->getPstateSpeed(i));
 
     speeds.push_back(pm->getPstateSpeed(i));
 
-  surf_cpu_model_vm->create_cpu(this, &speeds, pm->getCoreCount());
-  if (pm->getPstate() != 0)
-    setPstate(pm->getPstate());
+  surf_cpu_model_vm->create_cpu(this, &speeds, pm->get_core_count());
+  if (pm->get_pstate() != 0)
+    set_pstate(pm->get_pstate());
 
   /* Make a process container */
   extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
 
   /* Make a process container */
   extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
index 3ac5c47..f345566 100644 (file)
@@ -131,7 +131,7 @@ bool Host::is_on()
   return this->pimpl_cpu->is_on();
 }
 
   return this->pimpl_cpu->is_on();
 }
 
-int Host::getPstatesCount() const
+int Host::get_pstate_count() const
 {
   return this->pimpl_cpu->get_pstates_count();
 }
 {
   return this->pimpl_cpu->get_pstates_count();
 }
@@ -183,16 +183,16 @@ void Host::actorList(std::vector<ActorPtr>* whereto)
  * walk through the routing components tree and find a route between hosts
  * by calling each "get_route" function in each routing component.
  */
  * walk through the routing components tree and find a route between hosts
  * by calling each "get_route" function in each routing component.
  */
-void Host::routeTo(Host* dest, std::vector<Link*>& links, double* latency)
+void Host::route_to(Host* dest, std::vector<Link*>& links, double* latency)
 {
   std::vector<kernel::resource::LinkImpl*> linkImpls;
 {
   std::vector<kernel::resource::LinkImpl*> linkImpls;
-  this->routeTo(dest, linkImpls, latency);
+  this->route_to(dest, linkImpls, latency);
   for (kernel::resource::LinkImpl* const& l : linkImpls)
     links.push_back(&l->piface_);
 }
 
 /** @brief Just like Host::routeTo, but filling an array of link implementations */
   for (kernel::resource::LinkImpl* const& l : linkImpls)
     links.push_back(&l->piface_);
 }
 
 /** @brief Just like Host::routeTo, but filling an array of link implementations */
-void Host::routeTo(Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency)
+void Host::route_to(Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency)
 {
   simgrid::kernel::routing::NetZoneImpl::get_global_route(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
   if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
 {
   simgrid::kernel::routing::NetZoneImpl::get_global_route(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
   if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
@@ -244,18 +244,18 @@ double Host::get_available_speed()
 }
 
 /** @brief Returns the number of core of the processor. */
 }
 
 /** @brief Returns the number of core of the processor. */
-int Host::getCoreCount()
+int Host::get_core_count()
 {
   return this->pimpl_cpu->get_cores_count();
 }
 
 /** @brief Set the pstate at which the host should run */
 {
   return this->pimpl_cpu->get_cores_count();
 }
 
 /** @brief Set the pstate at which the host should run */
-void Host::setPstate(int pstate_index)
+void Host::set_pstate(int pstate_index)
 {
   simgrid::simix::simcall([this, pstate_index] { this->pimpl_cpu->set_pstate(pstate_index); });
 }
 /** @brief Retrieve the pstate at which the host is currently running */
 {
   simgrid::simix::simcall([this, pstate_index] { this->pimpl_cpu->set_pstate(pstate_index); });
 }
 /** @brief Retrieve the pstate at which the host is currently running */
-int Host::getPstate()
+int Host::get_pstate()
 {
   return this->pimpl_cpu->get_pstate();
 }
 {
   return this->pimpl_cpu->get_pstate();
 }
@@ -439,7 +439,7 @@ double sg_host_get_pstate_speed(sg_host_t host, int pstate_index)
  */
 int sg_host_core_count(sg_host_t host)
 {
  */
 int sg_host_core_count(sg_host_t host)
 {
-  return host->getCoreCount();
+  return host->get_core_count();
 }
 
 double sg_host_get_available_speed(sg_host_t host)
 }
 
 double sg_host_get_available_speed(sg_host_t host)
@@ -453,7 +453,7 @@ double sg_host_get_available_speed(sg_host_t host)
  */
 int sg_host_get_nb_pstates(sg_host_t host)
 {
  */
 int sg_host_get_nb_pstates(sg_host_t host)
 {
-  return host->getPstatesCount();
+  return host->get_pstate_count();
 }
 
 /** @brief Gets the pstate at which that host currently runs.
 }
 
 /** @brief Gets the pstate at which that host currently runs.
@@ -462,7 +462,7 @@ int sg_host_get_nb_pstates(sg_host_t host)
  */
 int sg_host_get_pstate(sg_host_t host)
 {
  */
 int sg_host_get_pstate(sg_host_t host)
 {
-  return host->getPstate();
+  return host->get_pstate();
 }
 /** @brief Sets the pstate at which that host should run.
  *
 }
 /** @brief Sets the pstate at which that host should run.
  *
@@ -470,7 +470,7 @@ int sg_host_get_pstate(sg_host_t host)
  */
 void sg_host_set_pstate(sg_host_t host, int pstate)
 {
  */
 void sg_host_set_pstate(sg_host_t host, int pstate)
 {
-  host->setPstate(pstate);
+  host->set_pstate(pstate);
 }
 
 /** \ingroup m_host_management
 }
 
 /** \ingroup m_host_management
@@ -562,7 +562,7 @@ void sg_host_set_property_value(sg_host_t host, const char* name, const char* va
 void sg_host_route(sg_host_t from, sg_host_t to, xbt_dynar_t links)
 {
   std::vector<simgrid::s4u::Link*> vlinks;
 void sg_host_route(sg_host_t from, sg_host_t to, xbt_dynar_t links)
 {
   std::vector<simgrid::s4u::Link*> vlinks;
-  from->routeTo(to, vlinks, nullptr);
+  from->route_to(to, vlinks, nullptr);
   for (auto const& link : vlinks)
     xbt_dynar_push(links, &link);
 }
   for (auto const& link : vlinks)
     xbt_dynar_push(links, &link);
 }
@@ -576,7 +576,7 @@ double sg_host_route_latency(sg_host_t from, sg_host_t to)
 {
   std::vector<simgrid::s4u::Link*> vlinks;
   double res = 0;
 {
   std::vector<simgrid::s4u::Link*> vlinks;
   double res = 0;
-  from->routeTo(to, vlinks, &res);
+  from->route_to(to, vlinks, &res);
   return res;
 }
 /**
   return res;
 }
 /**
@@ -590,7 +590,7 @@ double sg_host_route_bandwidth(sg_host_t from, sg_host_t to)
   double min_bandwidth = -1.0;
 
   std::vector<simgrid::s4u::Link*> vlinks;
   double min_bandwidth = -1.0;
 
   std::vector<simgrid::s4u::Link*> vlinks;
-  from->routeTo(to, vlinks, nullptr);
+  from->route_to(to, vlinks, nullptr);
   for (auto const& link : vlinks) {
     double bandwidth = link->get_bandwidth();
     if (bandwidth < min_bandwidth || min_bandwidth < 0.0)
   for (auto const& link : vlinks) {
     double bandwidth = link->get_bandwidth();
     if (bandwidth < min_bandwidth || min_bandwidth < 0.0)
index 2eed509..a0c0de0 100644 (file)
@@ -225,7 +225,7 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz
 
   XBT_IN("(%s,%s,%g,%g)", src->get_cname(), dst->get_cname(), size, rate);
 
 
   XBT_IN("(%s,%s,%g,%g)", src->get_cname(), dst->get_cname(), size, rate);
 
-  src->routeTo(dst, route, &latency);
+  src->route_to(dst, route, &latency);
   xbt_assert(not route.empty() || latency,
              "You're trying to send data from %s to %s but there is no connecting path between these two hosts.",
              src->get_cname(), dst->get_cname());
   xbt_assert(not route.empty() || latency,
              "You're trying to send data from %s to %s but there is no connecting path between these two hosts.",
              src->get_cname(), dst->get_cname());
@@ -233,7 +233,7 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz
   bool failed = std::any_of(route.begin(), route.end(), [](LinkImpl* link) { return link->is_off(); });
 
   if (cfg_crosstraffic) {
   bool failed = std::any_of(route.begin(), route.end(), [](LinkImpl* link) { return link->is_off(); });
 
   if (cfg_crosstraffic) {
-    dst->routeTo(src, back_route, nullptr);
+    dst->route_to(src, back_route, nullptr);
     if (not failed)
       failed = std::any_of(back_route.begin(), back_route.end(), [](LinkImpl* const& link) { return link->is_off(); });
   }
     if (not failed)
       failed = std::any_of(back_route.begin(), back_route.end(), [](LinkImpl* const& link) { return link->is_off(); });
   }
index af8ccc4..e23921f 100644 (file)
@@ -69,7 +69,7 @@ class Performance : public Governor {
 public:
   explicit Performance(simgrid::s4u::Host* ptr) : Governor(ptr) {}
 
 public:
   explicit Performance(simgrid::s4u::Host* ptr) : Governor(ptr) {}
 
-  void update() override { get_host()->setPstate(0); }
+  void update() override { get_host()->set_pstate(0); }
   std::string getName() override { return "Performance"; }
 };
 
   std::string getName() override { return "Performance"; }
 };
 
@@ -87,7 +87,7 @@ class Powersave : public Governor {
 public:
   explicit Powersave(simgrid::s4u::Host* ptr) : Governor(ptr) {}
 
 public:
   explicit Powersave(simgrid::s4u::Host* ptr) : Governor(ptr) {}
 
-  void update() override { get_host()->setPstate(get_host()->getPstatesCount() - 1); }
+  void update() override { get_host()->set_pstate(get_host()->get_pstate_count() - 1); }
   std::string getName() override { return "Powersave"; }
 };
 
   std::string getName() override { return "Powersave"; }
 };
 
@@ -113,11 +113,11 @@ public:
   std::string getName() override { return "OnDemand"; }
   void update() override
   {
   std::string getName() override { return "OnDemand"; }
   void update() override
   {
-    double load = get_host()->getCoreCount() * sg_host_get_avg_load(get_host());
+    double load = get_host()->get_core_count() * sg_host_get_avg_load(get_host());
     sg_host_load_reset(get_host()); // Only consider the period between two calls to this method!
 
     if (load > freq_up_threshold) {
     sg_host_load_reset(get_host()); // Only consider the period between two calls to this method!
 
     if (load > freq_up_threshold) {
-      get_host()->setPstate(0); /* Run at max. performance! */
+      get_host()->set_pstate(0); /* Run at max. performance! */
       XBT_INFO("Load: %f > threshold: %f --> changed to pstate %i", load, freq_up_threshold, 0);
     } else {
       /* The actual implementation uses a formula here: (See Kernel file cpufreq_ondemand.c:158)
       XBT_INFO("Load: %f > threshold: %f --> changed to pstate %i", load, freq_up_threshold, 0);
     } else {
       /* The actual implementation uses a formula here: (See Kernel file cpufreq_ondemand.c:158)
@@ -127,11 +127,11 @@ public:
        * So they assume that frequency increases by 100 MHz. We will just use
        * lowest_pstate - load*pstatesCount()
        */
        * So they assume that frequency increases by 100 MHz. We will just use
        * lowest_pstate - load*pstatesCount()
        */
-      int max_pstate = get_host()->getPstatesCount() - 1;
+      int max_pstate = get_host()->get_pstate_count() - 1;
       // Load is now < freq_up_threshold; exclude pstate 0 (the fastest)
       // because pstate 0 can only be selected if load > freq_up_threshold
       int new_pstate = max_pstate - load * (max_pstate + 1);
       // Load is now < freq_up_threshold; exclude pstate 0 (the fastest)
       // because pstate 0 can only be selected if load > freq_up_threshold
       int new_pstate = max_pstate - load * (max_pstate + 1);
-      get_host()->setPstate(new_pstate);
+      get_host()->set_pstate(new_pstate);
 
       XBT_DEBUG("Load: %f < threshold: %f --> changed to pstate %i", load, freq_up_threshold, new_pstate);
     }
 
       XBT_DEBUG("Load: %f < threshold: %f --> changed to pstate %i", load, freq_up_threshold, new_pstate);
     }
@@ -160,22 +160,22 @@ public:
   virtual std::string getName() override { return "Conservative"; }
   virtual void update() override
   {
   virtual std::string getName() override { return "Conservative"; }
   virtual void update() override
   {
-    double load = get_host()->getCoreCount() * sg_host_get_avg_load(get_host());
-    int pstate  = get_host()->getPstate();
+    double load = get_host()->get_core_count() * sg_host_get_avg_load(get_host());
+    int pstate  = get_host()->get_pstate();
     sg_host_load_reset(get_host()); // Only consider the period between two calls to this method!
 
     if (load > freq_up_threshold) {
       if (pstate != 0) {
     sg_host_load_reset(get_host()); // Only consider the period between two calls to this method!
 
     if (load > freq_up_threshold) {
       if (pstate != 0) {
-        get_host()->setPstate(pstate - 1);
+        get_host()->set_pstate(pstate - 1);
         XBT_INFO("Load: %f > threshold: %f -> increasing performance to pstate %d", load, freq_up_threshold, pstate - 1);
       }
       else {
         XBT_DEBUG("Load: %f > threshold: %f -> but cannot speed up even more, already in highest pstate %d", load, freq_up_threshold, pstate);
       }
     } else if (load < freq_down_threshold) {
         XBT_INFO("Load: %f > threshold: %f -> increasing performance to pstate %d", load, freq_up_threshold, pstate - 1);
       }
       else {
         XBT_DEBUG("Load: %f > threshold: %f -> but cannot speed up even more, already in highest pstate %d", load, freq_up_threshold, pstate);
       }
     } else if (load < freq_down_threshold) {
-      int max_pstate = get_host()->getPstatesCount() - 1;
+      int max_pstate = get_host()->get_pstate_count() - 1;
       if (pstate != max_pstate) { // Are we in the slowest pstate already?
       if (pstate != max_pstate) { // Are we in the slowest pstate already?
-        get_host()->setPstate(pstate + 1);
+        get_host()->set_pstate(pstate + 1);
         XBT_INFO("Load: %f < threshold: %f -> slowing down to pstate %d", load, freq_down_threshold, pstate + 1);
       }
       else {
         XBT_INFO("Load: %f < threshold: %f -> slowing down to pstate %d", load, freq_down_threshold, pstate + 1);
       }
       else {
index 4f4ecc9..dcd67a3 100644 (file)
@@ -176,7 +176,7 @@ void HostEnergy::update()
   }
 
   /* Save data for the upcoming time interval: whether it's on/off and the pstate if it's on */
   }
 
   /* Save data for the upcoming time interval: whether it's on/off and the pstate if it's on */
-  this->pstate = host->is_on() ? host->getPstate() : pstate_off;
+  this->pstate = host->is_on() ? host->get_pstate() : pstate_off;
 }
 
 HostEnergy::HostEnergy(simgrid::s4u::Host* ptr) : host(ptr), last_updated(surf_get_clock())
 }
 
 HostEnergy::HostEnergy(simgrid::s4u::Host* ptr) : host(ptr), last_updated(surf_get_clock())
@@ -286,7 +286,7 @@ double HostEnergy::getCurrentWattsValue(double cpu_load)
      * (maxCpuLoad is by definition 1)
      */
     double power_slope;
      * (maxCpuLoad is by definition 1)
      */
     double power_slope;
-    int coreCount         = host->getCoreCount();
+    int coreCount         = host->get_core_count();
     double coreReciprocal = static_cast<double>(1) / static_cast<double>(coreCount);
     if (coreCount > 1)
       power_slope = (max_power - min_power) / (1 - coreReciprocal);
     double coreReciprocal = static_cast<double>(1) / static_cast<double>(coreCount);
     if (coreCount > 1)
       power_slope = (max_power - min_power) / (1 - coreReciprocal);
@@ -320,14 +320,14 @@ void HostEnergy::initWattsRangeList()
 
   std::vector<std::string> all_power_values;
   boost::split(all_power_values, all_power_values_str, boost::is_any_of(","));
 
   std::vector<std::string> all_power_values;
   boost::split(all_power_values, all_power_values_str, boost::is_any_of(","));
-  XBT_DEBUG("%s: profile: %s, cores: %d", host->get_cname(), all_power_values_str, host->getCoreCount());
+  XBT_DEBUG("%s: profile: %s, cores: %d", host->get_cname(), all_power_values_str, host->get_core_count());
 
   int i = 0;
   for (auto const& current_power_values_str : all_power_values) {
     /* retrieve the power values associated with the current pstate */
     std::vector<std::string> current_power_values;
     boost::split(current_power_values, current_power_values_str, boost::is_any_of(":"));
 
   int i = 0;
   for (auto const& current_power_values_str : all_power_values) {
     /* retrieve the power values associated with the current pstate */
     std::vector<std::string> current_power_values;
     boost::split(current_power_values, current_power_values_str, boost::is_any_of(":"));
-    if (host->getCoreCount() == 1) {
+    if (host->get_core_count() == 1) {
       xbt_assert(current_power_values.size() == 2 || current_power_values.size() == 3,
                  "Power properties incorrectly defined for host %s."
                  "It should be 'Idle:FullSpeed' power values because you have one core only.",
       xbt_assert(current_power_values.size() == 2 || current_power_values.size() == 3,
                  "Power properties incorrectly defined for host %s."
                  "It should be 'Idle:FullSpeed' power values because you have one core only.",
index d915b59..a728f25 100644 (file)
@@ -73,7 +73,7 @@ void HostLoad::update()
     idle_time += (now - last_updated);
   }
 
     idle_time += (now - last_updated);
   }
 
-  theor_max_flops += current_speed * host->getCoreCount() * (now - last_updated);
+  theor_max_flops += current_speed * host->get_core_count() * (now - last_updated);
   current_speed    = host->getSpeed();
   last_updated     = now;
   was_prev_idle    = (current_flops == 0);
   current_speed    = host->getSpeed();
   last_updated     = now;
   was_prev_idle    = (current_flops == 0);
@@ -93,7 +93,7 @@ double HostLoad::getCurrentLoad()
   // We don't need to call update() here because it is called everytime an
   // action terminates or starts
   // FIXME: Can this happen at the same time? stop -> call to getCurrentLoad, load = 0 -> next action starts?
   // We don't need to call update() here because it is called everytime an
   // action terminates or starts
   // FIXME: Can this happen at the same time? stop -> call to getCurrentLoad, load = 0 -> next action starts?
-  return current_flops / static_cast<double>(host->getSpeed() * host->getCoreCount());
+  return current_flops / static_cast<double>(host->getSpeed() * host->get_core_count());
 }
 
 /**
 }
 
 /**
index 22b73e9..9338334 100644 (file)
@@ -165,7 +165,7 @@ L07Action::L07Action(kernel::resource::Model* model, int host_nb, sg_host_t* hos
           double lat=0.0;
 
           std::vector<kernel::resource::LinkImpl*> route;
           double lat=0.0;
 
           std::vector<kernel::resource::LinkImpl*> route;
-          hostList_->at(i)->routeTo(hostList_->at(j), route, &lat);
+          hostList_->at(i)->route_to(hostList_->at(j), route, &lat);
           latency = std::max(latency, lat);
 
           for (auto const& link : route)
           latency = std::max(latency, lat);
 
           for (auto const& link : route)
@@ -193,7 +193,7 @@ L07Action::L07Action(kernel::resource::Model* model, int host_nb, sg_host_t* hos
       for (int j = 0; j < host_nb; j++) {
         if (bytes_amount[i * host_nb + j] > 0.0) {
           std::vector<kernel::resource::LinkImpl*> route;
       for (int j = 0; j < host_nb; j++) {
         if (bytes_amount[i * host_nb + j] > 0.0) {
           std::vector<kernel::resource::LinkImpl*> route;
-          hostList_->at(i)->routeTo(hostList_->at(j), route, nullptr);
+          hostList_->at(i)->route_to(hostList_->at(j), route, nullptr);
 
           for (auto const& link : route)
             model->get_maxmin_system()->expand_add(link->get_constraint(), this->get_variable(),
 
           for (auto const& link : route)
             model->get_maxmin_system()->expand_add(link->get_constraint(), this->get_variable(),
@@ -394,7 +394,7 @@ void L07Action::updateBound()
         if (communicationAmount_[i * hostNb + j] > 0) {
           double lat = 0.0;
           std::vector<kernel::resource::LinkImpl*> route;
         if (communicationAmount_[i * hostNb + j] > 0) {
           double lat = 0.0;
           std::vector<kernel::resource::LinkImpl*> route;
-          hostList_->at(i)->routeTo(hostList_->at(j), route, &lat);
+          hostList_->at(i)->route_to(hostList_->at(j), route, &lat);
 
           lat_current = std::max(lat_current, lat * communicationAmount_[i * hostNb + j]);
         }
 
           lat_current = std::max(lat_current, lat * communicationAmount_[i * hostNb + j]);
         }
index b7bf33b..7ed0610 100644 (file)
@@ -56,8 +56,8 @@ static void dump_hosts()
   for (unsigned int i = 0; i < totalHosts; i++) {
     std::printf("  <host id=\"%s\" speed=\"%.0f\"", hosts[i]->get_cname(), sg_host_speed(hosts[i]));
     props = hosts[i]->getProperties();
   for (unsigned int i = 0; i < totalHosts; i++) {
     std::printf("  <host id=\"%s\" speed=\"%.0f\"", hosts[i]->get_cname(), sg_host_speed(hosts[i]));
     props = hosts[i]->getProperties();
-    if (hosts[i]->getCoreCount() > 1) {
-      std::printf(" core=\"%d\"", hosts[i]->getCoreCount());
+    if (hosts[i]->get_core_count() > 1) {
+      std::printf(" core=\"%d\"", hosts[i]->get_core_count());
     }
     if (props && not props->empty()) {
       std::printf(">\n");
     }
     if (props && not props->empty()) {
       std::printf(">\n");