Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fixed a bug in add_route in all models + dict uses DJB2 hash func now + modified...
authorquasar <quasar@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 4 Dec 2007 14:01:00 +0000 (14:01 +0000)
committerquasar <quasar@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 4 Dec 2007 14:01:00 +0000 (14:01 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5101 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/platforms/metaxml.xml
src/cunit_unit.c
src/dict_unit.c
src/surf/network.c
src/surf/network_gtnets.c
src/surf/surfxml_parse.c
src/surf/workstation_KCCFLN05.c
src/surf/workstation_ptask_L07.c
src/xbt/dict.c
src/xbt/dict_private.h

index 3d31e0e..a223c7a 100644 (file)
@@ -32,8 +32,8 @@
   <!-- Define backbone for communication between Nancy and Lille-->
   <link id="INTER-bb" bandwidth="125000000" latency="0.000100"/>
 
-  <!-- 4. Define startpoint for Lille -> $* (All other hosts including Nancy hosts) routes (it is symmetric: $* -> Lille). It is the starting point so it overrides all previosly routes!!! -->
-  <route:multi src="Lille" dst="$*" action="OVERRIDE">
+  <!-- 4. Define startpoint for Lille -> $* (All other hosts including Nancy hosts) routes. It is the starting point so it overrides all previosly routes!!! -->
+  <route:multi src="Lille" dst="$*" action="OVERRIDE" symmetric="NO">
     <link:ctn id="$src"/>
   </route:multi>
 
index a38d38c..b4f05cf 100644 (file)
@@ -8,7 +8,7 @@
 /* GENERATED FILE, DO NOT EDIT */
 /*******************************/
 
-# 729 "xbt/cunit.c" 
+# 731 "xbt/cunit.c" 
 
 
 XBT_TEST_UNIT("expect",test_expected_failure,"expected failures") {
index 8064938..23e1716 100644 (file)
@@ -8,7 +8,7 @@
 /* GENERATED FILE, DO NOT EDIT */
 /*******************************/
 
-# 472 "xbt/dict.c" 
+# 603 "xbt/dict.c" 
 #include "xbt.h"
 #include "xbt/ex.h"
 #include "portable.h"
@@ -89,7 +89,7 @@ static void traverse(xbt_dict_t head) {
        xbt_test_log2("Seen #%d:  %s",++i,PRINTF_STR(key));
     }
     xbt_test_assert2(!data || !strcmp(key,data),
-                    "Key(%s) != value(%s). Abording\n",key,data);
+                    "Key(%s) != value(%s). Abording",key,data);
   }
 }
 
@@ -312,7 +312,7 @@ static int countelems(xbt_dict_t head) {
   }
   return res;
 }
-
+   
 XBT_TEST_UNIT("crash",test_dict_crash,"Crash test"){
   xbt_dict_t head=NULL;
   int i,j,k, nb;
@@ -363,7 +363,8 @@ XBT_TEST_UNIT("crash",test_dict_crash,"Crash test"){
     sprintf(key,"%d",j);
     xbt_dict_set(head,key,key,&free);
   }
-
+   /*xbt_dict_dump(head,(void (*)(void*))&printf);*/
+   
   xbt_test_add0("Count the elements (retrieving the key and data for each)");
   i = countelems(head);
   xbt_test_log1("There is %d elements",i);
@@ -377,7 +378,10 @@ XBT_TEST_UNIT("crash",test_dict_crash,"Crash test"){
       sprintf(key,"%d",j);
       data = xbt_dict_get(head,key);
       xbt_test_assert2(!strcmp(key,(char*)data),
-                      "key=%s != data=%s\n",key,(char*)data);
+                      "with get, key=%s != data=%s",key,(char*)data);
+      data = xbt_dict_get_ext(head,key,strlen(key));
+      xbt_test_assert2(!strcmp(key,(char*)data),
+                      "with get_ext, key=%s != data=%s",key,(char*)data);
     }
   }
   free(key);
index 697a674..b3b8adb 100644 (file)
@@ -226,7 +226,6 @@ static void add_route(void)
       }     
     }
     route_new(src_id, dst_id, link_list, nb_link);
-    xbt_dynar_free(&links);
    }
 
    xbt_dict_free(&route_table);
index fb04b38..a37cdac 100644 (file)
@@ -301,7 +301,6 @@ static void add_route()
       route_new(src_id, dst_id, link_name, nb_link);
     if (nb_link == 1)
       route_onehop_new(src_id, dst_id, link_name, nb_link);
-    xbt_dynar_free(&links);
    }
 
    xbt_dict_free(&route_table);
