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
Clean callbacks for the host parsing.
[simgrid.git]
/
src
/
instr
/
instr_routing.c
diff --git
a/src/instr/instr_routing.c
b/src/instr/instr_routing.c
index
4371113
..
9d7488c
100644
(file)
--- a/
src/instr/instr_routing.c
+++ b/
src/instr/instr_routing.c
@@
-190,19
+190,19
@@
static void instr_routing_parse_start_link ()
{
container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
- double bandwidth_value = lnk->V_link_bandwidth;
- double latency_value = lnk->V_link_latency;
+ double bandwidth_value =
struct_
lnk->V_link_bandwidth;
+ double latency_value =
struct_
lnk->V_link_latency;
xbt_dynar_t links_to_create = xbt_dynar_new (sizeof(char*), &xbt_free_ref);
- if (lnk->V_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX){
- char *up = bprintf("%s_UP", lnk->V_link_id);
- char *down = bprintf("%s_DOWN", lnk->V_link_id);
+ if (
struct_
lnk->V_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX){
+ char *up = bprintf("%s_UP",
struct_
lnk->V_link_id);
+ char *down = bprintf("%s_DOWN",
struct_
lnk->V_link_id);
xbt_dynar_push_as (links_to_create, char*, xbt_strdup(up));
xbt_dynar_push_as (links_to_create, char*, xbt_strdup(down));
free (up);
free (down);
}else{
- xbt_dynar_push_as (links_to_create, char*, strdup(lnk->V_link_id));
+ xbt_dynar_push_as (links_to_create, char*, strdup(
struct_
lnk->V_link_id));
}
char *link_name = NULL;
@@
-225,11
+225,7
@@
static void instr_routing_parse_start_link ()
xbt_dynar_free (&links_to_create);
}
-static void instr_routing_parse_end_link ()
-{
-}
-
-static void instr_routing_parse_start_host ()
+static void instr_routing_parse_start_host (surf_parsing_host_arg_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);
@@
-270,18
+266,10
@@
static void instr_routing_parse_start_host ()
}
}
-static void instr_routing_parse_end_host ()
-{
-}
-
static void instr_routing_parse_start_router ()
{
container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
- newContainer (router->V_router_id, INSTR_ROUTER, father);
-}
-
-static void instr_routing_parse_end_router ()
-{
+ newContainer (struct_router->V_router_id, INSTR_ROUTER, father);
}
static void instr_routing_parse_end_platform ()
@@
-304,11
+292,8
@@
void instr_routing_define_callbacks ()
surfxml_add_callback(ETag_surfxml_AS_cb_list, &instr_routing_parse_end_AS);
if (!TRACE_needs_platform()) return;
surfxml_add_callback(STag_surfxml_link_cb_list, &instr_routing_parse_start_link);
- surfxml_add_callback(ETag_surfxml_link_cb_list, &instr_routing_parse_end_link);
- surfxml_add_callback(STag_surfxml_host_cb_list, &instr_routing_parse_start_host);
- surfxml_add_callback(ETag_surfxml_host_cb_list, &instr_routing_parse_end_host);
+ surf_parse_host_add_cb(instr_routing_parse_start_host);
surfxml_add_callback(STag_surfxml_router_cb_list, &instr_routing_parse_start_router);
- surfxml_add_callback(ETag_surfxml_router_cb_list, &instr_routing_parse_end_router);
surfxml_add_callback(ETag_surfxml_platform_cb_list, &instr_routing_parse_end_platform);
}