Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
adress smells in cpuTI
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 20 Jul 2017 07:36:36 +0000 (09:36 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 20 Jul 2017 07:36:36 +0000 (09:36 +0200)
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/surf_interface.hpp

index 9173e1d..dd6c06f 100644 (file)
@@ -665,6 +665,7 @@ CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed, CpuTi *cp
  : CpuAction(model_, cost, failed)
  , cpu_(cpu)
 {
  : CpuAction(model_, cost, failed)
  , cpu_(cpu)
 {
+  indexHeap_ = -1;
   cpu_->modified(true);
 }
 
   cpu_->modified(true);
 }
 
index 3f0fc96..4bdbe14 100644 (file)
@@ -88,7 +88,7 @@ public:
   void setState(simgrid::surf::Action::State state) override;
   int unref() override;
   void cancel() override;
   void setState(simgrid::surf::Action::State state) override;
   int unref() override;
   void cancel() override;
-  void updateIndexHeap(int i);
+  void updateIndexHeap(int i) override;
   void suspend() override;
   void resume() override;
   void setMaxDuration(double duration) override;
   void suspend() override;
   void resume() override;
   void setMaxDuration(double duration) override;
@@ -96,8 +96,6 @@ public:
   double getRemains() override;
 
   CpuTi *cpu_;
   double getRemains() override;
 
   CpuTi *cpu_;
-  int indexHeap_ = -1;
-  int suspended_ = 0;
 
   boost::intrusive::list_member_hook<> action_ti_hook;
 };
 
   boost::intrusive::list_member_hook<> action_ti_hook;
 };
@@ -153,14 +151,6 @@ public:
   ActionList *runningActionSetThatDoesNotNeedBeingChecked_;
   CpuTiList *modifiedCpu_;
   xbt_heap_t tiActionHeap_;
   ActionList *runningActionSetThatDoesNotNeedBeingChecked_;
   CpuTiList *modifiedCpu_;
   xbt_heap_t tiActionHeap_;
-
-protected:
-  void NotifyResourceTurnedOn(simgrid::surf::Resource*){};
-  void NotifyResourceTurnedOff(simgrid::surf::Resource*){};
-
-  void NotifyActionCancel(Action*){};
-  void NotifyActionResume(Action*){};
-  void NotifyActionSuspend(Action*){};
 };
 
 }
 };
 
 }
index b9e8b2c..a51ad07 100644 (file)
@@ -233,7 +233,7 @@ public:
   void heapInsert(xbt_heap_t heap, double key, enum heap_action_type hat);
   void heapRemove(xbt_heap_t heap);
   void heapUpdate(xbt_heap_t heap, double key, enum heap_action_type hat);
   void heapInsert(xbt_heap_t heap, double key, enum heap_action_type hat);
   void heapRemove(xbt_heap_t heap);
   void heapUpdate(xbt_heap_t heap, double key, enum heap_action_type hat);
-  void updateIndexHeap(int i);
+  virtual void updateIndexHeap(int i);
   lmm_variable_t getVariable() {return variable_;}
   double getLastUpdate() {return lastUpdate_;}
   void refreshLastUpdate() {lastUpdate_ = surf_get_clock();}
   lmm_variable_t getVariable() {return variable_;}
   double getLastUpdate() {return lastUpdate_;}
   void refreshLastUpdate() {lastUpdate_ = surf_get_clock();}