Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case kernel::resource::NetworkModel
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 7 Jul 2018 19:32:50 +0000 (21:32 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 7 Jul 2018 19:32:50 +0000 (21:32 +0200)
14 files changed:
src/kernel/routing/VivaldiZone.cpp
src/surf/network_cm02.cpp
src/surf/network_cm02.hpp
src/surf/network_constant.cpp
src/surf/network_constant.hpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/network_ns3.cpp
src/surf/network_ns3.hpp
src/surf/network_smpi.cpp
src/surf/network_smpi.hpp
src/surf/ptask_L07.cpp
src/surf/ptask_L07.hpp
src/surf/sg_platf.cpp

index cac8eb5..887cd21 100644 (file)
@@ -70,8 +70,8 @@ void VivaldiZone::set_peer_link(NetPoint* netpoint, double bw_in, double bw_out,
 
   std::string link_up      = "link_" + netpoint->get_name() + "_UP";
   std::string link_down    = "link_" + netpoint->get_name() + "_DOWN";
 
   std::string link_up      = "link_" + netpoint->get_name() + "_UP";
   std::string link_down    = "link_" + netpoint->get_name() + "_DOWN";
-  resource::LinkImpl* linkUp   = surf_network_model->createLink(link_up, bw_out, 0, s4u::Link::SharingPolicy::SHARED);
-  resource::LinkImpl* linkDown = surf_network_model->createLink(link_down, bw_in, 0, s4u::Link::SharingPolicy::SHARED);
+  resource::LinkImpl* linkUp   = surf_network_model->create_link(link_up, bw_out, 0, s4u::Link::SharingPolicy::SHARED);
+  resource::LinkImpl* linkDown = surf_network_model->create_link(link_down, bw_in, 0, s4u::Link::SharingPolicy::SHARED);
   private_links_.insert({netpoint->id(), {linkUp, linkDown}});
 }
 
   private_links_.insert({netpoint->id(), {linkUp, linkDown}});
 }
 
index e334a3e..72d1a9a 100644 (file)
@@ -146,11 +146,11 @@ NetworkCm02Model::NetworkCm02Model(kernel::lmm::System* (*make_new_lmm_system)(b
   }
 
   set_maxmin_system(make_new_lmm_system(select));
   }
 
   set_maxmin_system(make_new_lmm_system(select));
-  loopback_ = NetworkCm02Model::createLink("__loopback__", 498000000, 0.000015, s4u::Link::SharingPolicy::FATPIPE);
+  loopback_ = NetworkCm02Model::create_link("__loopback__", 498000000, 0.000015, s4u::Link::SharingPolicy::FATPIPE);
 }
 
 }
 
-LinkImpl* NetworkCm02Model::createLink(const std::string& name, double bandwidth, double latency,
-                                       s4u::Link::SharingPolicy policy)
+LinkImpl* NetworkCm02Model::create_link(const std::string& name, double bandwidth, double latency,
+                                        s4u::Link::SharingPolicy policy)
 {
   return new NetworkCm02Link(this, name, bandwidth, latency, policy, get_maxmin_system());
 }
 {
   return new NetworkCm02Link(this, name, bandwidth, latency, policy, get_maxmin_system());
 }
@@ -253,14 +253,14 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz
         });
   }
 
         });
   }
 
-  double bandwidth_bound = route.empty() ? -1.0 : bandwidthFactor(size) * route.front()->get_bandwidth();
+  double bandwidth_bound = route.empty() ? -1.0 : get_bandwidth_factor(size) * route.front()->get_bandwidth();
 
   for (auto const& link : route)
 
   for (auto const& link : route)
-    bandwidth_bound = std::min(bandwidth_bound, bandwidthFactor(size) * link->get_bandwidth());
+    bandwidth_bound = std::min(bandwidth_bound, get_bandwidth_factor(size) * link->get_bandwidth());
 
   action->lat_current_ = action->latency_;
 
   action->lat_current_ = action->latency_;
-  action->latency_ *= latencyFactor(size);
-  action->rate_ = bandwidthConstraint(action->rate_, bandwidth_bound, size);
+  action->latency_ *= get_latency_factor(size);
+  action->rate_ = get_bandwidth_constraint(action->rate_, bandwidth_bound, size);
 
   int constraints_per_variable = route.size();
   constraints_per_variable += back_route.size();
 
   int constraints_per_variable = route.size();
   constraints_per_variable += back_route.size();
