xbt_dynar_t ETag_surfxml_ASroute_cb_list = NULL;
xbt_dynar_t STag_surfxml_bypassRoute_cb_list = NULL;
xbt_dynar_t ETag_surfxml_bypassRoute_cb_list = NULL;
-xbt_dynar_t STag_surfxml_config_cb_list = NULL;
-xbt_dynar_t ETag_surfxml_config_cb_list = NULL;
xbt_dynar_t STag_surfxml_include_cb_list = NULL;
xbt_dynar_t ETag_surfxml_include_cb_list = NULL;
xbt_dynar_new(sizeof(void_f_void_t), NULL);
ETag_surfxml_peer_cb_list =
xbt_dynar_new(sizeof(void_f_void_t), NULL);
- STag_surfxml_config_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_config_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
STag_surfxml_include_cb_list =
xbt_dynar_new(sizeof(void_f_void_t), NULL);
ETag_surfxml_include_cb_list =
xbt_dynar_free(&ETag_surfxml_cluster_cb_list);
xbt_dynar_free(&STag_surfxml_peer_cb_list);
xbt_dynar_free(&ETag_surfxml_peer_cb_list);
- xbt_dynar_free(&STag_surfxml_config_cb_list);
- xbt_dynar_free(&ETag_surfxml_config_cb_list);
xbt_dynar_free(&STag_surfxml_include_cb_list);
xbt_dynar_free(&ETag_surfxml_include_cb_list);
}
}
void STag_surfxml_cluster(void){
- surf_parse_models_setup(); /* ensure that the models are created after the last <config> tag. See comment in simgrid.dtd */
-
struct_cluster = xbt_new0(s_surf_parsing_cluster_arg_t, 1);
struct_cluster->V_cluster_id = xbt_strdup(A_surfxml_cluster_id);
struct_cluster->V_cluster_prefix = xbt_strdup(A_surfxml_cluster_prefix);
}
void STag_surfxml_peer(void){
- surf_parse_models_setup(); /* ensure that the models are created after the last <config> tag. See comment in simgrid.dtd */
-
struct_peer = xbt_new0(s_surf_parsing_peer_arg_t, 1);
struct_peer->V_peer_id = xbt_strdup(A_surfxml_peer_id);
struct_peer->V_peer_power = xbt_strdup(A_surfxml_peer_power);
surfxml_call_cb_functions(STag_surfxml_trace_connect_cb_list);
}
void STag_surfxml_AS(void){
- surf_parse_models_setup(); /* ensure that the models are created after the last <config> tag. See comment in simgrid.dtd */
-
surfxml_call_cb_functions(STag_surfxml_AS_cb_list);
}
void STag_surfxml_ASroute(void){
surfxml_call_cb_functions(STag_surfxml_bypassRoute_cb_list);
}
void STag_surfxml_config(void){
- surfxml_call_cb_functions(STag_surfxml_config_cb_list);
+ XBT_DEBUG("START configuration name = %s",A_surfxml_config_id);
+ xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
+ current_property_set = xbt_dict_new();
+
+}
+void ETag_surfxml_config(void){
+ xbt_dict_cursor_t cursor = NULL;
+ char *key;
+ char *elem;
+ char *cfg;
+ xbt_dict_foreach(current_property_set, cursor, key, elem) {
+ cfg = bprintf("%s:%s",key,elem);
+ if(xbt_cfg_is_default_value(_surf_cfg_set, key))
+ xbt_cfg_set_parse(_surf_cfg_set, cfg);
+ else
+ XBT_INFO("The custom configuration '%s' is already defined by user!",key);
+ free(cfg);
+ }
+ XBT_DEBUG("End configuration name = %s",A_surfxml_config_id);
+ current_property_set = NULL;
}
void STag_surfxml_random(void){
surfxml_call_cb_functions(STag_surfxml_random_cb_list);
parse_method(E, AS);
parse_method(E, ASroute);
parse_method(E, bypassRoute);
-parse_method(E, config);
/* Open and Close parse file */
properties);
}
-/**
- *
- *init new routing model component
- */
-
-void surf_AS_new(const char *AS_id, const char *AS_mode)
-{
- routing_AS_init(AS_id, AS_mode);
-}
-
-void surf_AS_finalize(const char *AS_id)
-{
- routing_AS_end(AS_id);
-}
-
/*
* add host to the network element list
*/