Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Put set_bound and set_affinity at Cpu level
authorPaul Bédaride <paul.bedaride@gmail.com>
Thu, 21 Nov 2013 15:29:47 +0000 (16:29 +0100)
committerPaul Bédaride <paul.bedaride@gmail.com>
Thu, 21 Nov 2013 15:29:47 +0000 (16:29 +0100)
src/surf/cpu.cpp
src/surf/cpu.hpp
src/surf/cpu_ti.hpp
src/surf/surf_interface.cpp

index 047bcdc..4632489 100644 (file)
@@ -195,10 +195,10 @@ void CpuActionLmm::setBound(double bound)
  * action object does not have the information about the location where the
  * action is being executed.
  */
-void CpuActionLmm::setAffinity(CpuLmmPtr cpu, unsigned long mask)
+void CpuActionLmm::setAffinity(CpuPtr _cpu, unsigned long mask)
 {
   lmm_variable_t var_obj = p_variable;
-
+  CpuLmmPtr cpu = reinterpret_cast<CpuLmmPtr>(_cpu);
   XBT_IN("(%p,%lx)", this, mask);
 
   {
index 669578a..c8b5316 100644 (file)
@@ -79,6 +79,8 @@ public:
   CpuAction(){};
   CpuAction(ModelPtr model, double cost, bool failed)
   : Action(model, cost, failed) {};
+  virtual void setAffinity(CpuPtr cpu, unsigned long mask)=0;
+  virtual void setBound(double bound)=0;
 };
 
 class CpuActionLmm : public ActionLmm, public CpuAction {
@@ -88,7 +90,7 @@ public:
   : Action(model, cost, failed), ActionLmm(model, cost, failed), CpuAction(model, cost, failed) {};
   void updateRemainingLazy(double now);
   virtual void updateEnergy()=0;
-  void setAffinity(CpuLmmPtr cpu, unsigned long mask);
+  void setAffinity(CpuPtr cpu, unsigned long mask);
   void setBound(double bound);
   double m_bound;
 };
index 8a85656..c106897 100644 (file)
@@ -170,6 +170,9 @@ public:
   void setMaxDuration(double duration);
   void setPriority(double priority);
   double getRemains();
+  void setAffinity(CpuPtr cpu, unsigned long mask) {};
+  void setBound(double bound) {};
+
   CpuTiPtr p_cpu;
   int m_indexHeap;
   s_xbt_swag_hookup_t p_cpuListHookup;
index 9f9f50c..c0f76be 100644 (file)
@@ -502,11 +502,11 @@ int surf_action_get_cost(surf_action_t action){
 }
 
 void surf_cpu_action_set_affinity(surf_action_t action, surf_resource_t cpu, unsigned long mask) {
-  dynamic_cast<CpuActionLmmPtr>(action)->setAffinity( dynamic_cast<CpuLmmPtr>(get_casted_cpu(cpu)), mask);
+  dynamic_cast<CpuActionPtr>(action)->setAffinity(get_casted_cpu(cpu), mask);
 }
 
 void surf_cpu_action_set_bound(surf_action_t action, double bound) {
-  dynamic_cast<CpuActionLmmPtr>(action)->setBound(bound);
+  dynamic_cast<CpuActionPtr>(action)->setBound(bound);
 }
 
 surf_file_t surf_storage_action_get_file(surf_action_t action){