Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'coverity_scan' of github.com:mquinson/simgrid
[simgrid.git] / teshsuite / simdag / platforms / Evaluate_parse_time.c
1 /* Copyright (c) 2008-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 //teshsuite/simdag/platforms/evaluate_parse_time ../examples/platforms/nancy.xml
8
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include "simgrid/simdag.h"
12 #include "surf/surf.h"
13 #include "xbt/xbt_os_time.h"
14
15 int main(int argc, char **argv)
16 {
17   xbt_os_timer_t timer = xbt_os_timer_new();
18   SD_init(&argc, argv);
19
20   /* creation of the environment, timed */
21   xbt_os_cputimer_start(timer);
22   SD_create_environment(argv[1]);
23   xbt_os_cputimer_stop(timer);
24
25   /* Display the result and exit after cleanup */
26   printf( "%f\n", xbt_os_timer_elapsed(timer) );
27   printf("Workstation number: %zu, link number: %d\n", sg_host_count(), sg_link_count());
28   if(argv[2]){
29     printf("Wait for %ss\n",argv[2]);
30     sleep(atoi(argv[2]));
31   }
32
33   SD_exit();
34
35   free(timer);
36   return 0;
37 }