return xbt_dict_get_or_null(cpu_set, name);
}
-static const char *get_model_name(void *model_id)
+static const char *get_resource_name(void *resource_id)
{
- return ((cpu_Cas01_t) model_id)->name;
+ return ((cpu_Cas01_t) resource_id)->name;
}
-static int model_used(void *model_id)
+static int resource_used(void *resource_id)
{
return lmm_constraint_used(cpu_maxmin_system,
- ((cpu_Cas01_t) model_id)->constraint);
+ ((cpu_Cas01_t) resource_id)->constraint);
}
static int action_free(surf_action_t action)
return;
}
-static double share_models(double now)
+static double share_resources(double now)
{
s_surf_action_cpu_Cas01_t action;
- return generic_maxmin_share_models2(surf_cpu_model->common_public->
- states.running_action_set,
- xbt_swag_offset(action, variable),
- cpu_maxmin_system, lmm_solve);
+ return generic_maxmin_share_resources(surf_cpu_model->common_public->
+ states.running_action_set,
+ xbt_swag_offset(action, variable),
+ cpu_maxmin_system, lmm_solve);
}
static void update_actions_state(double now, double delta)
return;
}
-static void update_model_state(void *id,
+static void update_resource_state(void *id,
tmgr_trace_event_t event_type,
double value)
{
xbt_swag_new(xbt_swag_offset(action, state_hookup));
surf_cpu_model->common_public->name_service = name_service;
- surf_cpu_model->common_public->get_model_name = get_model_name;
+ surf_cpu_model->common_public->get_resource_name = get_resource_name;
surf_cpu_model->common_public->action_get_state =
surf_action_get_state;
surf_cpu_model->common_public->action_get_start_time =
surf_cpu_model->common_public->action_set_data = surf_action_set_data;
surf_cpu_model->common_public->name = "CPU";
- surf_cpu_model->common_private->model_used = model_used;
- surf_cpu_model->common_private->share_models = share_models;
+ surf_cpu_model->common_private->resource_used = resource_used;
+ surf_cpu_model->common_private->share_resources = share_resources;
surf_cpu_model->common_private->update_actions_state =
update_actions_state;
- surf_cpu_model->common_private->update_model_state =
- update_model_state;
+ surf_cpu_model->common_private->update_resource_state =
+ update_resource_state;
surf_cpu_model->common_private->finalize = finalize;
surf_cpu_model->common_public->suspend = action_suspend;
surf_cpu_model->extension_public->get_available_speed =
get_available_speed;
- cpu_set = xbt_dict_new();
-
- if (!cpu_maxmin_system)
- cpu_maxmin_system = lmm_system_new();
+ if(!cpu_set) cpu_set = xbt_dict_new();
+ if (!cpu_maxmin_system) cpu_maxmin_system = lmm_system_new();
}
/*********************************************************************/