X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b9fd1cbede3f5153e7d2c59514e33c8b802c4c3..8c9500c7f0d7dd6880a72b3640866b0353b58b19:/teshsuite/simdag/platforms/flatifier.c diff --git a/teshsuite/simdag/platforms/flatifier.c b/teshsuite/simdag/platforms/flatifier.c index 729d27bd6f..46ae1b4dfc 100644 --- a/teshsuite/simdag/platforms/flatifier.c +++ b/teshsuite/simdag/platforms/flatifier.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009, 2010. The SimGrid Team. +/* Copyright (c) 2008-2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -70,6 +70,19 @@ static int parse_cmdline(int *timings, int *downgrade, char **platformFile, int return wrong_option; } +static void create_environment(xbt_os_timer_t parse_time, const char *platformFile) +{ + xbt_ex_t e; + TRY { + xbt_os_cputimer_start(parse_time); + SD_create_environment(platformFile); + xbt_os_cputimer_stop(parse_time); + } + CATCH(e) { + xbt_die("Error while loading %s: %s", platformFile, e.msg); + } +} + int main(int argc, char **argv) { char *platformFile = NULL; @@ -86,13 +99,17 @@ int main(int argc, char **argv) char *src,*dst,*key,*data; sg_routing_edge_t value1; sg_routing_edge_t value2; - xbt_ex_t e; const SD_workstation_t *hosts; const SD_link_t *links; xbt_os_timer_t parse_time = xbt_os_timer_new(); +#ifdef _XBT_WIN32 + setbuf(stderr, NULL); + setbuf(stdout, NULL); +#else setvbuf(stdout, NULL, _IOLBF, 0); +#endif SD_init(&argc, argv); @@ -107,14 +124,7 @@ int main(int argc, char **argv) link_ctn = link_ctn_v2; } - TRY { - xbt_os_timer_start(parse_time); - SD_create_environment(platformFile); - xbt_os_timer_stop(parse_time); - } - CATCH(e) { - xbt_die("Error while loading %s: %s",platformFile,e.msg); - } + create_environment(parse_time, platformFile); if (timings) { XBT_INFO("Parsing time: %fs (%d hosts, %d links)", @@ -270,6 +280,7 @@ int main(int argc, char **argv) printf("\n"); } SD_exit(); + xbt_os_timer_free(parse_time); return 0; }