index dbfdb8d..c2c3b30 100644 (file)
@@ -32,8 +32,8 @@ class NetworkCm02Model : public NetworkModel {
 public:
   explicit NetworkCm02Model(lmm::System* (*make_new_sys)(bool) = &lmm::make_new_maxmin_system);
   virtual ~NetworkCm02Model() = default;
 public:
   explicit NetworkCm02Model(lmm::System* (*make_new_sys)(bool) = &lmm::make_new_maxmin_system);
   virtual ~NetworkCm02Model() = default;
-  LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
-                       s4u::Link::SharingPolicy policy) override;
+  LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+                        s4u::Link::SharingPolicy policy) override;
   void update_actions_state_lazy(double now, double delta) override;
   void update_actions_state_full(double now, double delta) override;
   Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
   void update_actions_state_lazy(double now, double delta) override;
   void update_actions_state_full(double now, double delta) override;
   Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
index c1f0970..6e0214f 100644 (file)
@@ -22,8 +22,8 @@ void surf_network_model_init_Constant()
 namespace simgrid {
 namespace kernel {
 namespace resource {
 namespace simgrid {
 namespace kernel {
 namespace resource {
-LinkImpl* NetworkConstantModel::createLink(const std::string& name, double bw, double lat,
-                                           s4u::Link::SharingPolicy policy)
+LinkImpl* NetworkConstantModel::create_link(const std::string& name, double bw, double lat,
+                                            s4u::Link::SharingPolicy policy)
 {
 
   xbt_die("Refusing to create the link %s: there is no link in the Constant network model. "
 {
 
   xbt_die("Refusing to create the link %s: there is no link in the Constant network model. "
index b3eb629..34fd6b1 100644 (file)
@@ -31,7 +31,7 @@ public:
   double next_occuring_event(double now) override;
   void update_actions_state(double now, double delta) override;
 
   double next_occuring_event(double now) override;
   void update_actions_state(double now, double delta) override;
 
-  LinkImpl* createLink(const std::string& name, double bw, double lat, s4u::Link::SharingPolicy policy) override;
+  LinkImpl* create_link(const std::string& name, double bw, double lat, s4u::Link::SharingPolicy policy) override;
 };
 
 /**********
 };
 
 /**********
index 4960b2a..337170f 100644 (file)
@@ -38,17 +38,17 @@ simgrid::config::Flag<bool> NetworkModel::cfg_crosstraffic(
 
 NetworkModel::~NetworkModel() = default;
 
 
 NetworkModel::~NetworkModel() = default;
 
-double NetworkModel::latencyFactor(double /*size*/)
+double NetworkModel::get_latency_factor(double /*size*/)
 {
   return sg_latency_factor;
 }
 
 {
   return sg_latency_factor;
 }
 
-double NetworkModel::bandwidthFactor(double /*size*/)
+double NetworkModel::get_bandwidth_factor(double /*size*/)
 {
   return sg_bandwidth_factor;
 }
 
 {
   return sg_bandwidth_factor;
 }
 
-double NetworkModel::bandwidthConstraint(double rate, double /*bound*/, double /*size*/)
+double NetworkModel::get_bandwidth_constraint(double rate, double /*bound*/, double /*size*/)
 {
   return rate;
 }
 {
   return rate;
 }
@@ -89,7 +89,7 @@ LinkImpl::LinkImpl(NetworkModel* model, const std::string& name, lmm::Constraint
 /** @brief use destroy() instead of this destructor */
 LinkImpl::~LinkImpl()
 {
 /** @brief use destroy() instead of this destructor */
 LinkImpl::~LinkImpl()
 {
-  xbt_assert(currentlyDestroying_, "Don't delete Links directly. Call destroy() instead.");
+  xbt_assert(currently_destroying_, "Don't delete Links directly. Call destroy() instead.");
 }
 /** @brief Fire the required callbacks and destroy the object
  *
 }
 /** @brief Fire the required callbacks and destroy the object
  *
@@ -97,8 +97,8 @@ LinkImpl::~LinkImpl()
  */
 void LinkImpl::destroy()
 {
  */
 void LinkImpl::destroy()
 {
-  if (not currentlyDestroying_) {
-    currentlyDestroying_ = true;
+  if (not currently_destroying_) {
+    currently_destroying_ = true;
     s4u::Link::on_destruction(this->piface_);
     delete this;
   }
     s4u::Link::on_destruction(this->piface_);
     delete this;
   }
index f8b0e65..8267e77 100644 (file)
@@ -47,8 +47,8 @@ public:
    * @param latency The initial latency of the Link in seconds
    * @param policy The sharing policy of the Link
    */
    * @param latency The initial latency of the Link in seconds
    * @param policy The sharing policy of the Link
    */
-  virtual LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
-                               s4u::Link::SharingPolicy policy) = 0;
+  virtual LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+                                s4u::Link::SharingPolicy policy) = 0;
 
   /**
    * @brief Create a communication between two hosts.
 
   /**
    * @brief Create a communication between two hosts.
@@ -74,7 +74,7 @@ public:
    * @param size The size of the message.
    * @return The latency factor.
    */
    * @param size The size of the message.
    * @return The latency factor.
    */
-  virtual double latencyFactor(double size);
+  virtual double get_latency_factor(double size);
 
   /**
    * @brief Get the right multiplicative factor for the bandwidth.
 
   /**
    * @brief Get the right multiplicative factor for the bandwidth.
@@ -86,7 +86,7 @@ public:
    * @param size The size of the message.
    * @return The bandwidth factor.
    */
    * @param size The size of the message.
    * @return The bandwidth factor.
    */
-  virtual double bandwidthFactor(double size);
+  virtual double get_bandwidth_factor(double size);
 
   /**
    * @brief Get definitive bandwidth.
 
   /**
    * @brief Get definitive bandwidth.
@@ -97,7 +97,7 @@ public:
    * @param size The size of the message.
    * @return The new bandwidth.
    */
    * @param size The size of the message.
    * @return The new bandwidth.
    */
-  virtual double bandwidthConstraint(double rate, double bound, double size);
+  virtual double get_bandwidth_constraint(double rate, double bound, double size);
   double next_occuring_event_full(double now) override;
 
   LinkImpl* loopback_ = nullptr;
   double next_occuring_event_full(double now) override;
 
   LinkImpl* loopback_ = nullptr;
@@ -118,7 +118,7 @@ protected:
 public:
   void destroy(); // Must be called instead of the destructor
 private:
 public:
   void destroy(); // Must be called instead of the destructor
 private:
-  bool currentlyDestroying_ = false;
+  bool currently_destroying_ = false;
 
 public:
   /** @brief Public interface */
 
 public:
   /** @brief Public interface */
index a35400c..bc8a59a 100644 (file)
@@ -173,8 +173,8 @@ NetworkNS3Model::~NetworkNS3Model() {
   IPV4addr.clear();
 }
 
   IPV4addr.clear();
 }
 
-LinkImpl* NetworkNS3Model::createLink(const std::string& name, double bandwidth, double latency,
-                                      s4u::Link::SharingPolicy policy)
+LinkImpl* NetworkNS3Model::create_link(const std::string& name, double bandwidth, double latency,
+                                       s4u::Link::SharingPolicy policy)
 {
   return new LinkNS3(this, name, bandwidth, latency);
 }
 {
   return new LinkNS3(this, name, bandwidth, latency);
 }
index 4fa6096..fed2548 100644 (file)
@@ -18,8 +18,8 @@ class NetworkNS3Model : public NetworkModel {
 public:
   NetworkNS3Model();
   ~NetworkNS3Model();
 public:
   NetworkNS3Model();
   ~NetworkNS3Model();
-  LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
-                       s4u::Link::SharingPolicy policy) override;
+  LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+                        s4u::Link::SharingPolicy policy) override;
   kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
   double next_occuring_event(double now) override;
   bool next_occuring_event_is_idempotent() override { return false; }
   kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
   double next_occuring_event(double now) override;
   bool next_occuring_event_is_idempotent() override { return false; }
index 4988883..dedb8cd 100644 (file)
@@ -49,7 +49,7 @@ NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model()
 
 NetworkSmpiModel::~NetworkSmpiModel() = default;
 
 
 NetworkSmpiModel::~NetworkSmpiModel() = default;
 
-double NetworkSmpiModel::bandwidthFactor(double size)
+double NetworkSmpiModel::get_bandwidth_factor(double size)
 {
   if (smpi_bw_factor.empty())
     smpi_bw_factor = parse_factor(simgrid::config::get_value<std::string>("smpi/bw-factor"));
 {
   if (smpi_bw_factor.empty())
     smpi_bw_factor = parse_factor(simgrid::config::get_value<std::string>("smpi/bw-factor"));
@@ -67,7 +67,7 @@ double NetworkSmpiModel::bandwidthFactor(double size)
   return current;
 }
 
   return current;
 }
 
-double NetworkSmpiModel::latencyFactor(double size)
+double NetworkSmpiModel::get_latency_factor(double size)
 {
   if (smpi_lat_factor.empty())
     smpi_lat_factor = parse_factor(simgrid::config::get_value<std::string>("smpi/lat-factor"));
 {
   if (smpi_lat_factor.empty())
     smpi_lat_factor = parse_factor(simgrid::config::get_value<std::string>("smpi/lat-factor"));
@@ -85,9 +85,9 @@ double NetworkSmpiModel::latencyFactor(double size)
   return current;
 }
 
   return current;
 }
 
-double NetworkSmpiModel::bandwidthConstraint(double rate, double bound, double size)
+double NetworkSmpiModel::get_bandwidth_constraint(double rate, double bound, double size)
 {
 {
-  return rate < 0 ? bound : std::min(bound, rate * bandwidthFactor(size));
+  return rate < 0 ? bound : std::min(bound, rate * get_bandwidth_factor(size));
 }
 
 /************
 }
 
 /************
index a012635..cecc750 100644 (file)
@@ -17,9 +17,9 @@ public:
   NetworkSmpiModel();
   ~NetworkSmpiModel();
 
   NetworkSmpiModel();
   ~NetworkSmpiModel();
 
-  double latencyFactor(double size);
-  double bandwidthFactor(double size);
-  double bandwidthConstraint(double rate, double bound, double size);
+  double get_latency_factor(double size);
+  double get_bandwidth_factor(double size);
+  double get_bandwidth_constraint(double rate, double bound, double size);
 };
 } // namespace resource
 } // namespace kernel
 };
 } // namespace resource
 } // namespace kernel
index bea3d7c..36a7e0f 100644 (file)
@@ -57,7 +57,7 @@ NetworkL07Model::NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys)
     : NetworkModel(Model::UpdateAlgo::FULL), hostModel_(hmodel)
 {
   set_maxmin_system(sys);
     : NetworkModel(Model::UpdateAlgo::FULL), hostModel_(hmodel)
 {
   set_maxmin_system(sys);
-  loopback_ = NetworkL07Model::createLink("__loopback__", 498000000, 0.000015, s4u::Link::SharingPolicy::FATPIPE);
+  loopback_ = NetworkL07Model::create_link("__loopback__", 498000000, 0.000015, s4u::Link::SharingPolicy::FATPIPE);
 }
 
 NetworkL07Model::~NetworkL07Model()
 }
 
 NetworkL07Model::~NetworkL07Model()
@@ -228,8 +228,8 @@ Cpu* CpuL07Model::create_cpu(simgrid::s4u::Host* host, std::vector<double>* spee
   return new CpuL07(this, host, speed_per_pstate, core);
 }
 
   return new CpuL07(this, host, speed_per_pstate, core);
 }
 
-kernel::resource::LinkImpl* NetworkL07Model::createLink(const std::string& name, double bandwidth, double latency,
-                                                        s4u::Link::SharingPolicy policy)
+kernel::resource::LinkImpl* NetworkL07Model::create_link(const std::string& name, double bandwidth, double latency,
+                                                         s4u::Link::SharingPolicy policy)
 {
   return new LinkL07(this, name, bandwidth, latency, policy);
 }
 {
   return new LinkL07(this, name, bandwidth, latency, policy);
 }
index 09e4043..98d6940 100644 (file)
@@ -57,8 +57,8 @@ class NetworkL07Model : public kernel::resource::NetworkModel {
 public:
   NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys);
   ~NetworkL07Model();
 public:
   NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys);
   ~NetworkL07Model();
-  kernel::resource::LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
-                                         s4u::Link::SharingPolicy policy) override;
+  kernel::resource::LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+                                          s4u::Link::SharingPolicy policy) override;
 
   kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
 
 
   kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
 
index 5f87f2e..accf45b 100644 (file)
@@ -123,7 +123,7 @@ void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* link)
   }
   for (auto const& link_name : names) {
     simgrid::kernel::resource::LinkImpl* l =
   }
   for (auto const& link_name : names) {
     simgrid::kernel::resource::LinkImpl* l =
-        surf_network_model->createLink(link_name, link->bandwidth, link->latency, link->policy);
+        surf_network_model->create_link(link_name, link->bandwidth, link->latency, link->policy);
 
     if (link->properties) {
       for (auto const& elm : *link->properties)
 
     if (link->properties) {
       for (auto const& elm : *link->properties)