X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b6e0974be6616f62aa724f7ec7ad1cff1b421e1e..be4b540460e5f67714677c3ecf9ff54d2916f0d8:/src/surf/cpu_ti.cpp?ds=sidebyside diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 484d895b6d..2be282c2c8 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -429,15 +429,6 @@ CpuTiModel::~CpuTiModel() xbt_lib_cursor_t cursor; char *key; - xbt_lib_foreach(host_lib, cursor, key, cpu){ - if(cpu[SURF_CPU_LEVEL]) - { - CpuTiPtr CPU = dynamic_cast(static_cast(cpu[SURF_CPU_LEVEL])); - xbt_swag_free(CPU->p_actionSet); - delete CPU->p_availTrace; - } - } - surf_cpu_model_pm = NULL; xbt_swag_free @@ -470,9 +461,6 @@ CpuTiPtr CpuTiModel::createResource(const char *name, tmgr_trace_t stateTrace, xbt_dict_t cpuProperties) { - tmgr_trace_t empty_trace; - s_tmgr_event_t val; - CpuTiActionPtr cpuAction; xbt_assert(core==1,"Multi-core not handled with this model yet"); xbt_assert(!surf_cpu_resource_priv(surf_cpu_resource_by_name(name)), "Host '%s' declared several times in the platform file", @@ -586,6 +574,7 @@ CpuTi::CpuTi(CpuTiModelPtr model, const char *name, xbt_dynar_t powerPeak, e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace, xbt_dict_t properties) : Resource(model, name, properties), Cpu(model, name, properties) { + p_powerEvent = NULL; p_stateCurrent = stateInitial; m_powerScale = powerScale; m_core = core; @@ -598,6 +587,8 @@ CpuTi::CpuTi(CpuTiModelPtr model, const char *name, xbt_dynar_t powerPeak, CpuTiActionPtr action = NULL; p_actionSet = xbt_swag_new(xbt_swag_offset(*action, p_cpuListHookup)); + m_lastUpdate = 0; + xbt_dynar_get_cpy(powerPeak, 0, &m_powerPeak); xbt_dynar_free(&powerPeak); /* kill memory leak */ m_pstate = pstate; @@ -621,6 +612,11 @@ CpuTi::CpuTi(CpuTiModelPtr model, const char *name, xbt_dynar_t powerPeak, } }; +CpuTi::~CpuTi(){ +delete p_availTrace; +xbt_swag_free(p_actionSet); +} + void CpuTi::updateState(tmgr_trace_event_t event_type, double value, double date) {