Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add function surf_add_route_element
authorcoldpeace <coldpeace@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 18 Jul 2010 20:45:52 +0000 (20:45 +0000)
committercoldpeace <coldpeace@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 18 Jul 2010 20:45:52 +0000 (20:45 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8032 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/bindings/lua/simgrid_lua.c
src/include/surf/surf.h
src/surf/surfxml_parse.c

index 47da1a5..0c6e8fb 100644 (file)
@@ -639,6 +639,9 @@ static int surf_parse_bypass_platform()
                        SURFXML_BUFFER_SET(link_c_ctn_id,link_id);
                        SURFXML_START_TAG(link_c_ctn);
                        SURFXML_END_TAG(link_c_ctn);
+#ifdef BYPASS_MODEL
+                       surf_add_route_element(link_id);
+#endif
                }
 
                SURFXML_END_TAG(route);
index 3f3b604..cc2847d 100644 (file)
@@ -668,6 +668,15 @@ XBT_PUBLIC(void) surf_host_create_resource(char *name, double power_peak,
 XBT_PUBLIC(void) surf_link_create_resouce(char *name,
         double bw_initial,double lat_initial);
 
+
+/**
+ * add route element (link_ctn) bypassing the parser
+ *
+ * see surfxml_parse.c
+ *
+ */
+XBT_PUBLIC(void) surf_add_route_element(char *link_ctn_id);
+
 #include "surf/surf_resource.h"
 #include "surf/surf_resource_lmm.h"
 
index 88fad91..4d4bbb2 100644 (file)
@@ -464,7 +464,6 @@ void surf_parse_close(void)
   }
 }
 
-
 static int _surf_parse(void)
 {
   return surf_parse_lex();
@@ -879,7 +878,7 @@ void manage_route(xbt_dict_t routing_table, const char *route_name,
       xbt_dynar_free(&links);
       break;
     case A_surfxml_route_action_POSTPEND:      /* add existing links in front; links + route_link_list */
-      xbt_dynar_foreach(route_link_list, cpt, value) {
+       xbt_dynar_foreach(route_link_list, cpt, value) {
         xbt_dynar_push(links, &value);
       }
       xbt_dynar_free(&route_link_list);
@@ -893,6 +892,7 @@ void manage_route(xbt_dict_t routing_table, const char *route_name,
           route_name,action));
       break;
     }
+
   }
   /* this is the final route; do not add if name is a set; add only if name is in set list */
   if (!isMultiRoute) {
@@ -1187,3 +1187,13 @@ void surf_link_create_resouce(char *name,
             create_resource(name,bw_initial,lat_initial);
 
 }
+
+/**
+ * Route: add route element bypassing the parser :
+ * same job as parse_route_elem
+ */
+
+void surf_add_route_element(char* link_ctn_id)
+{
+       xbt_dynar_push(route_link_list,&link_ctn_id);
+}