+ ASroute.gw_src = sg_routing_edge_by_name_or_null(A_surfxml_bypassASroute_gw___src);
+ ASroute.gw_dst = sg_routing_edge_by_name_or_null(A_surfxml_bypassASroute_gw___dst);
+
+ sg_platf_new_bypassASroute(&ASroute);
+ parsed_link_list = NULL;
+}
+
+void ETag_surfxml_trace(void){
+ s_sg_platf_trace_cbarg_t trace;
+ memset(&trace,0,sizeof(trace));
+
+ trace.id = A_surfxml_trace_id;
+ trace.file = A_surfxml_trace_file;
+ trace.periodicity = surf_parse_get_double(A_surfxml_trace_periodicity);
+ trace.pc_data = surfxml_pcdata;
+
+ sg_platf_new_trace(&trace);
+}
+
+void STag_surfxml_trace___connect(void){
+ s_sg_platf_trace_connect_cbarg_t trace_connect;
+ memset(&trace_connect,0,sizeof(trace_connect));
+
+ trace_connect.element = A_surfxml_trace___connect_element;
+ trace_connect.trace = A_surfxml_trace___connect_trace;
+
+ switch (A_surfxml_trace___connect_kind) {
+ case AU_surfxml_trace___connect_kind:
+ case A_surfxml_trace___connect_kind_POWER:
+ trace_connect.kind = SURF_TRACE_CONNECT_KIND_POWER;
+ break;
+ case A_surfxml_trace___connect_kind_BANDWIDTH:
+ trace_connect.kind = SURF_TRACE_CONNECT_KIND_BANDWIDTH;
+ break;
+ case A_surfxml_trace___connect_kind_HOST___AVAIL:
+ trace_connect.kind = SURF_TRACE_CONNECT_KIND_HOST_AVAIL;
+ break;
+ case A_surfxml_trace___connect_kind_LATENCY:
+ trace_connect.kind = SURF_TRACE_CONNECT_KIND_LATENCY;
+ break;
+ case A_surfxml_trace___connect_kind_LINK___AVAIL:
+ trace_connect.kind = SURF_TRACE_CONNECT_KIND_LINK_AVAIL;
+ break;
+ }
+ sg_platf_trace_connect(&trace_connect);
+}
+
+void STag_surfxml_AS(void){
+ AS_TAG = 1;
+ s_sg_platf_AS_cbarg_t AS = SG_PLATF_AS_INITIALIZER;
+ AS.id = A_surfxml_AS_id;
+ AS.routing = (int)A_surfxml_AS_routing;
+
+ as_current_property_set = NULL;
+
+ sg_platf_new_AS_begin(&AS);
+}
+void ETag_surfxml_AS(void){
+ if(as_prop_nb){
+ char *name = as_name_tab[as_prop_nb-1];
+ xbt_dict_t dict = as_dict_tab[as_prop_nb-1];
+ as_prop_nb--;
+ XBT_DEBUG("POP prop %p for AS '%s'",dict,name);
+ xbt_lib_set(as_router_lib,
+ name,
+ ROUTING_PROP_ASR_LEVEL,
+ dict);
+ xbt_free(name);
+ }
+ sg_platf_new_AS_end();
+}
+
+void STag_surfxml_config(void){
+ AS_TAG = 0;
+ xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
+ XBT_DEBUG("START configuration name = %s",A_surfxml_config_id);
+ if (_sg_cfg_init_status == 2) {
+ surf_parse_error("All <config> tags must be given before any platform elements (such as <AS>, <host>, <cluster>, <link>, etc).");
+ }
+}
+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(_sg_cfg_set, key))
+ xbt_cfg_set_parse(_sg_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);
+ xbt_dict_free(¤t_property_set);
+ current_property_set = NULL;
+}
+
+static int argc;
+static char **argv;
+
+void STag_surfxml_process(void){
+ AS_TAG = 0;
+ argc = 1;
+ argv = xbt_new(char *, 1);
+ argv[0] = xbt_strdup(A_surfxml_process_function);
+ xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
+}
+
+void ETag_surfxml_process(void){
+ s_sg_platf_process_cbarg_t process;
+ memset(&process,0,sizeof(process));
+
+ process.argc = argc;
+ process.argv = (const char **)argv;
+ process.properties = current_property_set;
+ process.host = A_surfxml_process_host;
+ process.function = A_surfxml_process_function;
+ process.start_time = surf_parse_get_double(A_surfxml_process_start___time);
+ process.kill_time = surf_parse_get_double(A_surfxml_process_kill___time);
+
+ switch (A_surfxml_process_on___failure) {
+ case AU_surfxml_process_on___failure:
+ case A_surfxml_process_on___failure_DIE:
+ process.on_failure = SURF_PROCESS_ON_FAILURE_DIE;
+ break;
+ case A_surfxml_process_on___failure_RESTART:
+ process.on_failure = SURF_PROCESS_ON_FAILURE_RESTART;
+ break;
+ }
+
+ sg_platf_new_process(&process);
+ current_property_set = NULL;
+}
+
+void STag_surfxml_argument(void){
+ argc++;
+ argv = xbt_realloc(argv, (argc) * sizeof(char *));
+ argv[(argc) - 1] = xbt_strdup(A_surfxml_argument_value);
+}
+
+/* ***************************************** */
+/* TUTORIAL: New TAG */
+void STag_surfxml_gpu(void)