X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5b3677b425b9cc6949c1573d59ac772540cbf4b2..5e3e50f757f70251b3fdf0b6610fe65071dd0d5b:/src/surf/cpu_cas01.cpp diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index ab90f351a6..c746e9a836 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -171,7 +171,7 @@ void CpuCas01Model::addTraces() xbt_assert(host, "Host %s undefined", elm); xbt_assert(trace, "Trace %s undefined", trace_name); - host->p_stateEvent = tmgr_history_add_trace(history, trace, 0.0, 0, static_cast(host)); + host->setStateEvent(tmgr_history_add_trace(history, trace, 0.0, 0, static_cast(host))); } xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) { @@ -181,8 +181,7 @@ void CpuCas01Model::addTraces() xbt_assert(host, "Host %s undefined", elm); xbt_assert(trace, "Trace %s undefined", trace_name); - host->p_powerEvent = - tmgr_history_add_trace(history, trace, 0.0, 0, static_cast(host)); + host->setPowerEvent(tmgr_history_add_trace(history, trace, 0.0, 0, static_cast(host))); } } @@ -216,6 +215,25 @@ CpuCas01::~CpuCas01(){ xbt_dynar_free(&p_powerPeakList); } +void CpuCas01::setStateEvent(tmgr_trace_event_t stateEvent) +{ + p_stateEvent = stateEvent; +} + +void CpuCas01::setPowerEvent(tmgr_trace_event_t powerEvent) +{ + p_powerEvent = powerEvent; +} + +xbt_dynar_t CpuCas01::getPowerPeakList(){ + return p_powerPeakList; +} + +int CpuCas01::getPState() +{ + return m_pstate; +} + bool CpuCas01::isUsed() { return lmm_constraint_used(getModel()->getMaxminSystem(), getConstraint()); @@ -366,9 +384,7 @@ CpuCas01Action::CpuCas01Action(ModelPtr model, double cost, bool failed, double lmm_variable_new(model->getMaxminSystem(), static_cast(this), 1.0, power, 1)) { - m_suspended = 0; /* Should be useless because of the - calloc but it seems to help valgrind... */ - + m_suspended = 0; if (model->getUpdateMechanism() == UM_LAZY) { m_indexHeap = -1; m_lastUpdate = surf_get_clock();