X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ac6b411512330530569fadb8c3f4fb82a4c70440..1bd3b1e9e02dd5662a771c1b382cfa1d1d9a2e08:/src/surf/host_ptask_L07.cpp diff --git a/src/surf/host_ptask_L07.cpp b/src/surf/host_ptask_L07.cpp index 6033a921d5..f5d4fe9358 100644 --- a/src/surf/host_ptask_L07.cpp +++ b/src/surf/host_ptask_L07.cpp @@ -16,6 +16,7 @@ #include "src/surf/platform.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_host); +XBT_LOG_EXTERNAL_CATEGORY(xbt_cfg); /**************************************/ /*** Resource Creation & Destruction **/ @@ -29,7 +30,7 @@ static void ptask_netlink_parse_init(sg_platf_link_cbarg_t link) void surf_host_model_init_ptask_L07(void) { - XBT_INFO("Switching to the L07 model to handle parallel tasks."); + XBT_CINFO(xbt_cfg,"Switching to the L07 model to handle parallel tasks."); xbt_assert(!surf_cpu_model_pm, "CPU model type already defined"); xbt_assert(!surf_network_model, "network model type already defined"); @@ -72,7 +73,8 @@ CpuL07Model::CpuL07Model(HostL07Model *hmodel,lmm_system_t sys) } CpuL07Model::~CpuL07Model() { surf_cpu_model_pm = NULL; - p_maxminSystem = NULL; // Avoid multi-free + lmm_system_free(p_maxminSystem); + p_maxminSystem = NULL; } NetworkL07Model::NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys) : NetworkModel() @@ -349,7 +351,7 @@ void HostL07Model::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, host); + host->p_stateEvent = future_evt_set->add_trace(trace, 0.0, 0, host); } xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) { @@ -359,7 +361,7 @@ void HostL07Model::addTraces() xbt_assert(host, "Host %s undefined", elm); xbt_assert(trace, "Trace %s undefined", trace_name); - host->p_speedEvent = tmgr_history_add_trace(history, trace, 0.0, 0, host); + host->p_speedEvent = future_evt_set->add_trace(trace, 0.0, 0, host); } /* Connect traces relative to network */ @@ -370,7 +372,7 @@ void HostL07Model::addTraces() xbt_assert(link, "Link %s undefined", elm); xbt_assert(trace, "Trace %s undefined", trace_name); - link->p_stateEvent = tmgr_history_add_trace(history, trace, 0.0, 0, link); + link->p_stateEvent = future_evt_set->add_trace(trace, 0.0, 0, link); } xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) { @@ -380,7 +382,7 @@ void HostL07Model::addTraces() xbt_assert(link, "Link %s undefined", elm); xbt_assert(trace, "Trace %s undefined", trace_name); - link->p_bwEvent = tmgr_history_add_trace(history, trace, 0.0, 0, link); + link->p_bwEvent = future_evt_set->add_trace(trace, 0.0, 0, link); } xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) { @@ -390,7 +392,7 @@ void HostL07Model::addTraces() xbt_assert(link, "Link %s undefined", elm); xbt_assert(trace, "Trace %s undefined", trace_name); - link->p_latEvent = tmgr_history_add_trace(history, trace, 0.0, 0, link); + link->p_latEvent = future_evt_set->add_trace(trace, 0.0, 0, link); } } @@ -408,12 +410,12 @@ CpuL07::CpuL07(CpuL07Model *model, simgrid::s4u::Host *host, p_constraint = lmm_constraint_new(model->getMaxminSystem(), this, xbt_dynar_get_as(speedPeakList,pstate,double) * speedScale); if (speedTrace) - p_speedEvent = tmgr_history_add_trace(history, speedTrace, 0.0, 0, this); + p_speedEvent = future_evt_set->add_trace(speedTrace, 0.0, 0, this); else p_speedEvent = NULL; if (state_trace) - p_stateEvent = tmgr_history_add_trace(history, state_trace, 0.0, 0, this); + p_stateEvent = future_evt_set->add_trace(state_trace, 0.0, 0, this); } CpuL07::~CpuL07() @@ -428,11 +430,11 @@ LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props, int initiallyOn, tmgr_trace_t state_trace, e_surf_link_sharing_policy_t policy) - : Link(model, name, props, lmm_constraint_new(model->getMaxminSystem(), this, bw_initial), history, state_trace) + : Link(model, name, props, lmm_constraint_new(model->getMaxminSystem(), this, bw_initial), future_evt_set, state_trace) { m_bwCurrent = bw_initial; if (bw_trace) - p_bwEvent = tmgr_history_add_trace(history, bw_trace, 0.0, 0, this); + p_bwEvent = future_evt_set->add_trace(bw_trace, 0.0, 0, this); if (initiallyOn) turnOn(); @@ -441,7 +443,7 @@ LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props, m_latCurrent = lat_initial; if (lat_trace) - p_latEvent = tmgr_history_add_trace(history, lat_trace, 0.0, 0, this); + p_latEvent = future_evt_set->add_trace(lat_trace, 0.0, 0, this); if (policy == SURF_LINK_FATPIPE) lmm_constraint_shared(getConstraint()); @@ -503,7 +505,7 @@ bool LinkL07::isUsed(){ return lmm_constraint_used(getModel()->getMaxminSystem(), getConstraint()); } -void CpuL07::updateState(tmgr_trace_event_t event_type, double value, double /*date*/){ +void CpuL07::updateState(tmgr_trace_iterator_t event_type, double value, double /*date*/){ XBT_DEBUG("Updating cpu %s (%p) with value %g", getName(), this, value); if (event_type == p_speedEvent) { m_speedScale = value; @@ -524,7 +526,7 @@ void CpuL07::updateState(tmgr_trace_event_t event_type, double value, double /*d return; } -void LinkL07::updateState(tmgr_trace_event_t event_type, double value, double date) { +void LinkL07::updateState(tmgr_trace_iterator_t event_type, double value, double date) { XBT_DEBUG("Updating link %s (%p) with value=%f for date=%g", getName(), this, value, date); if (event_type == p_bwEvent) { updateBandwidth(value, date);