From: Martin Quinson Date: Mon, 14 Nov 2011 16:01:02 +0000 (+0100) Subject: nah, properties in the XML file are not the right place to pass configuration options X-Git-Tag: exp_20120216~287 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/bf9d5bacbde74aff8aa5588e679da6731d313371 nah, properties in the XML file are not the right place to pass configuration options 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 handler, no need to also do it for the generic handler. Doing so anyway would prevent to pass "coordinates" (user-)properties to hosts, links and such. --- diff --git a/examples/msg/masterslave/masterslave_vivaldi.tesh b/examples/msg/masterslave/masterslave_vivaldi.tesh index 314c967f85..037f150f8e 100644 --- a/examples/msg/masterslave/masterslave_vivaldi.tesh +++ b/examples/msg/masterslave/masterslave_vivaldi.tesh @@ -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" diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 9e4cd80a99..83a8612672 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -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); } /**