X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5cffdb73a735193bfeaa5537b0c6e60707ee947e..caf6aba21918125649ff5a84fafb22e225b2d580:/src/surf/cpu_ti.cpp diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 2c5499c1b5..d30954206e 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -5,8 +5,8 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "cpu_ti.hpp" -#include "trace_mgr_private.h" #include "xbt/heap.h" +#include "src/surf/trace_mgr.hpp" #include "src/surf/platform.hpp" #ifndef SURF_MODEL_CPUTI_H_ @@ -515,7 +515,7 @@ void CpuTiModel::addTraces() continue; } XBT_DEBUG("Add state trace: %s to CPU(%s)", trace_name, elm); - cpu->p_stateEvent = tmgr_history_add_trace(history, trace, 0.0, 0, cpu); + cpu->p_stateEvent = future_evt_set->add_trace(trace, 0.0, cpu); } xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) { @@ -537,11 +537,8 @@ void CpuTiModel::addTraces() xbt_dynar_get_cpy(trace->s_list.event_list, xbt_dynar_length(trace->s_list.event_list) - 1, &val); if (val.delta == 0) { - tmgr_trace_t empty_trace; - empty_trace = tmgr_empty_trace_new(); cpu->p_speedEvent = - tmgr_history_add_trace(history, empty_trace, - cpu->p_availTrace->m_lastTime, 0, cpu); + future_evt_set->add_trace(tmgr_empty_trace_new(), cpu->p_availTrace->m_lastTime, cpu); } } } @@ -567,7 +564,7 @@ CpuTi::CpuTi(CpuTiModel *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeak, XBT_DEBUG("CPU create: peak=%f", m_speedPeak); if (stateTrace) - p_stateEvent = tmgr_history_add_trace(history, stateTrace, 0.0, 0, this); + p_stateEvent = future_evt_set->add_trace(stateTrace, 0.0, this); if (speedTrace && xbt_dynar_length(speedTrace->s_list.event_list) > 1) { s_tmgr_event_t val; @@ -575,8 +572,8 @@ CpuTi::CpuTi(CpuTiModel *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeak, xbt_dynar_get_cpy(speedTrace->s_list.event_list, xbt_dynar_length(speedTrace->s_list.event_list) - 1, &val); if (val.delta == 0) { - tmgr_trace_t empty_trace = tmgr_empty_trace_new(); - p_speedEvent = tmgr_history_add_trace(history, empty_trace, p_availTrace->m_lastTime, 0, this); + p_speedEvent = + future_evt_set->add_trace(tmgr_empty_trace_new(), p_availTrace->m_lastTime, this); } } } @@ -617,8 +614,7 @@ void CpuTi::updateState(tmgr_trace_iterator_t event_type, p_availTrace = trace; - if (tmgr_trace_event_free(event_type)) - p_speedEvent = NULL; + tmgr_trace_event_unref(&p_speedEvent); } else if (event_type == p_stateEvent) { if (value > 0) { @@ -646,14 +642,10 @@ void CpuTi::updateState(tmgr_trace_iterator_t event_type, } } } - if (tmgr_trace_event_free(event_type)) - p_stateEvent = NULL; + tmgr_trace_event_unref(&p_stateEvent); } else { - XBT_CRITICAL("Unknown event ! \n"); - xbt_abort(); + xbt_die("Unknown event!\n"); } - - return; } void CpuTi::updateActionsFinishTime(double now) @@ -794,7 +786,7 @@ void CpuTi::updateRemainingAmount(double now) m_lastUpdate = now; } -CpuAction *CpuTi::execute(double size) +CpuAction *CpuTi::execution_start(double size) { XBT_IN("(%s,%g)", getName(), size); CpuTiAction *action = new CpuTiAction(static_cast(getModel()), size, isOff(), this);