From: Paul Bédaride Date: Thu, 21 Nov 2013 15:29:47 +0000 (+0100) Subject: Put set_bound and set_affinity at Cpu level X-Git-Tag: v3_11_beta~237 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c5b6728f178469806056b39bf6e2fd00ea8a3d24 Put set_bound and set_affinity at Cpu level --- diff --git a/src/surf/cpu.cpp b/src/surf/cpu.cpp index 047bcdcf5f..4632489e5c 100644 --- a/src/surf/cpu.cpp +++ b/src/surf/cpu.cpp @@ -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(_cpu); XBT_IN("(%p,%lx)", this, mask); { diff --git a/src/surf/cpu.hpp b/src/surf/cpu.hpp index 669578a9bf..c8b53167fd 100644 --- a/src/surf/cpu.hpp +++ b/src/surf/cpu.hpp @@ -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; }; diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index 8a85656c4b..c10689778e 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -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; diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 9f9f50c1dc..c0f76be269 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -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(action)->setAffinity( dynamic_cast(get_casted_cpu(cpu)), mask); + dynamic_cast(action)->setAffinity(get_casted_cpu(cpu), mask); } void surf_cpu_action_set_bound(surf_action_t action, double bound) { - dynamic_cast(action)->setBound(bound); + dynamic_cast(action)->setBound(bound); } surf_file_t surf_storage_action_get_file(surf_action_t action){