A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
normalize some type names
[simgrid.git]
/
src
/
surf
/
surf_routing.c
diff --git
a/src/surf/surf_routing.c
b/src/surf/surf_routing.c
index
cfdc466
..
4544514
100644
(file)
--- a/
src/surf/surf_routing.c
+++ b/
src/surf/surf_routing.c
@@
-95,7
+95,7
@@
struct s_model_type routing_models[] = { {"Full",
{"Vivaldi", "Vivaldi routing", model_rulebased_create,
model_rulebased_load, model_rulebased_unload, model_rulebased_end},
{"Cluster", "Cluster routing", model_cluster_create,
- model_
cluster_load, model_cluster_unload, model_cluster
_end},
+ model_
rulebased_load, model_rulebased_unload, model_rulebased
_end},
{NULL, NULL, NULL, NULL, NULL, NULL}
};
@@
-1508,17
+1508,18
@@
void routing_parse_Scluster(void)
static int AX_ptr = 0;
char *host_id, *groups, *link_id = NULL;
- char *availability_file = xbt_strdup(A_surfxml_cluster_availability_file);
- char *state_file = xbt_strdup(A_surfxml_cluster_state_file);
-
- if(xbt_dict_size(patterns)==0)
- patterns = xbt_dict_new();
- xbt_dict_set(patterns,"id",struct_cluster->V_cluster_id,NULL);
- xbt_dict_set(patterns,"prefix",struct_cluster->V_cluster_prefix,NULL);
- xbt_dict_set(patterns,"suffix",struct_cluster->V_cluster_suffix,NULL);
+ if( strcmp(struct_cluster->V_cluster_availability_file,"")
+ || strcmp(struct_cluster->V_cluster_state_file,"") )
+ {
+ if(xbt_dict_size(patterns)==0)
+ patterns = xbt_dict_new();
+ XBT_INFO("'%s' '%s'",A_surfxml_cluster_state_file,struct_cluster->V_cluster_availability_file);
+ xbt_dict_set(patterns,"id",struct_cluster->V_cluster_id,NULL);
+ xbt_dict_set(patterns,"prefix",struct_cluster->V_cluster_prefix,NULL);
+ xbt_dict_set(patterns,"suffix",struct_cluster->V_cluster_suffix,NULL);
+ }
- char *route_src_dst;
unsigned int iter;
int start, end, i;
xbt_dynar_t radical_elements;
@@
-1548,13
+1549,13
@@
void routing_parse_Scluster(void)
surf_parse_get_int(&start, xbt_dynar_get_as(radical_ends, 0, char *));
host_id = bprintf("%s%d%s", struct_cluster->V_cluster_prefix, start, struct_cluster->V_cluster_suffix);
link_id = bprintf("%s_link_%d", struct_cluster->V_cluster_id, start);
- xbt_dict_set(patterns, "radical", bprintf("%d", start), xbt_free);
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id, struct_cluster->S_cluster_power);
- struct_host = xbt_new0(s_
hostSG
_t, 1);
+ struct_host = xbt_new0(s_
surf_parsing_host_arg
_t, 1);
struct_host->V_host_id = host_id;
- if(!strcmp(A_surfxml_cluster_availability_file,"")){
- char* tmp_availability_file = xbt_strdup(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);
struct_host->V_host_power_trace = tmgr_trace_new(tmp_availability_file);
@@
-1564,8
+1565,8
@@
void routing_parse_Scluster(void)
{
XBT_DEBUG("\tavailability_file=\"\"");
}
- if(
!strcmp(A_surfxml
_cluster_state_file,"")){
- char *tmp_state_file = xbt_strdup(state_file);
+ if(
strcmp(struct_cluster->V
_cluster_state_file,"")){
+ char *tmp_state_file = xbt_strdup(st
ruct_cluster->V_cluster_st
ate_file);
xbt_str_varsubst(tmp_state_file,patterns);
XBT_DEBUG("\tstate_file=\"%s\"",tmp_state_file);
struct_host->V_host_state_trace = tmgr_trace_new(tmp_state_file);
@@
-1592,7
+1593,7
@@
void routing_parse_Scluster(void)
XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id,struct_cluster->S_cluster_bw, struct_cluster->S_cluster_lat);
- struct_lnk = xbt_new0(s_
link
_t, 1);
+ struct_lnk = xbt_new0(s_
surf_parsing_link_arg
_t, 1);
struct_lnk->V_link_id = link_id;
struct_lnk->V_link_bandwidth = struct_cluster->S_cluster_bw;
struct_lnk->V_link_latency = struct_cluster->S_cluster_lat;
@@
-1616,26
+1617,7
@@
void routing_parse_Scluster(void)
xbt_dict_set(cluster_host_link,host_id,strdup(link_id),free);
// XBT_INFO("key '%s' Value '%s'",host_id,link_id);
ETag_surfxml_host();
- xbt_free(struct_host->V_host_id);
- struct_host->V_host_power_peak = 0.0;
- struct_host->V_host_core = 0;
- struct_host->V_host_power_scale = 0.0;
- struct_host->V_host_state_initial = SURF_RESOURCE_ON;
- struct_host->V_host_power_trace = NULL;
- struct_host->V_host_state_trace = NULL;
- xbt_free(struct_host->V_host_coord);
- xbt_free(struct_host);
-
ETag_surfxml_link();
- xbt_free(struct_lnk->V_link_id);
- struct_lnk->V_link_bandwidth = 0;
- struct_lnk->V_link_bandwidth_file = NULL;
- struct_lnk->V_link_latency = 0;
- struct_lnk->V_link_latency_file = NULL;
- struct_lnk->V_link_state = SURF_RESOURCE_ON;
- struct_lnk->V_link_state_file = NULL;
- struct_lnk->V_link_sharing_policy = 0;
- xbt_free(struct_lnk);
break;
@@
-1647,14
+1629,15
@@
void routing_parse_Scluster(void)
for (i = start; i <= end; i++) {
host_id = bprintf("%s%d%s", struct_cluster->V_cluster_prefix, i, struct_cluster->V_cluster_suffix);
link_id = bprintf("%s_link_%d", struct_cluster->V_cluster_id, i);
- xbt_dict_set(patterns, "radical", bprintf("%d", i), xbt_free);
+
A_surfxml_host_state = A_surfxml_host_state_ON;
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id, struct_cluster->S_cluster_power);
- struct_host = xbt_new0(s_
hostSG
_t, 1);
+ struct_host = xbt_new0(s_
surf_parsing_host_arg
_t, 1);
struct_host->V_host_id = host_id;
- if(!strcmp(A_surfxml_cluster_availability_file,"")){
- char* tmp_availability_file = xbt_strdup(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);
struct_host->V_host_power_trace = tmgr_trace_new(tmp_availability_file);
@@
-1664,8
+1647,8
@@
void routing_parse_Scluster(void)
{
XBT_DEBUG("\tavailability_file=\"\"");
}
- if(
!strcmp(A_surfxml
_cluster_state_file,"")){
- char *tmp_state_file = xbt_strdup(state_file);
+ if(
strcmp(struct_cluster->V
_cluster_state_file,"")){
+ char *tmp_state_file = xbt_strdup(st
ruct_cluster->V_cluster_st
ate_file);
xbt_str_varsubst(tmp_state_file,patterns);
XBT_DEBUG("\tstate_file=\"%s\"",tmp_state_file);
struct_host->V_host_state_trace = tmgr_trace_new(tmp_state_file);
@@
-1680,7
+1663,7
@@
void routing_parse_Scluster(void)
struct_host->V_host_power_scale = 1.0;
struct_host->V_host_core = struct_cluster->S_cluster_core;
struct_host->V_host_state_initial = SURF_RESOURCE_ON;
- struct_host->V_host_coord =
xbt_strdup("")
;
+ struct_host->V_host_coord =
""
;
STag_surfxml_host_cluster();
XBT_DEBUG("</host>");
@@
-1692,7
+1675,7
@@
void routing_parse_Scluster(void)
XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id,struct_cluster->S_cluster_bw, struct_cluster->S_cluster_lat);
- struct_lnk = xbt_new0(s_
link
_t, 1);
+ struct_lnk = xbt_new0(s_
surf_parsing_link_arg
_t, 1);
struct_lnk->V_link_id = link_id;
struct_lnk->V_link_bandwidth = struct_cluster->S_cluster_bw;
struct_lnk->V_link_latency = struct_cluster->S_cluster_lat;
@@
-1717,26
+1700,8
@@
void routing_parse_Scluster(void)
// XBT_INFO("key '%s' Value '%s'",host_id,link_id);
ETag_surfxml_host();
- xbt_free(struct_host->V_host_id);
- struct_host->V_host_power_peak = 0.0;
- struct_host->V_host_core = 0;
- struct_host->V_host_power_scale = 0.0;
- struct_host->V_host_state_initial = SURF_RESOURCE_ON;
- struct_host->V_host_power_trace = NULL;
- struct_host->V_host_state_trace = NULL;
- xbt_free(struct_host->V_host_coord);
- xbt_free(struct_host);
-
ETag_surfxml_link();
- xbt_free(struct_lnk->V_link_id);
- struct_lnk->V_link_bandwidth = 0;
- struct_lnk->V_link_bandwidth_file = NULL;
- struct_lnk->V_link_latency = 0;
- struct_lnk->V_link_latency_file = NULL;
- struct_lnk->V_link_state = SURF_RESOURCE_ON;
- struct_lnk->V_link_state_file = NULL;
- struct_lnk->V_link_sharing_policy = 0;
- xbt_free(struct_lnk);
+
}
break;
@@
-1764,7
+1729,7
@@
void routing_parse_Scluster(void)
if(cluster_bb_sharing_policy == A_surfxml_cluster_bb_sharing_policy_FATPIPE)
{A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE;}
- struct_lnk = xbt_new0(s_
link
_t, 1);
+ struct_lnk = xbt_new0(s_
surf_parsing_link_arg
_t, 1);
struct_lnk->V_link_id = link_backbone;
struct_lnk->V_link_bandwidth = struct_cluster->S_cluster_bb_bw;
struct_lnk->V_link_latency = struct_cluster->S_cluster_bb_lat;
@@
-1786,7
+1751,6
@@
void routing_parse_Scluster(void)
STag_surfxml_link_cluster();
ETag_surfxml_link();
- free(link_backbone);
}
XBT_DEBUG(" ");
@@
-1804,10
+1768,10
@@
void routing_parse_Scluster(void)
xbt_dynar_free(&radical_elements);
xbt_free(new_suffix);
- xbt_free(availability_file);
- xbt_free(state_file);
- xbt_dict_free(&patterns);
+ if( strcmp(struct_cluster->V_cluster_availability_file,"")
+ || strcmp(struct_cluster->V_cluster_state_file,"") )
+ xbt_dict_free(&patterns);
XBT_DEBUG("</AS>");
SURFXML_END_TAG(AS);