/* For the trace and trace:connect tag (store their content till the end of the parsing) */
XBT_PUBLIC_DATA(xbt_dict_t) traces_set_list;
-XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_host_avail;
XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_host_speed;
XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_link_avail;
XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_link_bw;
return;
called = 1;
- /* connect all traces relative to hosts */
- xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
- tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- Cpu *cpu = sg_host_by_name(elm)->pimpl_cpu;
-
- xbt_assert(cpu, "Host %s undefined", elm);
- xbt_assert(trace, "Trace %s undefined", trace_name);
-
- cpu->set_state_trace(trace);
- }
-
+ /* connect host speed traces */
xbt_dict_foreach(trace_connect_list_host_speed, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
Cpu *cpu = sg_host_by_name(elm)->pimpl_cpu;
called = 1;
/* connect all traces relative to hosts */
- xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
- tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- CpuTi *cpu = static_cast<CpuTi*>(sg_host_by_name(elm)->pimpl_cpu);
-
- xbt_assert(cpu, "Host %s undefined", elm);
- xbt_assert(trace, "Trace %s undefined", trace_name);
-
- if (cpu->p_stateEvent) {
- XBT_DEBUG("Trace already configured for this CPU(%s), ignoring it",
- elm);
- continue;
- }
- XBT_DEBUG("Add state trace: %s to CPU(%s)", trace_name, elm);
- cpu->p_stateEvent = future_evt_set->add_trace(trace, 0.0, cpu);
- }
-
xbt_dict_foreach(trace_connect_list_host_speed, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
CpuTi *cpu = static_cast<CpuTi*>(sg_host_by_name(elm)->pimpl_cpu);
xbt_dynar_get_cpy(trace->s_list.event_list,
xbt_dynar_length(trace->s_list.event_list) - 1, &val);
if (val.delta == 0) {
- cpu->p_speedEvent =
- future_evt_set->add_trace(tmgr_empty_trace_new(), cpu->p_availTrace->m_lastTime, cpu);
+ cpu->set_speed_trace(tmgr_empty_trace_new());
}
}
}
void modified(bool modified);
CpuTiTgmr *p_availTrace; /*< Structure with data needed to integrate trace file */
- tmgr_trace_iterator_t p_stateEvent = NULL; /*< trace file with states events (ON or OFF) */
- tmgr_trace_iterator_t p_speedEvent = NULL; /*< trace file with availability events */
ActionTiList *p_actionSet; /*< set with all actions running on cpu */
double m_sumPriority; /*< the sum of actions' priority that are running on cpu */
double m_lastUpdate = 0; /*< last update of actions' remaining amount done */
xbt_dict_cursor_t cursor = NULL;
char *trace_name, *elm;
- if (!trace_connect_list_host_avail)
+ if (!trace_connect_list_host_speed)
return;
/* Connect traces relative to cpu */
- xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
- tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- Cpu *cpu = sg_host_by_name(elm)->pimpl_cpu;
-
- xbt_assert(cpu, "Host %s undefined", elm);
- xbt_assert(trace, "Trace %s undefined", trace_name);
-
- cpu->set_state_trace(trace);
- }
-
xbt_dict_foreach(trace_connect_list_host_speed, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
Cpu *cpu = sg_host_by_name(elm)->pimpl_cpu;
#include "xbt/dict.h"
#include "simgrid/platf.h"
#include "surf/surfxml_parse.h"
+#include "src/surf/cpu_interface.hpp"
#include "src/surf/surf_private.h"
#ifdef HAVE_LUA
/* Do the actual parsing */
parse_status = surf_parse();
+ /* connect all traces relative to hosts */
+ xbt_dict_cursor_t cursor = NULL;
+ char *trace_name, *elm;
+
+ xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
+ tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
+ xbt_assert(trace, "Trace %s undefined", trace_name);
+
+ simgrid::s4u::Host *host = sg_host_by_name(elm);
+ xbt_assert(host, "Host %s undefined", elm);
+ simgrid::surf::Cpu *cpu = host->pimpl_cpu;
+
+ cpu->set_state_trace(trace);
+ }
+
/* Free my data */
xbt_dict_free(&trace_connect_list_host_avail);
xbt_dict_free(&trace_connect_list_host_speed);