index 76ee1b5..7fd132a 100644 (file)
@@ -802,6 +802,7 @@ static void add_multi_links(const char* src, const char* dst, xbt_dynar_t links,
        val = xbt_strdup(src_name);
      else
        val = xbt_strdup(value);
+     DEBUG1("\t\tELEMENT: %s", val);
      xbt_dynar_push(route_link_list, &val);
    }    
    surfxml_call_cb_functions(ETag_surfxml_route_cb_list);
@@ -931,7 +932,7 @@ void parse_cluster(void)
    char * backbone_name = bprintf("%s_bb", cluster_id);
    parse_change_link_data(backbone_name, cluster_bb_bw, "", cluster_bb_lat, "", "");
    A_surfxml_link_state = A_surfxml_link_state_ON;
-   A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
+   A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE;
  
    SURFXML_START_TAG(link);
    SURFXML_END_TAG(link);
index fd1329e..62aaf4f 100644 (file)
@@ -909,6 +909,7 @@ static cpu_KCCFLN05_t cpu_new(const char *name, double power_scale,
                              xbt_dict_t cpu_properties_k)
 {
   cpu_KCCFLN05_t cpu = xbt_new0(s_cpu_KCCFLN05_t, 1);
+
   xbt_assert1(! xbt_dict_get_or_null(workstation_set, name),
              "Host '%s' declared several times in the platform file.",name);
 
@@ -1159,9 +1160,7 @@ static void parse_route_set_route(void)
 {
   char* name;
   if (src_id != -1 && dst_id != -1) {
-    name = bprintf("%x#%x#%lf#%lf#%lf#%lf",src_id, dst_id,impact_on_src,
-             impact_on_dst, impact_on_src_with_other_recv,
-             impact_on_dst_with_other_send);
+    name = bprintf("%x#%x",src_id, dst_id);
 
     manage_route(route_table, name, route_action, 0);
     free(name);
@@ -1211,24 +1210,26 @@ static void add_route(void)
 
     src_id = strtol(xbt_dynar_get_as(keys, 0, char*), &end, 16);
     dst_id = strtol(xbt_dynar_get_as(keys, 1, char*), &end, 16);
-    impact_on_src = atof(xbt_dynar_get_as(keys, 2, char*));
-    impact_on_dst = atof(xbt_dynar_get_as(keys, 3, char*));
-    impact_on_src_with_other_recv = atof(xbt_dynar_get_as(keys, 4, char*));
-    impact_on_dst_with_other_send = atof(xbt_dynar_get_as(keys, 5, char*));
+    /*ATTRIBUTES NOT USED ANYMORE. WILL BE REMOVED FROM MODEL.*/
+    impact_on_src = 0;//atof(xbt_dynar_get_as(keys, 2, char*));
+    impact_on_dst = 0; //atof(xbt_dynar_get_as(keys, 3, char*));
+    impact_on_src_with_other_recv = 0;//atof(xbt_dynar_get_as(keys, 4, char*));
+    impact_on_dst_with_other_send = 0;//atof(xbt_dynar_get_as(keys, 5, char*));
 
     char* link = NULL;
+    INFO2("%d - %d", src_id, dst_id);
     xbt_dynar_foreach (links, cpt, link) {
       TRY {
+       INFO1("\t%s",link);
         link_list[nb_link++] = xbt_dict_get(link_set, link);
       }
       CATCH(e) {
-        RETHROW1("Link %s not found (dict raised this exception: %s)", link);
+        RETHROW3("Link %s not found between %s and %s (dict raised this exception: %s)", link,src,dst);
       }     
     }
     route_new(src_id, dst_id, link_list, nb_link,impact_on_src,
              impact_on_dst, impact_on_src_with_other_recv,
              impact_on_dst_with_other_send);
-    xbt_dynar_free(&links);
    }
 
    xbt_dict_free(&route_table);
index 258322b..2d553ae 100644 (file)
@@ -935,7 +935,6 @@ static void add_route(void)
          }    
        }
        route_new(src_id, dst_id, link_list, nb_link);
-       xbt_dynar_free(&links);
    }
 
    xbt_dict_free(&route_table);
index 1c926c4..52e22b9 100644 (file)
@@ -7,7 +7,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-//#define DJB2_HASH_FUNCTION
+#define DJB2_HASH_FUNCTION
 //#define FNV_HASH_FUNCTION
 
 #include <string.h>
index bbb2ffb..1332b75 100644 (file)
@@ -20,7 +20,7 @@
 
 typedef struct xbt_dictelm_ *xbt_dictelm_t;
 
-#define MAX_FILL_PERCENT 60
+#define MAX_FILL_PERCENT 80
 
 typedef struct xbt_dictelm_ {
   char *key;