Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move e_surf_link_sharing_policy_t structure to surf.h and fix the way to create link...
[simgrid.git] / src / surf / surf_routing.c
index 76b9585..021d218 100644 (file)
@@ -51,9 +51,8 @@ void routing_model_create(size_t size_of_links, void* loopback) {
   }
   fprintf(stderr,"Routing model %s not found. Existing models:\n",wanted);
   for (cpt=0;models[cpt].name;cpt++)
-    if (!strcmp(wanted,models[cpt].name))
-      fprintf(stderr,"   %s: %s\n",models[cpt].name,models[cpt].desc);
-  exit(1);
+    fprintf(stderr,"   %s: %s\n",models[cpt].name,models[cpt].desc);
+  xbt_die("Invalid model.");
 }
 
 /* ************************************************************************** */
@@ -100,8 +99,8 @@ static void routing_full_parse_Srouter(void) {
   *val = HOST2ROUTER(used_routing->router_count++);
   xbt_dict_set(used_routing->host_id,A_surfxml_router_id,val,xbt_free);
 #ifdef HAVE_TRACING
-  TRACE_surf_host_define_id (A_surfxml_host_id, *val);
-  TRACE_surf_host_declaration (A_surfxml_host_id, 0);
+  TRACE_surf_host_define_id (A_surfxml_router_id, *val);
+  TRACE_surf_host_declaration (A_surfxml_router_id, 0);
 #endif
 }
 
@@ -1059,7 +1058,7 @@ static void routing_model_none_create(size_t size_of_link,void *loopback) {
  * FIXME : better to add to the routing model instead !!
  *
  */
-void routing_set_route(char *source_id,char *destination_id,xbt_dynar_t links_id,int action)
+void routing_add_route(char *source_id,char *destination_id,xbt_dynar_t links_id,int action)
 {
     char * link_id;
     char * name;
@@ -1078,6 +1077,7 @@ void routing_set_route(char *source_id,char *destination_id,xbt_dynar_t links_id
           manage_route(route_table, name, route_action, 0);
           free(name);
        }
+
 }
 
 void routing_add_host(char* host_id)
@@ -1086,7 +1086,9 @@ void routing_add_host(char* host_id)
        DEBUG2("Seen host %s (#%d)",host_id,used_routing->host_count);
        *val = used_routing->host_count++;
        xbt_dict_set(used_routing->host_id,host_id,val,xbt_free);
-       #ifdef HAVE_TRACING
-         TRACE_surf_host_define_id (host_id, *val);
-       #endif
+}
+
+void routing_set_routes()
+{
+       routing_full_parse_end();
 }