X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0f5509273af174fc845f00268eb6430cf22d8ee0..56c92988c6bf8a4e5c1df4a5af4388310f879353:/src/surf/surfxml_parse.c diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 6dfa95ef63..1dcddf9fc2 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -23,55 +23,56 @@ void nil_function(void) return; } -void_f_void_t STag_platform_description_fun = nil_function; -void_f_void_t ETag_platform_description_fun = nil_function; -void_f_void_t STag_cpu_fun = nil_function; -void_f_void_t ETag_cpu_fun = nil_function; -void_f_void_t STag_network_link_fun = nil_function; -void_f_void_t ETag_network_link_fun = nil_function; -void_f_void_t STag_route_fun = nil_function; -void_f_void_t ETag_route_fun = nil_function; -void_f_void_t STag_route_element_fun = nil_function; -void_f_void_t ETag_route_element_fun = nil_function; -void_f_void_t STag_process_fun = nil_function; -void_f_void_t ETag_process_fun = nil_function; -void_f_void_t STag_argument_fun = nil_function; -void_f_void_t ETag_argument_fun = nil_function; +void_f_void_t STag_surfxml_platform_description_fun = nil_function; +void_f_void_t ETag_surfxml_platform_description_fun = nil_function; +void_f_void_t STag_surfxml_cpu_fun = nil_function; +void_f_void_t ETag_surfxml_cpu_fun = nil_function; +void_f_void_t STag_surfxml_network_link_fun = nil_function; +void_f_void_t ETag_surfxml_network_link_fun = nil_function; +void_f_void_t STag_surfxml_route_fun = nil_function; +void_f_void_t ETag_surfxml_route_fun = nil_function; +void_f_void_t STag_surfxml_route_element_fun = nil_function; +void_f_void_t ETag_surfxml_route_element_fun = nil_function; +void_f_void_t STag_surfxml_process_fun = nil_function; +void_f_void_t ETag_surfxml_process_fun = nil_function; +void_f_void_t STag_surfxml_argument_fun = nil_function; +void_f_void_t ETag_surfxml_argument_fun = nil_function; YY_BUFFER_STATE surf_input_buffer; FILE *surf_file_to_parse; void surf_parse_reset_parser(void) { - STag_platform_description_fun = nil_function; - ETag_platform_description_fun = nil_function; - STag_cpu_fun = nil_function; - ETag_cpu_fun = nil_function; - STag_network_link_fun = nil_function; - ETag_network_link_fun = nil_function; - STag_route_fun = nil_function; - ETag_route_fun = nil_function; - STag_route_element_fun = nil_function; - ETag_route_element_fun = nil_function; - STag_process_fun = nil_function; - ETag_process_fun = nil_function; - STag_argument_fun = nil_function; - ETag_argument_fun = nil_function; + STag_surfxml_platform_description_fun = nil_function; + ETag_surfxml_platform_description_fun = nil_function; + STag_surfxml_cpu_fun = nil_function; + ETag_surfxml_cpu_fun = nil_function; + STag_surfxml_network_link_fun = nil_function; + ETag_surfxml_network_link_fun = nil_function; + STag_surfxml_route_fun = nil_function; + ETag_surfxml_route_fun = nil_function; + STag_surfxml_route_element_fun = nil_function; + ETag_surfxml_route_element_fun = nil_function; + STag_surfxml_process_fun = nil_function; + ETag_surfxml_process_fun = nil_function; + STag_surfxml_argument_fun = nil_function; + ETag_surfxml_argument_fun = nil_function; } -void STag_include(void) +void STag_surfxml_include(void) { xbt_dynar_push(surf_input_buffer_stack,&surf_input_buffer); xbt_dynar_push(surf_file_to_parse_stack,&surf_file_to_parse); - surf_file_to_parse = surf_fopen(A_include_file,"r"); - xbt_assert1((surf_file_to_parse), "Unable to open \"%s\"\n",A_include_file); + surf_file_to_parse = surf_fopen(A_surfxml_include_file,"r"); + xbt_assert1((surf_file_to_parse), "Unable to open \"%s\"\n", + A_surfxml_include_file); surf_input_buffer = surf_parse__create_buffer( surf_file_to_parse, 10); surf_parse__switch_to_buffer(surf_input_buffer); printf("STAG\n"); fflush(NULL); } -void ETag_include(void) +void ETag_surfxml_include(void) { printf("ETAG\n"); fflush(NULL); surf_parse__delete_buffer(surf_input_buffer); @@ -80,74 +81,90 @@ void ETag_include(void) xbt_dynar_pop(surf_input_buffer_stack,&surf_input_buffer); } -void STag_platform_description(void) +void STag_surfxml_platform_description(void) { - STag_platform_description_fun(); + double version=0.0; + + sscanf(A_surfxml_platform_description_version,"%lg",&version); + + xbt_assert0((version>=1.0),"******* BIG FAT WARNING *********\n " + "You're using an old XML file. " + "Since SimGrid 3.0.2, 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.0.2 version. " + "Last, do not forget to also update your values for " + "the calls to MSG_task_create if any."); + + STag_surfxml_platform_description_fun(); } -void ETag_platform_description(void) +void ETag_surfxml_platform_description(void) { - ETag_platform_description_fun(); + ETag_surfxml_platform_description_fun(); } -void STag_cpu(void) +void STag_surfxml_cpu(void) { - STag_cpu_fun(); + STag_surfxml_cpu_fun(); } -void ETag_cpu(void) +void ETag_surfxml_cpu(void) { - ETag_cpu_fun(); + ETag_surfxml_cpu_fun(); } -void STag_network_link(void) +void STag_surfxml_network_link(void) { - STag_network_link_fun(); + STag_surfxml_network_link_fun(); } -void ETag_network_link(void) +void ETag_surfxml_network_link(void) { - ETag_network_link_fun(); + ETag_surfxml_network_link_fun(); } -void STag_route(void) +void STag_surfxml_route(void) { - STag_route_fun(); + STag_surfxml_route_fun(); } -void ETag_route(void) +void ETag_surfxml_route(void) { - ETag_route_fun(); + ETag_surfxml_route_fun(); } -void STag_route_element(void) +void STag_surfxml_route_element(void) { - STag_route_element_fun(); + STag_surfxml_route_element_fun(); } -void ETag_route_element(void) +void ETag_surfxml_route_element(void) { - ETag_route_element_fun(); + ETag_surfxml_route_element_fun(); } -void STag_process(void) +void STag_surfxml_process(void) { - STag_process_fun(); + STag_surfxml_process_fun(); } -void ETag_process(void) +void ETag_surfxml_process(void) { - ETag_process_fun(); + ETag_surfxml_process_fun(); } -void STag_argument(void) +void STag_surfxml_argument(void) { - STag_argument_fun(); + STag_surfxml_argument_fun(); } -void ETag_argument(void) +void ETag_surfxml_argument(void) { - ETag_argument_fun(); + ETag_surfxml_argument_fun(); } void surf_parse_open(const char *file) {