$ $SG_TEST_EXENV masterslave/masterslave_bypass
-> [0.000000] surf/surfxml_parse.c:410: [surf_parse/WARNING] Bypassing the XML parser since surf_parse_open received a NULL pointer. If it is not what you want, go fix your code.
+> [0.000000] surf/surfxml_parse.c:409: [surf_parse/WARNING] Bypassing the XML parser since surf_parse_open received a NULL pointer. If it is not what you want, go fix your code.
> [host A:master:(1) 0.000000] [msg_test/INFO] Got 1 slave(s) :
> [host A:master:(1) 0.000000] [msg_test/INFO] host B
> [host A:master:(1) 0.000000] [msg_test/INFO] Got 20 task to process :
XBT_PUBLIC_DATA(xbt_dict_t) current_property_set; /* the prop set for the currently parsed element (also used in SIMIX) */
void parse_properties(void);
-/* Prototypes for functions handling routing and were factorized succesfully from the models */
-void init_data(void);
-void parse_route_elem(void);
-
/* surf parse file related (public because called from a test suite) */
XBT_PUBLIC(void) parse_platform_file(const char* file);
/* This is used by all models when creating the routing table while parsing */
XBT_PUBLIC_DATA(xbt_dict_t) route_table;
XBT_PUBLIC_DATA(xbt_dict_t) route_multi_table;
-XBT_PUBLIC_DATA(xbt_dict_t) route_table;
XBT_PUBLIC_DATA(xbt_dict_t) route_multi_table;
-XBT_PUBLIC_DATA(xbt_dynar_t) route_link_list;
/* For the trace and trace:connect tag (store their content till the end of the parsing) */
XBT_PUBLIC_DATA(xbt_dict_t) traces_set_list;
src_id = network_card_new(A_surfxml_route_src);
dst_id = network_card_new(A_surfxml_route_dst);
route_action = A_surfxml_route_action;
- route_link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
}
static void parse_route_set_route(void)
}
route_new(src_id, dst_id, link_list, nb_link);
}
-
- xbt_dict_free(&route_table);
-
}
static void count_hosts(void)
surfxml_add_callback(STag_surfxml_link_cb_list, &parse_link_init);
surfxml_add_callback(STag_surfxml_prop_cb_list, &parse_properties);
surfxml_add_callback(STag_surfxml_route_cb_list, &parse_route_set_endpoints);
- surfxml_add_callback(ETag_surfxml_link_c_ctn_cb_list, &parse_route_elem);
surfxml_add_callback(ETag_surfxml_route_cb_list, &parse_route_set_route);
- surfxml_add_callback(STag_surfxml_platform_cb_list, &init_data);
surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces);
surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_route);
surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_loopback);
src_id = network_card_new(A_surfxml_route_src);
dst_id = network_card_new(A_surfxml_route_dst);
route_action = A_surfxml_route_action;
- route_link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
}
static void parse_route_set_route(void)
surfxml_add_callback(STag_surfxml_host_cb_list, &count_hosts);
surfxml_add_callback(STag_surfxml_prop_cb_list, &parse_properties);
surfxml_add_callback(STag_surfxml_route_cb_list, &parse_route_set_endpoints);
- surfxml_add_callback(ETag_surfxml_link_c_ctn_cb_list, &parse_route_elem);
surfxml_add_callback(ETag_surfxml_route_cb_list, &parse_route_set_route);
- surfxml_add_callback(STag_surfxml_platform_cb_list, &init_data);
surfxml_add_callback(STag_surfxml_set_cb_list, &parse_sets);
surfxml_add_callback(STag_surfxml_route_c_multi_cb_list, &parse_route_multi_set_endpoints);
surfxml_add_callback(ETag_surfxml_route_c_multi_cb_list, &parse_route_multi_set_route);
xbt_dict_t route_table = NULL;
xbt_dict_t route_multi_table = NULL;
xbt_dynar_t route_multi_elements = NULL;
-xbt_dynar_t route_link_list = NULL;
+static xbt_dynar_t route_link_list = NULL;
xbt_dynar_t links = NULL;
xbt_dynar_t keys = NULL;
FILE *surf_file_to_parse = NULL;
static void convert_route_multi_to_routes(void);
+static void parse_route_elem(void);
void surf_parse_free_callbacks(void)
{
surfxml_call_cb_functions(ETag_surfxml_platform_cb_list);
- xbt_dynar_free(&route_link_list);
xbt_dict_free(&random_data_list);
xbt_dict_free(&set_list);
-
}
void STag_surfxml_host(void)
}
}
-void init_data(void)
+static void parse_route_set_endpoints(void) {
+ route_link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
+}
+
+static void init_data(void)
{
xbt_dict_free(&route_table);
xbt_dynar_free(&route_link_list);
trace_connect_list_latency = xbt_dict_new();
random_data_list = xbt_dict_new();
+ surfxml_add_callback(ETag_surfxml_link_c_ctn_cb_list, &parse_route_elem);
+ surfxml_add_callback(STag_surfxml_route_cb_list, &parse_route_set_endpoints);
+}
+
+static void free_data(void)
+{
+ char *key,*data;
+ xbt_dict_cursor_t cursor = NULL;
+
+ xbt_dict_foreach(route_table, cursor, key, data) {
+ xbt_dynar_t links = (xbt_dynar_t)data;
+ xbt_dynar_free(&links);
+ }
+ xbt_dict_free(&route_table);
+ route_link_list = NULL;
}
void parse_platform_file(const char* file)
{
surf_parse_open(file);
+ init_data();
xbt_assert1((!(*surf_parse)()), "Parse error in %s", file);
+ free_data();
surf_parse_close();
}
static char* src_name, *dst_name;
static int is_symmetric_route;
-void parse_route_elem(void)
+static void parse_route_elem(void)
{
char *val;
dst_id = cpu_tmp->id;
route_action = A_surfxml_route_action;
-
- route_link_list = xbt_dynar_new(sizeof(char*), &xbt_free_ref);
}
static void parse_route_set_route(void)
}
route_new(src_id, dst_id, link_list, nb_link);
}
-
- xbt_dict_free(&route_table);
}
static void add_traces(void) {
surfxml_add_callback(STag_surfxml_prop_cb_list, &parse_properties);
surfxml_add_callback(STag_surfxml_link_cb_list, &parse_link_init);
surfxml_add_callback(STag_surfxml_route_cb_list, &parse_route_set_endpoints);
- surfxml_add_callback(ETag_surfxml_link_c_ctn_cb_list, &parse_route_elem);
surfxml_add_callback(ETag_surfxml_route_cb_list, &parse_route_set_route);
- surfxml_add_callback(STag_surfxml_platform_cb_list, &init_data);
surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_route);
surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_loopback);
surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces);