Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix the last broken tests by sanitizing the way properties are handled during the...
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 7 Nov 2011 13:11:01 +0000 (14:11 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 7 Nov 2011 13:11:01 +0000 (14:11 +0100)
include/simgrid/platf.h
src/surf/cpu.c
src/surf/cpu_im.c
src/surf/cpu_ti.c
src/surf/network_constant.c
src/surf/surfxml_parse.c
src/surf/workstation_ptask_L07.c

index 79aee43..fc3704c 100644 (file)
@@ -39,6 +39,7 @@ typedef struct {
   e_surf_resource_state_t V_host_state_initial;           //state
   tmgr_trace_t V_host_state_trace;                  //state file
   const char* V_host_coord;
+  xbt_dict_t properties;
 } s_sg_platf_host_cbarg_t, *sg_platf_host_cbarg_t;
 
 typedef struct {
index fe1b2f2..b7012df 100644 (file)
@@ -82,8 +82,7 @@ static void parse_cpu_init(sg_platf_host_cbarg_t host)
                  host->V_host_core,
                  host->V_host_state_initial,
                  host->V_host_state_trace,
-                 current_property_set);
-  current_property_set = NULL;
+                 host->properties);
 }
 
 static void add_traces_cpu(void)
index 01630f2..ada8774 100644 (file)
@@ -97,8 +97,7 @@ static void parse_cpu_im_init(sg_platf_host_cbarg_t host)
                          host->V_host_core,
                          host->V_host_state_initial,
                          host->V_host_state_trace,
-                         current_property_set);
-       current_property_set = NULL;
+                         host->properties);
 }
 
 static void cpu_im_add_traces_cpu(void)
index 206e7dd..7c1a1a6 100644 (file)
@@ -199,8 +199,7 @@ static void parse_cpu_ti_init(sg_platf_host_cbarg_t host)
                          host->V_host_core,
                          host->V_host_state_initial,
                          host->V_host_state_trace,
-                         current_property_set);
-  current_property_set = NULL;
+                         host->properties);
 
 }
 
index a94f7ac..c733bc8 100644 (file)
@@ -21,13 +21,11 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 static random_data_t random_latency = NULL;
 static int host_number_int = 0;
 
-static void netcste_count_hosts(sg_platf_host_cbarg_t h)
-{
+static void netcste_count_hosts(sg_platf_host_cbarg_t h) {
   host_number_int++;
 }
 
-static void netcste_define_callbacks(void)
-{
+static void netcste_define_callbacks(void) {
   sg_platf_host_add_cb(netcste_count_hosts);
 }
 
index ffa11fc..69f87ca 100644 (file)
@@ -292,6 +292,9 @@ void STag_surfxml_host(void){
   s_sg_platf_host_cbarg_t host;
   memset(&host,0,sizeof(host));
 
+  xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
+  host.properties = current_property_set = xbt_dict_new();
+
        host.V_host_id = A_surfxml_host_id;
        host.V_host_power_peak = get_cpu_power(A_surfxml_host_power);
        host.V_host_power_scale = surf_parse_get_double( A_surfxml_host_availability);
@@ -309,6 +312,7 @@ void STag_surfxml_host(void){
        sg_platf_new_host(&host);
 }
 void ETag_surfxml_host(void){
+  current_property_set = NULL;
        surfxml_call_cb_functions(ETag_surfxml_host_cb_list);
 }
 
index ac1c51c..087e1a7 100644 (file)
@@ -663,8 +663,7 @@ static void ptask_parse_cpu_init(sg_platf_host_cbarg_t host)
                  host->V_host_power_trace,
                  host->V_host_state_initial,
                  host->V_host_state_trace,
-                 current_property_set);
-  current_property_set=NULL;
+                 host->properties);
 }
 
 static void* ptask_link_create_resource(const char *name,