Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cleanup in the Link field names
[simgrid.git] / src / surf / ptask_L07.cpp
index 2081084..4d1e730 100644 (file)
@@ -239,14 +239,14 @@ L07Action::L07Action(Model *model, int host_nb, sg_host_t *host_list,
   xbt_free(host_list);
 }
 
-Action *NetworkL07Model::communicate(kernel::routing::NetCard *src, kernel::routing::NetCard *dst, double size, double rate)
+Action* NetworkL07Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate)
 {
   sg_host_t*host_list = xbt_new0(sg_host_t, 2);
   double *flops_amount = xbt_new0(double, 2);
   double *bytes_amount = xbt_new0(double, 4);
 
-  host_list[0] = sg_host_by_name(src->name());
-  host_list[1] = sg_host_by_name(dst->name());
+  host_list[0]    = src;
+  host_list[1]    = dst;
   bytes_amount[1] = size;
 
   return hostModel_->executeParallelTask(2, host_list, flops_amount, bytes_amount, rate);
@@ -279,8 +279,8 @@ LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props, dou
              e_surf_link_sharing_policy_t policy)
  : Link(model, name, props, lmm_constraint_new(model->getMaxminSystem(), this, bandwidth))
 {
-  m_bandwidth.peak = bandwidth;
-  m_latency.peak = latency;
+  bandwidth_.peak = bandwidth;
+  latency_.peak   = latency;
 
   if (policy == SURF_LINK_FATPIPE)
     lmm_constraint_shared(getConstraint());
@@ -354,39 +354,39 @@ void CpuL07::apply_event(tmgr_trace_iterator_t triggered, double value){
 
 void LinkL07::apply_event(tmgr_trace_iterator_t triggered, double value) {
   XBT_DEBUG("Updating link %s (%p) with value=%f", getName(), this, value);
-  if (triggered == m_bandwidth.event) {
-    updateBandwidth(value);
-    tmgr_trace_event_unref(&m_bandwidth.event);
+  if (triggered == bandwidth_.event) {
+    setBandwidth(value);
+    tmgr_trace_event_unref(&bandwidth_.event);
 
-  } else if (triggered == m_latency.event) {
-    updateLatency(value);
-    tmgr_trace_event_unref(&m_latency.event);
+  } else if (triggered == latency_.event) {
+    setLatency(value);
+    tmgr_trace_event_unref(&latency_.event);
 
-  } else if (triggered == m_stateEvent) {
+  } else if (triggered == stateEvent_) {
     if (value > 0)
       turnOn();
     else
       turnOff();
-    tmgr_trace_event_unref(&m_stateEvent);
+    tmgr_trace_event_unref(&stateEvent_);
 
   } else {
     xbt_die("Unknown event ! \n");
   }
 }
 
-void LinkL07::updateBandwidth(double value)
+void LinkL07::setBandwidth(double value)
 {
-  m_bandwidth.peak = value;
-  lmm_update_constraint_bound(getModel()->getMaxminSystem(), getConstraint(), m_bandwidth.peak * m_bandwidth.scale);
+  bandwidth_.peak = value;
+  lmm_update_constraint_bound(getModel()->getMaxminSystem(), getConstraint(), bandwidth_.peak * bandwidth_.scale);
 }
 
-void LinkL07::updateLatency(double value)
+void LinkL07::setLatency(double value)
 {
   lmm_variable_t var = nullptr;
   L07Action *action;
   lmm_element_t elem = nullptr;
 
-  m_latency.peak = value;
+  latency_.peak = value;
   while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), getConstraint(), &elem))) {
     action = static_cast<L07Action*>(lmm_variable_id(var));
     action->updateBound();