Logo AND Algorithmique Numérique Distribuée

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