- double power_scale = 0.0;
- double power_initial = 0.0;
- tmgr_trace_t power_trace = NULL;
- e_surf_cpu_state_t state_initial = SURF_CPU_OFF;
- tmgr_trace_t state_trace = NULL;
-
- power_scale = get_cpu_power(A_surfxml_host_power);
- surf_parse_get_double(&power_initial, A_surfxml_host_availability);
- surf_parse_get_trace(&power_trace, A_surfxml_host_availability_file);
-
- xbt_assert0((A_surfxml_host_state == A_surfxml_host_state_ON) ||
- (A_surfxml_host_state == A_surfxml_host_state_OFF),
- "Invalid state");
- if (A_surfxml_host_state == A_surfxml_host_state_ON)
- state_initial = SURF_CPU_ON;
- if (A_surfxml_host_state == A_surfxml_host_state_OFF)
- state_initial = SURF_CPU_OFF;
- surf_parse_get_trace(&state_trace, A_surfxml_host_state_file);
-
- current_property_set = xbt_dict_new();
- cpu_new(xbt_strdup(A_surfxml_host_id), power_scale, power_initial, power_trace, state_initial,
- state_trace, current_property_set);
-
-}
-
-static void add_traces_cpu(void) {
- xbt_dict_cursor_t cursor=NULL;
- char *trace_name,*elm;
-
- static int called = 0;
-
- if (called) 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 = xbt_dict_get_or_null(traces_set_list, trace_name);
- cpu_Cas01_t host = xbt_dict_get_or_null(cpu_set, elm);
-
- xbt_assert1(host, "Host %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
-
- host->state_event = tmgr_history_add_trace(history, trace, 0.0, 0, host);
- }
-
- xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
- tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
- cpu_Cas01_t host = xbt_dict_get_or_null(cpu_set, elm);
-
- xbt_assert1(host, "Host %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
-
- host->power_event = tmgr_history_add_trace(history, trace, 0.0, 0, host);
- }