A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Properly integrate the link creation into sg_platf
[simgrid.git]
/
src
/
surf
/
surfxml_parseplatf.c
diff --git
a/src/surf/surfxml_parseplatf.c
b/src/surf/surfxml_parseplatf.c
index
d37459a
..
4445475
100644
(file)
--- a/
src/surf/surfxml_parseplatf.c
+++ b/
src/surf/surfxml_parseplatf.c
@@
-8,6
+8,7
@@
#include "xbt/log.h"
#include "xbt/str.h"
#include "xbt/dict.h"
#include "xbt/log.h"
#include "xbt/str.h"
#include "xbt/dict.h"
+#include "simgrid/platf.h"
#include "surf/surfxml_parse_private.h"
#include "surf/surf_private.h"
#include "surf/surfxml_parse_private.h"
#include "surf/surf_private.h"
@@
-52,11
+53,8
@@
void surfxml_bufferstack_pop(int new)
* Pass arguments to parsing callback as structures to save some time (and allow callbacks to ignore some)
*/
* Pass arguments to parsing callback as structures to save some time (and allow callbacks to ignore some)
*/
-surf_parsing_router_arg_t struct_router = NULL;
surf_parsing_cluster_arg_t struct_cluster = NULL;
surf_parsing_peer_arg_t struct_peer = NULL;
surf_parsing_cluster_arg_t struct_cluster = NULL;
surf_parsing_peer_arg_t struct_peer = NULL;
-surf_parsing_link_arg_t struct_lnk = NULL;
-
/*
* Trace related stuff
/*
* Trace related stuff
@@
-75,10
+73,9
@@
static char *trace_id = NULL;
static void parse_Stag_trace(void)
{
static void parse_Stag_trace(void)
{
- surf_parse_models_setup(); /* ensure that the models are created after the last <config> tag. See comment in simgrid.dtd */
trace_id = xbt_strdup(A_surfxml_trace_id);
trace_file = xbt_strdup(A_surfxml_trace_file);
trace_id = xbt_strdup(A_surfxml_trace_id);
trace_file = xbt_strdup(A_surfxml_trace_file);
-
surf_parse_get_double(&trace_periodicity,
A_surfxml_trace_periodicity);
+
trace_periodicity = surf_parse_get_double(
A_surfxml_trace_periodicity);
}
static void parse_Etag_trace(void)
}
static void parse_Etag_trace(void)
@@
-103,8
+100,6
@@
static void parse_Etag_trace(void)
static void parse_Stag_trace_connect(void)
{
static void parse_Stag_trace_connect(void)
{
- surf_parse_models_setup(); /* ensure that the models are created after the last <config> tag. See comment in simgrid.dtd */
-
xbt_assert(xbt_dict_get_or_null
(traces_set_list, A_surfxml_trace_connect_trace),
"Cannot connect trace %s to %s: trace unknown",
xbt_assert(xbt_dict_get_or_null
(traces_set_list, A_surfxml_trace_connect_trace),
"Cannot connect trace %s to %s: trace unknown",
@@
-142,6
+137,13
@@
static void parse_Stag_trace_connect(void)
}
}
}
}
+/* Call the right C function when we see the <AS> tags */
+static void parse_S_AS(void) {
+ sg_platf_new_AS_open(A_surfxml_AS_id, A_surfxml_AS_routing);
+}
+static void parse_E_AS(void) {
+ sg_platf_new_AS_close();
+}
/* Init and free parse data */
/* Init and free parse data */
@@
-161,6
+163,10
@@
static void init_data(void)
surfxml_add_callback(ETag_surfxml_trace_cb_list, &parse_Etag_trace);
surfxml_add_callback(STag_surfxml_trace_connect_cb_list,
&parse_Stag_trace_connect);
surfxml_add_callback(ETag_surfxml_trace_cb_list, &parse_Etag_trace);
surfxml_add_callback(STag_surfxml_trace_connect_cb_list,
&parse_Stag_trace_connect);
+
+ /* we care about the ASes while parsing the platf. Incredible, isnt it? */
+ surfxml_add_callback(STag_surfxml_AS_cb_list, &parse_S_AS);
+ surfxml_add_callback(ETag_surfxml_AS_cb_list, &parse_E_AS);
}
static void free_data(void)
}
static void free_data(void)
@@
-181,6
+187,9
@@
void parse_platform_file(const char *file)
int parse_status;
surf_parse_reset_callbacks();
int parse_status;
surf_parse_reset_callbacks();
+
+ /* Register classical callbacks */
+ surfxml_add_callback(STag_surfxml_prop_cb_list, &parse_properties_XML);
surf_parse_add_callback_config();
surfxml_buffer_stack_stack_ptr = 1;
surf_parse_add_callback_config();
surfxml_buffer_stack_stack_ptr = 1;