cpu->power_scale = power_scale;
cpu->current_power = initial_power;
cpu->power_trace = power_trace;
+ if(power_trace) tmgr_history_add_trace(history, power_trace, 0.0, 0, cpu);
+
cpu->current_state = initial_state;
cpu->state_trace = state_trace;
+ if(state_trace) tmgr_history_add_trace(history, state_trace, 0.0, 0, cpu);
+
cpu->constraint = lmm_constraint_new(sys, cpu, cpu->current_power * cpu->power_scale);
xbt_dict_set(cpu_set, name, cpu, NULL);
static void parse_file(const char *file)
{
- new_cpu("Cpu A", 20.0, 1.0, NULL, SURF_CPU_ON, NULL);
- new_cpu("Cpu B", 120.0, 1.0, NULL, SURF_CPU_ON, NULL);
+ tmgr_trace_t trace_A = tmgr_trace_new("trace_A.txt");
+ tmgr_trace_t trace_B = tmgr_trace_new("trace_B.txt");
+
+ new_cpu("Cpu A", 20.0, 1.0, trace_A, SURF_CPU_ON, NULL);
+ new_cpu("Cpu B", 120.0, 1.0, trace_B, SURF_CPU_ON, NULL);
}
static void *name_service(const char *name)
min = action->generic_action.remains / value ;
xbt_swag_foreach(action,running_actions) {
- /* If everything is stable... */
value = action->generic_action.remains /
lmm_variable_getvalue(action->variable);
if(value<min) min=value;
surf_resource_t resource = NULL;
int i;
+ while ((next_event_date = tmgr_history_next_date(history)) != -1.0) {
+ if(next_event_date > NOW) break;
+ while (tmgr_history_get_next_event_leq(history, next_event_date,
+ &value, (void **) &resource)) {
+ if(surf_cpu_resource->resource.resource_used(resource)) {
+ min = next_event_date-NOW;
+ }
+ }
+ }
+
xbt_dynar_foreach (resource_list,i,resource) {
resource_next_action_end = resource->share_resources(NOW);
if((min<0) || (resource_next_action_end<min))