X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0f5e8daaa6e9f74521068aa75837200bcd182ea6..02ae829468d448fedc59be33dfd8b6d829b77ad6:/src/surf/surfxml_parse.c diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index bf528308dd..d9280a4830 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -76,6 +76,8 @@ xbt_dynar_t STag_surfxml_prop_cb_list = NULL; xbt_dynar_t ETag_surfxml_prop_cb_list = NULL; xbt_dynar_t STag_surfxml_cluster_cb_list = NULL; xbt_dynar_t ETag_surfxml_cluster_cb_list = NULL; +xbt_dynar_t STag_surfxml_peer_cb_list = NULL; +xbt_dynar_t ETag_surfxml_peer_cb_list = NULL; xbt_dynar_t STag_surfxml_trace_cb_list = NULL; xbt_dynar_t ETag_surfxml_trace_cb_list = NULL; xbt_dynar_t STag_surfxml_trace_connect_cb_list = NULL; @@ -144,6 +146,8 @@ void surf_parse_free_callbacks(void) xbt_dynar_free(&ETag_surfxml_bypassRoute_cb_list); xbt_dynar_free(&STag_surfxml_cluster_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); } @@ -199,6 +203,10 @@ void surf_parse_reset_parser(void) xbt_dynar_new(sizeof(void_f_void_t), NULL); ETag_surfxml_cluster_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL); + STag_surfxml_peer_cb_list = + 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); } @@ -212,22 +220,24 @@ void STag_surfxml_platform(void) sscanf(A_surfxml_platform_version, "%lg", &version); xbt_assert0((version >= 1.0), "******* BIG FAT WARNING *********\n " - "You're using an ancient XML file. " - "Since SimGrid 3.1, units are Bytes, Flops, and seconds " - "instead of MBytes, MFlops and seconds. " - "A script (surfxml_update.pl) to help you convert your old " - "platform files " - "is available in the contrib/platform_generation directory " - "of the simgrid repository. Please check also out the " - "SURF section of the ChangeLog for the 3.1 version. " - "Last, do not forget to also update your values for " - "the calls to MSG_task_create (if any)."); - xbt_assert0((version >= 2.0), "******* BIG FAT WARNING *********\n " - "You're using an old XML file. " - "A script (surfxml_update.pl) to help you convert your old " - "platform files " - "is available in the contrib/platform_generation directory " - "of the simgrid repository."); + "You're using an ancient XML file.\n" + "Since SimGrid 3.1, units are Bytes, Flops, and seconds " + "instead of MBytes, MFlops and seconds.\n" + + "Use simgrid_update_xml to update your file automatically. " + "This program is installed automatically with SimGrid, or " + "available in the tools/ directory of the source archive.\n" + + "Please check also out the SURF section of the ChangeLog for " + "the 3.1 version for more information. \n" + + "Last, do not forget to also update your values for " + "the calls to MSG_task_create (if any)."); + xbt_assert0((version >= 3.0), "******* BIG FAT WARNING *********\n " + "You're using an old XML file.\n" + "Use simgrid_update_xml to update your file automatically. " + "This program is installed automatically with SimGrid, or " + "available in the tools/ directory of the source archive."); surfxml_call_cb_functions(STag_surfxml_platform_cb_list); @@ -268,6 +278,8 @@ parse_method(S, bypassRoute); parse_method(E, bypassRoute); parse_method(S, cluster); parse_method(E, cluster); +parse_method(S, peer); +parse_method(E, peer); parse_method(S, config); parse_method(E, config); @@ -296,6 +308,7 @@ void surf_parse_close(void) if (surf_file_to_parse) { surf_parse__delete_buffer(surf_input_buffer); fclose(surf_file_to_parse); + surf_file_to_parse = NULL; //Must be reset for Bypass } } @@ -427,12 +440,12 @@ void parse_properties(void) static double trace_periodicity = -1.0; static char *trace_file = NULL; -static char *trace_id; +static char *trace_id = NULL; static void parse_Stag_trace(void) { - trace_id = strdup(A_surfxml_trace_id); - trace_file = 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); } @@ -450,6 +463,10 @@ static void parse_Etag_trace(void) trace_periodicity); } xbt_dict_set(traces_set_list, trace_id, (void *) trace, NULL); + xbt_free(trace_file); + trace_file = NULL; + xbt_free(trace_id); + trace_id = NULL; } static void parse_Stag_trace_connect(void) @@ -547,7 +564,7 @@ static void add_randomness(void) */ void surf_host_create_resource(char *name, double power_peak, double power_scale, - tmgr_trace_t power_trace, + tmgr_trace_t power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace, xbt_dict_t cpu_properties) @@ -555,6 +572,7 @@ void surf_host_create_resource(char *name, double power_peak, return surf_cpu_model->extension.cpu.create_resource(name, power_peak, power_scale, power_trace, + core, state_initial, state_trace, cpu_properties);