Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sanitize surf API: s/updateState/apply_event/
[simgrid.git] / src / surf / cpu_ti.cpp
index 01beca94e687cd7f7e58ebb3da589adc54209ce2..5169617bb00dc1627ba69e8766e8937fd1619df3 100644 (file)
@@ -444,7 +444,7 @@ Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host,
   return cpu;
 }
 
-double CpuTiModel::shareResources(double now)
+double CpuTiModel::next_occuring_event(double now)
 {
   double min_action_duration = -1;
 
@@ -561,8 +561,7 @@ void CpuTi::set_speed_trace(tmgr_trace_t trace)
   }
 }
 
-void CpuTi::updateState(tmgr_trace_iterator_t event_type,
-                        double value, double date)
+void CpuTi::apply_event(tmgr_trace_iterator_t event_type, double value)
 {
   CpuTiAction *action;
 
@@ -571,10 +570,9 @@ void CpuTi::updateState(tmgr_trace_iterator_t event_type,
     CpuTiTgmr *trace;
     s_tmgr_event_t val;
 
-    XBT_DEBUG("Finish trace date: %f value %f date %f", surf_get_clock(),
-           value, date);
+    XBT_DEBUG("Finish trace date: value %f", value);
     /* update remaining of actions and put in modified cpu swag */
-    updateRemainingAmount(date);
+    updateRemainingAmount(surf_get_clock());
 
     modified(true);
 
@@ -599,6 +597,7 @@ void CpuTi::updateState(tmgr_trace_iterator_t event_type,
       turnOn();
     } else {
       turnOff();
+      double date = surf_get_clock();
 
       /* put all action running on cpu to failed */
       for(ActionTiList::iterator it(p_actionSet->begin()), itend(p_actionSet->end())