Damn, my eclipse fail that refactoring! That's manual, pity me...
- const char* V_host_id; //id
- double V_host_power_peak; //power
- int V_host_core; //core
- double V_host_power_scale; //availability
- tmgr_trace_t V_host_power_trace; //availability file
- e_surf_resource_state_t V_host_state_initial; //state
- tmgr_trace_t V_host_state_trace; //state file
- const char* V_host_coord;
+ const char* id;
+ double power_peak;
+ int core_amount;
+ double power_scale;
+ tmgr_trace_t power_trace;
+ e_surf_resource_state_t initial_state;
+ tmgr_trace_t state_trace;
+ const char* coord;
xbt_dict_t properties;
} s_sg_platf_host_cbarg_t, *sg_platf_host_cbarg_t;
xbt_dict_t properties;
} s_sg_platf_host_cbarg_t, *sg_platf_host_cbarg_t;
// get Id Value
lua_pushstring(L, "id");
lua_gettable(L, -2);
// get Id Value
lua_pushstring(L, "id");
lua_gettable(L, -2);
- host.V_host_id = lua_tostring(L, -1);
+ host.id = lua_tostring(L, -1);
lua_pop(L, 1);
// get power value
lua_pushstring(L, "power");
lua_gettable(L, -2);
lua_pop(L, 1);
// get power value
lua_pushstring(L, "power");
lua_gettable(L, -2);
- host.V_host_power_peak = lua_tonumber(L, -1);
+ host.power_peak = lua_tonumber(L, -1);
lua_pop(L, 1);
//get power_scale
lua_pushstring(L, "power_scale");
lua_gettable(L, -2);
lua_pop(L, 1);
//get power_scale
lua_pushstring(L, "power_scale");
lua_gettable(L, -2);
- host.V_host_power_scale = lua_tonumber(L, -1);
+ host.power_scale = lua_tonumber(L, -1);
lua_pop(L, 1);
//get power_trace
lua_pushstring(L, "power_trace");
lua_gettable(L, -2);
lua_pop(L, 1);
//get power_trace
lua_pushstring(L, "power_trace");
lua_gettable(L, -2);
- host.V_host_power_trace = tmgr_trace_new(lua_tostring(L, -1));
+ host.power_trace = tmgr_trace_new(lua_tostring(L, -1));
lua_pop(L, 1);
lua_pushstring(L, "core");
lua_gettable(L, -2);
lua_pop(L, 1);
lua_pushstring(L, "core");
lua_gettable(L, -2);
- host.V_host_core = lua_tonumber(L, -1);
- if (host.V_host_core == 0)
- host.V_host_core = 1;
+ host.core_amount = lua_tonumber(L, -1);
+ if (host.core_amount == 0)
+ host.core_amount = 1;
lua_pop(L, 1);
//get state initial
lua_pop(L, 1);
//get state initial
state = lua_tonumber(L, -1);
lua_pop(L, 1);
if (state)
state = lua_tonumber(L, -1);
lua_pop(L, 1);
if (state)
- host.V_host_state_initial = SURF_RESOURCE_ON;
+ host.initial_state = SURF_RESOURCE_ON;
- host.V_host_state_initial = SURF_RESOURCE_OFF;
+ host.initial_state = SURF_RESOURCE_OFF;
//get trace state
lua_pushstring(L, "state_trace");
lua_gettable(L, -2);
//get trace state
lua_pushstring(L, "state_trace");
lua_gettable(L, -2);
- host.V_host_state_trace = tmgr_trace_new(lua_tostring(L, -1));
+ host.state_trace = tmgr_trace_new(lua_tostring(L, -1));
lua_pop(L, 1);
sg_platf_new_host(&host);
lua_pop(L, 1);
sg_platf_new_host(&host);
static void instr_routing_parse_start_host (sg_platf_host_cbarg_t host)
{
container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
static void instr_routing_parse_start_host (sg_platf_host_cbarg_t host)
{
container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
- container_t new = newContainer (host->V_host_id, INSTR_HOST, father);
+ container_t new = newContainer (host->id, INSTR_HOST, father);
if (TRACE_categorized() || TRACE_uncategorized()) {
type_t power = getVariableType ("power", NULL, new->type);
if (TRACE_categorized() || TRACE_uncategorized()) {
type_t power = getVariableType ("power", NULL, new->type);
- new_pajeSetVariable (0, new, power, host->V_host_power_peak);
+ new_pajeSetVariable (0, new, power, host->power_peak);
}
if (TRACE_uncategorized()){
getVariableType ("power_used", "0.5 0.5 0.5", new->type);
}
if (TRACE_uncategorized()){
getVariableType ("power_used", "0.5 0.5 0.5", new->type);
static void parse_cpu_init(sg_platf_host_cbarg_t host)
{
static void parse_cpu_init(sg_platf_host_cbarg_t host)
{
- if(strcmp(host->V_host_coord,"")) xbt_die("Coordinates not implemented yet!");
-
- cpu_create_resource(host->V_host_id,
- host->V_host_power_peak,
- host->V_host_power_scale,
- host->V_host_power_trace,
- host->V_host_core,
- host->V_host_state_initial,
- host->V_host_state_trace,
+ if(strcmp(host->coord,"")) xbt_die("Coordinates not implemented yet!");
+
+ cpu_create_resource(host->id,
+ host->power_peak,
+ host->power_scale,
+ host->power_trace,
+ host->core_amount,
+ host->initial_state,
+ host->state_trace,
static void parse_cpu_im_init(sg_platf_host_cbarg_t host)
{
static void parse_cpu_im_init(sg_platf_host_cbarg_t host)
{
- cpu_im_create_resource(host->V_host_id,
- host->V_host_power_peak,
- host->V_host_power_scale,
- host->V_host_power_trace,
- host->V_host_core,
- host->V_host_state_initial,
- host->V_host_state_trace,
+ cpu_im_create_resource(host->id,
+ host->power_peak,
+ host->power_scale,
+ host->power_trace,
+ host->core_amount,
+ host->initial_state,
+ host->state_trace,
static void parse_cpu_ti_init(sg_platf_host_cbarg_t host)
{
static void parse_cpu_ti_init(sg_platf_host_cbarg_t host)
{
- cpu_ti_create_resource(host->V_host_id,
- host->V_host_power_peak,
- host->V_host_power_scale,
- host->V_host_power_trace,
- host->V_host_core,
- host->V_host_state_initial,
- host->V_host_state_trace,
+ cpu_ti_create_resource(host->id,
+ host->power_peak,
+ host->power_scale,
+ host->power_trace,
+ host->core_amount,
+ host->initial_state,
+ host->state_trace,
network_element_info_t info = NULL;
if (current_routing->hierarchy == SURF_ROUTING_NULL)
current_routing->hierarchy = SURF_ROUTING_BASE;
network_element_info_t info = NULL;
if (current_routing->hierarchy == SURF_ROUTING_NULL)
current_routing->hierarchy = SURF_ROUTING_BASE;
- xbt_assert(!xbt_lib_get_or_null(host_lib, host->V_host_id,ROUTING_HOST_LEVEL),
+ xbt_assert(!xbt_lib_get_or_null(host_lib, host->id,ROUTING_HOST_LEVEL),
"Reading a host, processing unit \"%s\" already exists",
"Reading a host, processing unit \"%s\" already exists",
xbt_assert(current_routing->set_processing_unit,
"no defined method \"set_processing_unit\" in \"%s\"",
current_routing->name);
xbt_assert(current_routing->set_processing_unit,
"no defined method \"set_processing_unit\" in \"%s\"",
current_routing->name);
- (*(current_routing->set_processing_unit)) (current_routing, host->V_host_id);
+ (*(current_routing->set_processing_unit)) (current_routing, host->id);
info = xbt_new0(s_network_element_info_t, 1);
info->rc_component = current_routing;
info->rc_type = SURF_NETWORK_ELEMENT_HOST;
info = xbt_new0(s_network_element_info_t, 1);
info->rc_component = current_routing;
info->rc_type = SURF_NETWORK_ELEMENT_HOST;
- xbt_lib_set(host_lib,host->V_host_id,ROUTING_HOST_LEVEL,(void *) info);
- if (host->V_host_coord && strcmp(host->V_host_coord,"")) {
+ xbt_lib_set(host_lib,host->id,ROUTING_HOST_LEVEL,(void *) info);
+ if (host->coord && strcmp(host->coord,"")) {
if(!COORD_HOST_LEVEL) xbt_die("To use coordinates, you must set configuration 'coordinates' to 'yes'");
if(!COORD_HOST_LEVEL) xbt_die("To use coordinates, you must set configuration 'coordinates' to 'yes'");
- xbt_dynar_t ctn = xbt_str_split_str(host->V_host_coord, " ");
+ xbt_dynar_t ctn = xbt_str_split_str(host->coord, " ");
xbt_dynar_shrink(ctn, 0);
xbt_dynar_shrink(ctn, 0);
- xbt_lib_set(host_lib,host->V_host_id,COORD_HOST_LEVEL,(void *) ctn);
+ xbt_lib_set(host_lib,host->id,COORD_HOST_LEVEL,(void *) ctn);
link_id = bprintf("%s_link_%d", struct_cluster->V_cluster_id, start);
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id, struct_cluster->S_cluster_power);
link_id = bprintf("%s_link_%d", struct_cluster->V_cluster_id, start);
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id, struct_cluster->S_cluster_power);
- host.V_host_id = host_id;
if(strcmp(struct_cluster->V_cluster_availability_file,"")){
xbt_dict_set(patterns, "radical", bprintf("%d", start), xbt_free);
char* tmp_availability_file = xbt_strdup(struct_cluster->V_cluster_availability_file);
xbt_str_varsubst(tmp_availability_file,patterns);
XBT_DEBUG("\tavailability_file=\"%s\"",tmp_availability_file);
if(strcmp(struct_cluster->V_cluster_availability_file,"")){
xbt_dict_set(patterns, "radical", bprintf("%d", start), xbt_free);
char* tmp_availability_file = xbt_strdup(struct_cluster->V_cluster_availability_file);
xbt_str_varsubst(tmp_availability_file,patterns);
XBT_DEBUG("\tavailability_file=\"%s\"",tmp_availability_file);
- host.V_host_power_trace = tmgr_trace_new(tmp_availability_file);
+ host.power_trace = tmgr_trace_new(tmp_availability_file);
xbt_free(tmp_availability_file);
}
else
xbt_free(tmp_availability_file);
}
else
char *tmp_state_file = xbt_strdup(struct_cluster->V_cluster_state_file);
xbt_str_varsubst(tmp_state_file,patterns);
XBT_DEBUG("\tstate_file=\"%s\"",tmp_state_file);
char *tmp_state_file = xbt_strdup(struct_cluster->V_cluster_state_file);
xbt_str_varsubst(tmp_state_file,patterns);
XBT_DEBUG("\tstate_file=\"%s\"",tmp_state_file);
- host.V_host_state_trace = tmgr_trace_new(tmp_state_file);
+ host.state_trace = tmgr_trace_new(tmp_state_file);
xbt_free(tmp_state_file);
}
else
xbt_free(tmp_state_file);
}
else
XBT_DEBUG("\tstate_file=\"\"");
}
XBT_DEBUG("\tstate_file=\"\"");
}
- host.V_host_power_peak = struct_cluster->S_cluster_power;
- host.V_host_power_scale = 1.0;
- host.V_host_core = struct_cluster->S_cluster_core;
- host.V_host_state_initial = SURF_RESOURCE_ON;
- host.V_host_coord = "";
+ host.power_peak = struct_cluster->S_cluster_power;
+ host.power_scale = 1.0;
+ host.core_amount = struct_cluster->S_cluster_core;
+ host.initial_state = SURF_RESOURCE_ON;
+ host.coord = "";
sg_platf_new_host(&host);
XBT_DEBUG("</host>");
sg_platf_new_host(&host);
XBT_DEBUG("</host>");
A_surfxml_host_state = A_surfxml_host_state_ON;
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id, struct_cluster->S_cluster_power);
A_surfxml_host_state = A_surfxml_host_state_ON;
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id, struct_cluster->S_cluster_power);
- host.V_host_id = host_id;
if(strcmp(struct_cluster->V_cluster_availability_file,"")){
xbt_dict_set(patterns, "radical", bprintf("%d", i), xbt_free);
char* tmp_availability_file = xbt_strdup(struct_cluster->V_cluster_availability_file);
xbt_str_varsubst(tmp_availability_file,patterns);
XBT_DEBUG("\tavailability_file=\"%s\"",tmp_availability_file);
if(strcmp(struct_cluster->V_cluster_availability_file,"")){
xbt_dict_set(patterns, "radical", bprintf("%d", i), xbt_free);
char* tmp_availability_file = xbt_strdup(struct_cluster->V_cluster_availability_file);
xbt_str_varsubst(tmp_availability_file,patterns);
XBT_DEBUG("\tavailability_file=\"%s\"",tmp_availability_file);
- host.V_host_power_trace = tmgr_trace_new(tmp_availability_file);
+ host.power_trace = tmgr_trace_new(tmp_availability_file);
xbt_free(tmp_availability_file);
}
else
xbt_free(tmp_availability_file);
}
else
char *tmp_state_file = xbt_strdup(struct_cluster->V_cluster_state_file);
xbt_str_varsubst(tmp_state_file,patterns);
XBT_DEBUG("\tstate_file=\"%s\"",tmp_state_file);
char *tmp_state_file = xbt_strdup(struct_cluster->V_cluster_state_file);
xbt_str_varsubst(tmp_state_file,patterns);
XBT_DEBUG("\tstate_file=\"%s\"",tmp_state_file);
- host.V_host_state_trace = tmgr_trace_new(tmp_state_file);
+ host.state_trace = tmgr_trace_new(tmp_state_file);
xbt_free(tmp_state_file);
}
else
xbt_free(tmp_state_file);
}
else
XBT_DEBUG("\tstate_file=\"\"");
}
XBT_DEBUG("\tstate_file=\"\"");
}
- host.V_host_power_peak = struct_cluster->S_cluster_power;
- host.V_host_power_scale = 1.0;
- host.V_host_core = struct_cluster->S_cluster_core;
- host.V_host_state_initial = SURF_RESOURCE_ON;
- host.V_host_coord = "";
+ host.power_peak = struct_cluster->S_cluster_power;
+ host.power_scale = 1.0;
+ host.core_amount = struct_cluster->S_cluster_core;
+ host.initial_state = SURF_RESOURCE_ON;
+ host.coord = "";
sg_platf_new_host(&host);
XBT_DEBUG("</host>");
sg_platf_new_host(&host);
XBT_DEBUG("</host>");
xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
host.properties = current_property_set = xbt_dict_new();
xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
host.properties = current_property_set = xbt_dict_new();
- host.V_host_id = A_surfxml_host_id;
- host.V_host_power_peak = get_cpu_power(A_surfxml_host_power);
- host.V_host_power_scale = surf_parse_get_double( A_surfxml_host_availability);
- host.V_host_core = surf_parse_get_int(A_surfxml_host_core);
- host.V_host_power_trace = tmgr_trace_new(A_surfxml_host_availability_file);
- host.V_host_state_trace = tmgr_trace_new(A_surfxml_host_state_file);
+ host.id = A_surfxml_host_id;
+ host.power_peak = get_cpu_power(A_surfxml_host_power);
+ host.power_scale = surf_parse_get_double( A_surfxml_host_availability);
+ host.core_amount = surf_parse_get_int(A_surfxml_host_core);
+ host.power_trace = tmgr_trace_new(A_surfxml_host_availability_file);
+ host.state_trace = tmgr_trace_new(A_surfxml_host_state_file);
xbt_assert((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)
xbt_assert((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)
- host.V_host_state_initial = SURF_RESOURCE_ON;
+ host.initial_state = SURF_RESOURCE_ON;
if (A_surfxml_host_state == A_surfxml_host_state_OFF)
if (A_surfxml_host_state == A_surfxml_host_state_OFF)
- host.V_host_state_initial = SURF_RESOURCE_OFF;
- host.V_host_coord = A_surfxml_host_coordinates;
+ host.initial_state = SURF_RESOURCE_OFF;
+ host.coord = A_surfxml_host_coordinates;
sg_platf_new_host(&host);
}
sg_platf_new_host(&host);
}
static void ptask_parse_cpu_init(sg_platf_host_cbarg_t host)
{
ptask_cpu_create_resource(
static void ptask_parse_cpu_init(sg_platf_host_cbarg_t host)
{
ptask_cpu_create_resource(
- host->V_host_id,
- host->V_host_power_peak,
- host->V_host_power_scale,
- host->V_host_power_trace,
- host->V_host_state_initial,
- host->V_host_state_trace,
+ host->id,
+ host->power_peak,
+ host->power_scale,
+ host->power_trace,
+ host->initial_state,
+ host->state_trace,