Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
nah, properties in the XML file are not the right place to pass configuration options
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 14 Nov 2011 16:01:02 +0000 (17:01 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 14 Nov 2011 20:20:19 +0000 (21:20 +0100)
Actually, the properties are the right location, but only when
included in a config tag. And in this setting, the right behavior is
already done by the </config> handler, no need to also do it for the
generic <prop> handler. Doing so anyway would prevent to pass
"coordinates" (user-)properties to hosts, links and such.

examples/msg/masterslave/masterslave_vivaldi.tesh
src/surf/surfxml_parse.c

index 314c967..037f150 100644 (file)
@@ -5,7 +5,7 @@ p Testing a simple master/slave example application
 $ $SG_TEST_EXENV ./masterslave/masterslave_mailbox  ${srcdir:=.}/../platforms/vivaldi.xml ${srcdir:=.}/masterslave/deployment_masterslave_vivaldi.xml --cfg=network/latency_factor:1.0 --cfg=network/bandwidth_factor:1.0
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/latency_factor' to '1.0'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/bandwidth_factor' to '1.0'
-> [0.000000] [surf_parse/INFO] Configuration change: Set 'coordinates' to 'yes'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'coordinates' to 'yes'
 > [100030591:master:(1) 0.000000] [msg_test/INFO] Got 39 slaves and 20 tasks to process
 > [100030591:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" (of 20) to mailbox "slave-0"
 > [100030591:master:(1) 0.046299] [msg_test/INFO] Sending "Task_1" (of 20) to mailbox "slave-1"
index 9e4cd80..83a8612 100644 (file)
@@ -570,19 +570,7 @@ void parse_properties(const char* prop_id, const char* prop_value)
 {
        if (!current_property_set)
            current_property_set = xbt_dict_new();      // Maybe, it should raise an error
-       if(!strcmp(prop_id,"coordinates")){
-               if(!strcmp(prop_value,"yes") && !COORD_HOST_LEVEL)
-                 {
-                           XBT_INFO("Configuration change: Set '%s' to '%s'", prop_id, prop_value);
-                               COORD_HOST_LEVEL = xbt_lib_add_level(host_lib,xbt_dynar_free_voidp);
-                               COORD_ASR_LEVEL  = xbt_lib_add_level(as_router_lib,xbt_dynar_free_voidp);
-                 }
-               if(strcmp(A_surfxml_prop_value,"yes"))
-                         xbt_die("Setting XML prop coordinates must be \"yes\"");
-         }
-       else{
-                 xbt_dict_set(current_property_set, prop_id, xbt_strdup(prop_value), free);
-        }
+       xbt_dict_set(current_property_set, prop_id, xbt_strdup(prop_value), free);
 }
 
 /**