$ $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'
> [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) 46.298715] [msg_test/INFO] Sending "Task_1" (of 20) to mailbox "slave-1"
<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
<platform version="3">
+
+<config id="General">
+ <prop id="coordinates" value="yes"></prop>
+</config>
<AS id="AS0" routing="Vivaldi">
<host id="100030591" coordinates="25.5 9.4 1.4" power="1500000000.0" />
<host id="100036570" coordinates="-12.7 -9.9 2.1" power="730000000.0" />
SURF_WKS_LEVEL = xbt_lib_add_level(host_lib,surf_resource_free);
SURF_LINK_LEVEL = xbt_lib_add_level(link_lib,surf_resource_free);
- XBT_DEBUG("ADD COORD LEVEL");
- 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);
-
/* Connect our log channels: that must be done manually under windows */
XBT_LOG_CONNECT(surf_cpu, surf);
XBT_LOG_CONNECT(surf_kernel, surf);
info->rc_type = SURF_NETWORK_ELEMENT_HOST;
xbt_lib_set(host_lib,host_id,ROUTING_HOST_LEVEL,(void *) info);
if (strcmp(coord,"")) {
+ if(!COORD_HOST_LEVEL) xbt_die("To use coordinates, you must set configuration 'coordinates' to 'yes'");
xbt_dynar_t ctn = xbt_str_split_str(coord, " ");
xbt_dynar_shrink(ctn, 0);
xbt_lib_set(host_lib,host_id,COORD_HOST_LEVEL,(void *) ctn);
xbt_lib_set(as_router_lib,router_id,ROUTING_ASR_LEVEL,(void *) info);
if (strcmp(A_surfxml_router_coordinates,"")) {
- xbt_dynar_t ctn = xbt_str_split_str(A_surfxml_router_coordinates, " ");
- xbt_dynar_shrink(ctn, 0);
- xbt_lib_set(as_router_lib,router_id,COORD_ASR_LEVEL,(void *) ctn);
+ if(!COORD_ASR_LEVEL) xbt_die("To use coordinates, you must set configuration 'coordinates' to 'yes'");
+ xbt_dynar_t ctn = xbt_str_split_str(A_surfxml_router_coordinates, " ");
+ xbt_dynar_shrink(ctn, 0);
+ xbt_lib_set(as_router_lib,router_id,COORD_ASR_LEVEL,(void *) ctn);
}
}
parse_S_AS(A_surfxml_AS_id, A_surfxml_AS_routing);
if (strcmp(A_surfxml_AS_coordinates,"")) {
+ if(!COORD_ASR_LEVEL) xbt_die("To use coordinates, you must set configuration 'coordinates' to 'yes'");
XBT_DEBUG("%s coordinates : %s", A_surfxml_AS_id, A_surfxml_AS_coordinates);
xbt_dynar_t ctn = xbt_str_split_str(A_surfxml_AS_coordinates, " ");
xbt_dynar_shrink(ctn, 0);
char *value = NULL;
if (!current_property_set)
current_property_set = xbt_dict_new(); // Maybe, it should be make a error
- value = xbt_strdup(A_surfxml_prop_value);
- xbt_dict_set(current_property_set, A_surfxml_prop_id, value, free);
+ if(!strcmp(A_surfxml_prop_id,"coordinates")){
+ if(!strcmp(A_surfxml_prop_value,"yes") && !COORD_HOST_LEVEL)
+ {
+ XBT_INFO("Configuration change: Set '%s' to '%s'", A_surfxml_prop_id, A_surfxml_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{
+ value = xbt_strdup(A_surfxml_prop_value);
+ xbt_dict_set(current_property_set, A_surfxml_prop_id, value, free);
+ }
}
/* Trace management functions */
#include "xbt/peer.h"
#include "xbt/config.h" /* prototypes of this module */
+#include "surf/surf.h" /* COORD_HOST_LEVEL and COORD_ASR_LEVEL */
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support");
}
*(val++) = '\0';
+ if (!strcmp(name,"coordinates")){
+ if(!strcmp(val,"yes") && !COORD_HOST_LEVEL){
+ XBT_INFO("Configuration change: Set '%s' to '%s'", name, val);
+ 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);
+ free(optionlist_cpy);
+ return;
+ }
+ if(strcmp(val,"yes"))
+ xbt_die("Setting CMD prop coordinates must be \"yes\"");
+ }
+
if (strcmp(name,"contexts/factory"))
XBT_INFO("Configuration change: Set '%s' to '%s'", name, val);