X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/974fb38ffe5712b82211fe2fab3a9bb32a4ac7a4..d929149dc5f210fc2599db0407351ba27ad3a2ec:/src/surf/surfxml_parse.c diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index c0c04767d9..98f90f9f73 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -7,6 +7,7 @@ #include #include #include /* va_arg */ +#include #include "xbt/misc.h" #include "xbt/log.h" @@ -420,8 +421,8 @@ void STag_surfxml_prop(void) } else{ if (!current_property_set) - current_property_set = xbt_dict_new_homogeneous(xbt_free_f); // Maybe, it should raise an error - xbt_dict_set(current_property_set, A_surfxml_prop_id, xbt_strdup(A_surfxml_prop_value), NULL); + current_property_set = xbt_dict_new(); // Maybe, it should raise an error + xbt_dict_set(current_property_set, A_surfxml_prop_id, xbt_strdup(A_surfxml_prop_value), xbt_free_f); } } @@ -530,6 +531,9 @@ void ETag_surfxml_cluster(void){ case A_surfxml_cluster_topology_TORUS: cluster.topology= SURF_CLUSTER_TORUS ; break; + case A_surfxml_cluster_topology_FAT___TREE: + cluster.topology = SURF_CLUSTER_FAT_TREE; + break; default: surf_parse_error("Invalid cluster topology for cluster %s", cluster.id); @@ -1022,6 +1026,8 @@ void surf_parse_open(const char *file) if (!surf_parsed_filename_stack) surf_parsed_filename_stack = xbt_dynar_new(sizeof(char *), &xbt_free_ref); surf_parsed_filename = xbt_strdup(file); + char *dir = dirname(surf_parsed_filename); + xbt_dynar_push(surf_path, &dir); surf_file_to_parse = surf_fopen(file, "r"); xbt_assert((surf_file_to_parse), "Unable to open \"%s\"\n", file); @@ -1035,6 +1041,11 @@ void surf_parse_close(void) xbt_dynar_free(&surf_input_buffer_stack); xbt_dynar_free(&surf_file_to_parse_stack); xbt_dynar_free(&surf_parsed_filename_stack); + if (surf_parsed_filename) { + char *dir = NULL; + xbt_dynar_pop(surf_path, dir); + free(dir); + } free(surf_parsed_filename); surf_parsed_filename = NULL;