if (!power_trace) {
trace->type = TRACE_FIXED;
trace->value = value;
- XBT_DEBUG("No availabily trace. Constant value = %lf", value);
+ XBT_DEBUG("No availability trace. Constant value = %lf", value);
return trace;
}
}
-static void* cpu_ti_create_resource(const char *name, double power_peak,
+static void* cpu_ti_create_resource(const char *name, xbt_dynar_t power_peak,
+ int pstate,
double power_scale,
tmgr_trace_t power_trace,
int core,
surf_cpu_model, name,cpu_properties);
cpu->action_set =
xbt_swag_new(xbt_swag_offset(ti_action, cpu_list_hookup));
- cpu->power_peak = power_peak;
+
+
+ xbt_dynar_get_cpy(power_peak, 0, &cpu->power_peak);
+ //cpu->power_peak = power_peak;
+ cpu->pstate = pstate;
+ XBT_DEBUG("CPU create: peak=%lf, pstate=%d",cpu->power_peak, cpu->pstate);
+
xbt_assert(cpu->power_peak > 0, "Power has to be >0");
XBT_DEBUG("power scale %lf", power_scale);
cpu->power_scale = power_scale;
{
cpu_ti_create_resource(host->id,
host->power_peak,
+ host->pstate,
host->power_scale,
host->power_trace,
host->core_amount,
/* set the remains to 0 due to precision problems when updating the remaining amount */
GENERIC_ACTION(action).remains = 0;
cpu_ti_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
- /* update remaining amout of all actions */
+ /* update remaining amount of all actions */
cpu_ti_update_remaining_amount(surf_cpu_resource_priv(action->cpu), surf_get_clock());
}
#undef GENERIC_ACTION
cpu_ti_t cpu = id;
surf_action_cpu_ti_t action;
- surf_watched_hosts();
-
if (event_type == cpu->power_event) {
tmgr_trace_t power_trace;
surf_cpu_ti_tgmr_t trace;
cpu->power_event = NULL;
} else if (event_type == cpu->state_event) {
- if (value > 0)
+ if (value > 0) {
+ if(cpu->state_current == SURF_RESOURCE_OFF)
+ xbt_dynar_push_as(host_that_restart, char*, (cpu->generic_resource.name));
cpu->state_current = SURF_RESOURCE_ON;
- else {
+ } else {
cpu->state_current = SURF_RESOURCE_OFF;
/* put all action running on cpu to failed */