Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename some fields to match our coding standards
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 19 Mar 2016 23:06:15 +0000 (00:06 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 20 Mar 2016 00:01:28 +0000 (01:01 +0100)
src/surf/network_cm02.cpp
src/surf/network_cm02.hpp
src/surf/network_constant.cpp
src/surf/network_constant.hpp
src/surf/network_ib.cpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/network_smpi.cpp

index 0c5fc8c..d88a052 100644 (file)
@@ -203,7 +203,7 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
     // if I am wearing a latency hat
     if (action->getHat() == LATENCY) {
       XBT_DEBUG("Latency paid for action %p. Activating", action);
-      lmm_update_variable_weight(maxminSystem_, action->getVariable(), action->m_weight);
+      lmm_update_variable_weight(maxminSystem_, action->getVariable(), action->weight_);
       action->heapRemove(actionHeap_);
       action->refreshLastUpdate();
 
@@ -237,17 +237,17 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta)
     action = static_cast<NetworkCm02Action*> (&*it);
     XBT_DEBUG("Something happened to action %p", action);
       double deltap = delta;
-      if (action->m_latency > 0) {
-        if (action->m_latency > deltap) {
-          double_update(&(action->m_latency), deltap, sg_surf_precision);
+      if (action->latency_ > 0) {
+        if (action->latency_ > deltap) {
+          double_update(&(action->latency_), deltap, sg_surf_precision);
           deltap = 0.0;
         } else {
-          double_update(&(deltap), action->m_latency, sg_surf_precision);
-          action->m_latency = 0.0;
+          double_update(&(deltap), action->latency_, sg_surf_precision);
+          action->latency_ = 0.0;
         }
-        if (action->m_latency == 0.0 && !(action->isSuspended()))
+        if (action->latency_ == 0.0 && !(action->isSuspended()))
           lmm_update_variable_weight(maxminSystem_, action->getVariable(),
-              action->m_weight);
+              action->weight_);
       }
       if (TRACE_is_enabled()) {
         int n = lmm_get_number_of_cnst_from_var(maxminSystem_, action->getVariable());
@@ -321,9 +321,9 @@ Action *NetworkCm02Model::communicate(NetCard *src, NetCard *dst, double size, d
   }
 
   NetworkCm02Action *action = new NetworkCm02Action(this, size, failed);
-  action->m_weight = action->m_latency = latency;
+  action->weight_ = action->latency_ = latency;
 
-  action->m_rate = rate;
+  action->rate_ = rate;
   if (updateMechanism_ == UM_LAZY) {
     action->m_indexHeap = -1;
     action->m_lastUpdate = surf_get_clock();
@@ -332,42 +332,42 @@ Action *NetworkCm02Model::communicate(NetCard *src, NetCard *dst, double size, d
   bandwidth_bound = -1.0;
   if (sg_weight_S_parameter > 0)
     for (auto link : *route)
-      action->m_weight += sg_weight_S_parameter / link->getBandwidth();
+      action->weight_ += sg_weight_S_parameter / link->getBandwidth();
 
   for (auto link : *route) {
     double bb = bandwidthFactor(size) * link->getBandwidth();
     bandwidth_bound = (bandwidth_bound < 0.0) ? bb : std::min(bandwidth_bound, bb);
   }
 
-  action->m_latCurrent = action->m_latency;
-  action->m_latency *= latencyFactor(size);
-  action->m_rate = bandwidthConstraint(action->m_rate, bandwidth_bound, size);
-  if (m_haveGap) {
+  action->latCurrent_ = action->latency_;
+  action->latency_ *= latencyFactor(size);
+  action->rate_ = bandwidthConstraint(action->rate_, bandwidth_bound, size);
+  if (haveGap_) {
     xbt_assert(! route->empty(),
                "Using a model with a gap (e.g., SMPI) with a platform without links (e.g. vivaldi)!!!");
 
     gapAppend(size, route->at(0), action);
-    XBT_DEBUG("Comm %p: %s -> %s gap=%f (lat=%f)", action, src->name(), dst->name(), action->m_senderGap, action->m_latency);
+    XBT_DEBUG("Comm %p: %s -> %s gap=%f (lat=%f)", action, src->name(), dst->name(), action->senderGap_, action->latency_);
   }
 
   constraints_per_variable = route->size();
   if (back_route != NULL)
     constraints_per_variable += back_route->size();
 
-  if (action->m_latency > 0) {
+  if (action->latency_ > 0) {
     action->p_variable = lmm_variable_new(maxminSystem_, action, 0.0, -1.0, constraints_per_variable);
     if (updateMechanism_ == UM_LAZY) {
       // add to the heap the event when the latency is payed
-      XBT_DEBUG("Added action (%p) one latency event at date %f", action, action->m_latency + action->m_lastUpdate);
-      action->heapInsert(actionHeap_, action->m_latency + action->m_lastUpdate, route->empty() ? NORMAL : LATENCY);
+      XBT_DEBUG("Added action (%p) one latency event at date %f", action, action->latency_ + action->m_lastUpdate);
+      action->heapInsert(actionHeap_, action->latency_ + action->m_lastUpdate, route->empty() ? NORMAL : LATENCY);
     }
   } else
     action->p_variable = lmm_variable_new(maxminSystem_, action, 1.0, -1.0, constraints_per_variable);
 
-  if (action->m_rate < 0) {
-    lmm_update_variable_bound(maxminSystem_, action->getVariable(), (action->m_latCurrent > 0) ? sg_tcp_gamma / (2.0 * action->m_latCurrent) : -1.0);
+  if (action->rate_ < 0) {
+    lmm_update_variable_bound(maxminSystem_, action->getVariable(), (action->latCurrent_ > 0) ? sg_tcp_gamma / (2.0 * action->latCurrent_) : -1.0);
   } else {
-    lmm_update_variable_bound(maxminSystem_, action->getVariable(), (action->m_latCurrent > 0) ? std::min(action->m_rate, sg_tcp_gamma / (2.0 * action->m_latCurrent)) : action->m_rate);
+    lmm_update_variable_bound(maxminSystem_, action->getVariable(), (action->latCurrent_ > 0) ? std::min(action->rate_, sg_tcp_gamma / (2.0 * action->latCurrent_)) : action->rate_);
   }
 
   for (auto link: *route)
@@ -470,9 +470,9 @@ void NetworkCm02Link::updateBandwidth(double value) {
     int numelem = 0;
     while ((var = lmm_get_var_from_cnst_safe(getModel()->getMaxminSystem(), getConstraint(), &elem, &nextelem, &numelem))) {
       NetworkCm02Action *action = (NetworkCm02Action*) lmm_variable_id(var);
-      action->m_weight += delta;
+      action->weight_ += delta;
       if (!action->isSuspended())
-        lmm_update_variable_weight(getModel()->getMaxminSystem(), action->getVariable(), action->m_weight);
+        lmm_update_variable_weight(getModel()->getMaxminSystem(), action->getVariable(), action->weight_);
     }
   }
 }
@@ -488,22 +488,22 @@ void NetworkCm02Link::updateLatency(double value){
 
   while ((var = lmm_get_var_from_cnst_safe(getModel()->getMaxminSystem(), getConstraint(), &elem, &nextelem, &numelem))) {
     NetworkCm02Action *action = (NetworkCm02Action*) lmm_variable_id(var);
-    action->m_latCurrent += delta;
-    action->m_weight += delta;
-    if (action->m_rate < 0)
-      lmm_update_variable_bound(getModel()->getMaxminSystem(), action->getVariable(), sg_tcp_gamma / (2.0 * action->m_latCurrent));
+    action->latCurrent_ += delta;
+    action->weight_ += delta;
+    if (action->rate_ < 0)
+      lmm_update_variable_bound(getModel()->getMaxminSystem(), action->getVariable(), sg_tcp_gamma / (2.0 * action->latCurrent_));
     else {
       lmm_update_variable_bound(getModel()->getMaxminSystem(), action->getVariable(),
-                                std::min(action->m_rate, sg_tcp_gamma / (2.0 * action->m_latCurrent)));
+                                std::min(action->rate_, sg_tcp_gamma / (2.0 * action->latCurrent_)));
 
-      if (action->m_rate < sg_tcp_gamma / (2.0 * action->m_latCurrent)) {
+      if (action->rate_ < sg_tcp_gamma / (2.0 * action->latCurrent_)) {
         XBT_INFO("Flow is limited BYBANDWIDTH");
       } else {
-        XBT_INFO("Flow is limited BYLATENCY, latency of flow is %f", action->m_latCurrent);
+        XBT_INFO("Flow is limited BYLATENCY, latency of flow is %f", action->latCurrent_);
       }
     }
     if (!action->isSuspended())
-      lmm_update_variable_weight(getModel()->getMaxminSystem(), action->getVariable(), action->m_weight);
+      lmm_update_variable_weight(getModel()->getMaxminSystem(), action->getVariable(), action->weight_);
   }
 }
 
index 9afea8f..54cf61f 100644 (file)
@@ -48,7 +48,7 @@ namespace simgrid {
       bool next_occuring_event_isIdempotent() override {return true;}
       virtual void gapAppend(double /*size*/, const Link* /*link*/, NetworkAction * /*action*/) {};
     protected:
-      bool m_haveGap = false;
+      bool haveGap_ = false;
     };
 
     /************
@@ -81,7 +81,7 @@ namespace simgrid {
     : NetworkAction(model, cost, failed) {};
       void updateRemainingLazy(double now);
     protected:
-      double m_senderGap;
+      double senderGap_;
     };
 
   }
index d5601f0..d7dd2ad 100644 (file)
@@ -41,8 +41,8 @@ namespace simgrid {
       for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
           ; it != itend ; ++it) {
         action = static_cast<NetworkConstantAction*>(&*it);
-        if (action->m_latency > 0 && (min < 0 || action->m_latency < min))
-          min = action->m_latency;
+        if (action->latency_ > 0 && (min < 0 || action->latency_ < min))
+          min = action->latency_;
       }
 
       return min;
@@ -56,11 +56,11 @@ namespace simgrid {
           ; it != itend ; it=itNext) {
         ++itNext;
         action = static_cast<NetworkConstantAction*>(&*it);
-        if (action->m_latency > 0) {
-          if (action->m_latency > delta) {
-            double_update(&(action->m_latency), delta, sg_surf_precision);
+        if (action->latency_ > 0) {
+          if (action->latency_ > delta) {
+            double_update(&(action->latency_), delta, sg_surf_precision);
           } else {
-            action->m_latency = 0.0;
+            action->latency_ = 0.0;
           }
         }
         action->updateRemains(action->getCost() * delta / action->m_latInit);
index a15b173..214993d 100644 (file)
@@ -46,8 +46,8 @@ namespace simgrid {
     : NetworkAction(model_, size, false)
     , m_latInit(latency)
     {
-        m_latency = latency;
-        if (m_latency <= 0.0) {
+        latency_ = latency;
+        if (latency_ <= 0.0) {
           p_stateSet = getModel()->getDoneActionSet();
           p_stateSet->push_back(*this);
         }
index 546ba35..d373a38 100644 (file)
@@ -113,7 +113,7 @@ namespace simgrid {
 
     NetworkIBModel::NetworkIBModel()
     : NetworkSmpiModel() {
-      m_haveGap=false;
+      haveGap_=false;
       active_nodes=NULL;
 
       const char* IB_factors_string=sg_cfg_get_string("smpi/IB_penalty_factors");
index 9c14062..ae90c04 100644 (file)
@@ -156,8 +156,8 @@ namespace simgrid {
       for(ActionList::iterator it(runningActions->begin()), itend(runningActions->end())
           ; it != itend ; ++it) {
         action = static_cast<NetworkAction*>(&*it);
-        if (action->m_latency > 0) {
-          minRes = (minRes < 0) ? action->m_latency : std::min(minRes, action->m_latency);
+        if (action->latency_ > 0) {
+          minRes = (minRes < 0) ? action->latency_ : std::min(minRes, action->latency_);
         }
       }
 
index bbdd35d..4d40e4d 100644 (file)
@@ -277,13 +277,13 @@ namespace simgrid {
 
       void setState(e_surf_action_state_t state);
 
-      double m_latency;
-      double m_latCurrent;
-      double m_weight;
-      double m_rate;
-      const char* p_senderLinkName;
-      double m_senderSize;
-      xbt_fifo_item_t p_senderFifoItem;
+      double latency_;
+      double latCurrent_;
+      double weight_;
+      double rate_;
+      const char* senderLinkName_;
+      double senderSize_;
+      xbt_fifo_item_t senderFifoItem_;
     };
   }
 }
index 1490eb1..d0bd35f 100644 (file)
@@ -101,7 +101,7 @@ namespace simgrid {
 
     NetworkSmpiModel::NetworkSmpiModel()
     : NetworkCm02Model() {
-      m_haveGap=true;
+      haveGap_=true;
     }
 
     NetworkSmpiModel::~NetworkSmpiModel(){
@@ -121,16 +121,16 @@ namespace simgrid {
           gap_lookup = xbt_dict_new_homogeneous(NULL);
         }
         fifo = (xbt_fifo_t) xbt_dict_get_or_null(gap_lookup, src);
-        action->m_senderGap = 0.0;
+        action->senderGap_ = 0.0;
         if (fifo && xbt_fifo_size(fifo) > 0) {
           /* Compute gap from last send */
           /*last_action =
           (surf_action_network_CM02_t)
           xbt_fifo_get_item_content(xbt_fifo_get_last_item(fifo));*/
           // bw = net_get_link_bandwidth(link);
-          action->m_senderGap = sg_sender_gap;
+          action->senderGap_ = sg_sender_gap;
           /*  max(sg_sender_gap,last_action->sender.size / bw);*/
-          action->m_latency += action->m_senderGap;
+          action->latency_ += action->senderGap_;
         }
         /* Append action as last send */
         /*action->sender.link_name = link->lmm_resource.generic_resource.name;
@@ -142,7 +142,7 @@ namespace simgrid {
       xbt_dict_set(gap_lookup, action->sender.link_name, fifo, NULL);
     }
     action->sender.fifo_item = xbt_fifo_push(fifo, action);*/
-        action->m_senderSize = size;
+        action->senderSize_ = size;
       }
     }
 
@@ -152,16 +152,16 @@ namespace simgrid {
       size_t size;
       NetworkCm02Action *action = static_cast<NetworkCm02Action*>(lmm_action);
 
-      if (sg_sender_gap > 0.0 && action->p_senderLinkName
-          && action->p_senderFifoItem) {
+      if (sg_sender_gap > 0.0 && action->senderLinkName_
+          && action->senderFifoItem_) {
         fifo =
             (xbt_fifo_t) xbt_dict_get_or_null(gap_lookup,
-                action->p_senderLinkName);
-        xbt_fifo_remove_item(fifo, action->p_senderFifoItem);
+                action->senderLinkName_);
+        xbt_fifo_remove_item(fifo, action->senderFifoItem_);
         size = xbt_fifo_size(fifo);
         if (size == 0) {
           xbt_fifo_free(fifo);
-          xbt_dict_remove(gap_lookup, action->p_senderLinkName);
+          xbt_dict_remove(gap_lookup, action->senderLinkName_);
           size = xbt_dict_length(gap_lookup);
           if (size == 0) {
             xbt_dict_free(&gap_lookup);