void (*create_resource) (char *name, double power_peak,
double power_scale,
tmgr_trace_t power_trace,
+ int core,
e_surf_resource_state_t state_initial,
tmgr_trace_t state_trace,
xbt_dict_t cpu_properties);
XBT_PUBLIC(void) surf_host_create_resource(char *name, double power_peak,
double power_scale,
tmgr_trace_t power_trace,
+ int core,
e_surf_resource_state_t
state_initial,
tmgr_trace_t state_trace,
s_surf_resource_t generic_resource;
double power_peak;
double power_scale;
+ int core;
tmgr_trace_event_t power_event;
e_surf_resource_state_t state_current;
tmgr_trace_event_t state_event;
static cpu_Cas01_t cpu_new(char *name, double power_peak,
double power_scale,
tmgr_trace_t power_trace,
+ int core,
e_surf_resource_state_t state_initial,
tmgr_trace_t state_trace,
xbt_dict_t cpu_properties)
cpu->power_peak = power_peak;
xbt_assert0(cpu->power_peak > 0, "Power has to be >0");
cpu->power_scale = power_scale;
+ cpu->core = core;
+ xbt_assert1(core>0,"Invalid number of cores %d",core);
if (power_trace)
cpu->power_event =
tmgr_history_add_trace(history, power_trace, 0.0, 0, cpu);
{
double power_peak = 0.0;
double power_scale = 0.0;
+ int core = 0;
tmgr_trace_t power_trace = NULL;
e_surf_resource_state_t state_initial = SURF_RESOURCE_OFF;
tmgr_trace_t state_trace = NULL;
power_peak = get_cpu_power(A_surfxml_host_power);
surf_parse_get_double(&power_scale, A_surfxml_host_availability);
power_trace = tmgr_trace_new(A_surfxml_host_availability_file);
+ surf_parse_get_int(&core, A_surfxml_host_core);
xbt_assert0((A_surfxml_host_state == A_surfxml_host_state_ON) ||
(A_surfxml_host_state == A_surfxml_host_state_OFF),
current_property_set = xbt_dict_new();
cpu_new(xbt_strdup(A_surfxml_host_id), power_peak, power_scale,
- power_trace, state_initial, state_trace, current_property_set);
+ power_trace, core, state_initial, state_trace, current_property_set);
}
static void cpu_create_resource(char *name, double power_peak,
double power_scale,
tmgr_trace_t power_trace,
+ int core,
e_surf_resource_state_t state_initial,
tmgr_trace_t state_trace,
xbt_dict_t cpu_properties)
{
- cpu_new(name, power_peak, power_scale, power_trace,
+ cpu_new(name, power_peak, power_scale, power_trace, core,
state_initial, state_trace, cpu_properties);
}
static cpu_Cas01_im_t cpu_im_new(char *name, double power_peak,
double power_scale,
tmgr_trace_t power_trace,
+ int core,
e_surf_resource_state_t state_initial,
tmgr_trace_t state_trace,
xbt_dict_t cpu_properties)
s_surf_action_cpu_Cas01_im_t action;
cpu = xbt_new0(s_cpu_Cas01_im_t, 1);
+ xbt_assert0(core==1,"Multi-core not handled with this model yet");
#ifdef HAVE_TRACING
TRACE_surf_host_declaration(name, power_scale * power_peak);
#endif
{
double power_peak = 0.0;
double power_scale = 0.0;
+ int core = 0;
tmgr_trace_t power_trace = NULL;
e_surf_resource_state_t state_initial = SURF_RESOURCE_OFF;
tmgr_trace_t state_trace = NULL;
power_peak = get_cpu_power(A_surfxml_host_power);
surf_parse_get_double(&power_scale, A_surfxml_host_availability);
power_trace = tmgr_trace_new(A_surfxml_host_availability_file);
+ surf_parse_get_int(&core, A_surfxml_host_core);
xbt_assert0((A_surfxml_host_state == A_surfxml_host_state_ON) ||
(A_surfxml_host_state == A_surfxml_host_state_OFF),
current_property_set = xbt_dict_new();
cpu_im_new(xbt_strdup(A_surfxml_host_id), power_peak, power_scale,
- power_trace, state_initial, state_trace,
+ power_trace, core, state_initial, state_trace,
current_property_set);
}
static void cpu_im_create_resource(char *name, double power_peak,
double power_scale,
tmgr_trace_t power_trace,
+ int core,
e_surf_resource_state_t state_initial,
tmgr_trace_t state_trace,
xbt_dict_t cpu_properties)
{
- cpu_im_new(name, power_peak, power_scale, power_trace,
+ xbt_assert0(core==1,"Multi-core not handled with this model yet");
+ cpu_im_new(name, power_peak, power_scale, power_trace, core,
state_initial, state_trace, cpu_properties);
}
static cpu_ti_t cpu_ti_new(char *name, double power_peak,
double power_scale,
tmgr_trace_t power_trace,
+ int core,
e_surf_resource_state_t state_initial,
tmgr_trace_t state_trace,
xbt_dict_t cpu_properties)
xbt_assert1(!surf_model_resource_by_name(surf_cpu_model, name),
"Host '%s' declared several times in the platform file",
name);
+ xbt_assert0(core==1,"Multi-core not handled with this model yet");
cpu->action_set =
xbt_swag_new(xbt_swag_offset(ti_action, cpu_list_hookup));
cpu->generic_resource.model = surf_cpu_model;
{
double power_peak = 0.0;
double power_scale = 0.0;
+ int core = 0;
tmgr_trace_t power_trace = NULL;
e_surf_resource_state_t state_initial = SURF_RESOURCE_OFF;
tmgr_trace_t state_trace = NULL;
power_peak = get_cpu_power(A_surfxml_host_power);
surf_parse_get_double(&power_scale, A_surfxml_host_availability);
power_trace = tmgr_trace_new(A_surfxml_host_availability_file);
+ surf_parse_get_int(&core, A_surfxml_host_core);
xbt_assert0((A_surfxml_host_state == A_surfxml_host_state_ON) ||
(A_surfxml_host_state == A_surfxml_host_state_OFF),
current_property_set = xbt_dict_new();
cpu_ti_new(xbt_strdup(A_surfxml_host_id), power_peak, power_scale,
- power_trace, state_initial, state_trace,
+ power_trace, core, state_initial, state_trace,
current_property_set);
}
static void cpu_ti_create_resource(char *name, double power_peak,
double power_scale,
tmgr_trace_t power_trace,
+ int core,
e_surf_resource_state_t state_initial,
tmgr_trace_t state_trace,
xbt_dict_t cpu_properties)
{
- cpu_ti_new(name, power_peak, power_scale, power_trace,
+ xbt_assert0(core==1,"Multi-core not handled with this model yet");
+ cpu_ti_new(name, power_peak, power_scale, power_trace, core,
state_initial, state_trace, cpu_properties);
}
*/
void surf_host_create_resource(char *name, double power_peak,
double power_scale,
- tmgr_trace_t power_trace,
+ tmgr_trace_t power_trace, int core,
e_surf_resource_state_t state_initial,
tmgr_trace_t state_trace,
xbt_dict_t cpu_properties)
return surf_cpu_model->extension.cpu.create_resource(name, power_peak,
power_scale,
power_trace,
+ core,
state_initial,
state_trace,
cpu_properties);