From: Martin Quinson Date: Tue, 8 Nov 2011 20:40:14 +0000 (+0100) Subject: implement cluster tag on top of sg_platf w/o XML black magic X-Git-Tag: exp_20120216~413 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f45e2007a36753d3447b2dad2ba85f9f92e34657 implement cluster tag on top of sg_platf w/o XML black magic --- diff --git a/src/instr/instr_routing.c b/src/instr/instr_routing.c index c81c10318a..b346c196ea 100644 --- a/src/instr/instr_routing.c +++ b/src/instr/instr_routing.c @@ -151,10 +151,10 @@ static void recursiveGraphExtraction (routing_component_t rc, container_t contai /* * Callbacks */ -static void instr_routing_parse_start_AS () +static void instr_routing_parse_start_AS (const char*id,const char*routing) { if (getRootContainer() == NULL){ - container_t root = newContainer (A_surfxml_AS_id, INSTR_AS, NULL); + container_t root = newContainer (id, INSTR_AS, NULL); instr_paje_init (root); if (TRACE_smpi_is_enabled()) { @@ -174,7 +174,7 @@ static void instr_routing_parse_start_AS () if (TRACE_needs_platform()){ container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1); - container_t new = newContainer (A_surfxml_AS_id, INSTR_AS, father); + container_t new = newContainer (id, INSTR_AS, father); xbt_dynar_push (currentContainer, &new); } } diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index be05319174..7d2262e4e9 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -1344,9 +1344,7 @@ void generic_src_dst_check(routing_component_t rc, const char *src, src,dst,src_as->name, dst_as->name,rc->name); } -void routing_parse_Scluster(void) -{ - static int AX_ptr = 0; +void routing_parse_Scluster(void) { char *host_id, *groups, *link_id = NULL; s_sg_platf_host_cbarg_t host; @@ -1367,16 +1365,8 @@ void routing_parse_Scluster(void) xbt_dynar_t radical_elements; xbt_dynar_t radical_ends; - static unsigned int surfxml_buffer_stack_stack_ptr = 1; - static unsigned int surfxml_buffer_stack_stack[1024]; - - surfxml_buffer_stack_stack[0] = 0; - surfxml_bufferstack_push(1); - - SURFXML_BUFFER_SET(AS_id, struct_cluster->id); - SURFXML_BUFFER_SET(AS_routing, "Cluster"); XBT_DEBUG("", struct_cluster->id); - SURFXML_START_TAG(AS); + sg_platf_new_AS_open(struct_cluster->id,"Cluster"); //Make all hosts radical_elements = xbt_str_split(struct_cluster->radical, ","); @@ -1473,8 +1463,6 @@ void routing_parse_Scluster(void) host_id = bprintf("%s%d%s", struct_cluster->prefix, i, struct_cluster->suffix); link_id = bprintf("%s_link_%d", struct_cluster->id, i); - A_surfxml_host_state = A_surfxml_host_state_ON; - XBT_DEBUG("", host_id, struct_cluster->power); host.id = host_id; if(strcmp(struct_cluster->availability_trace,"")){ @@ -1587,7 +1575,7 @@ void routing_parse_Scluster(void) link.latency = struct_cluster->bb_lat; link.state = SURF_RESOURCE_ON; - switch (AX_surfxml_cluster_bb_sharing_policy) { + switch (struct_cluster->bb_sharing_policy) { case A_surfxml_cluster_bb_sharing_policy_FATPIPE: link.policy = SURF_LINK_FATPIPE; break; @@ -1629,10 +1617,8 @@ void routing_parse_Scluster(void) xbt_dict_free(&patterns); XBT_DEBUG(""); - SURFXML_END_TAG(AS); + sg_platf_new_AS_close(); XBT_DEBUG(" "); - - surfxml_bufferstack_pop(1); } /* * This function take a string and replace parameters from patterns dict.