Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2022.
[simgrid.git] / teshsuite / s4u / evaluate-parse-time / evaluate-parse-time.cpp
1 /* Copyright (c) 2008-2022. 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/s4u/evaluate-parse-time/evaluate-parse-time examples/platforms/g5k.xml
7
8 #include <cstdio>
9
10 #include "simgrid/s4u/Engine.hpp"
11 #include "xbt/xbt_os_time.h"
12
13 int main(int argc, char** argv)
14 {
15   xbt_os_timer_t timer = xbt_os_timer_new();
16   simgrid::s4u::Engine e(&argc, argv);
17
18   /* creation of the environment, timed */
19   xbt_os_cputimer_start(timer);
20   e.load_platform(argv[1]);
21   xbt_os_cputimer_stop(timer);
22
23   /* Display the result and exit after cleanup */
24   printf("%f\n", xbt_os_timer_elapsed(timer));
25   printf("Host number: %zu, link number: %zu\n", e.get_host_count(), e.get_link_count());
26   if (argv[2]) {
27     printf("Wait for %ss\n", argv[2]);
28     xbt_os_sleep(atoi(argv[2]));
29   }
30
31   xbt_os_timer_free(timer);
32   return 0;
33 }