1 /* Copyright (c) 2008-2018. The SimGrid Team.
2 * All rights reserved. */
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. */
7 //for i in $(seq 1 100); do teshsuite/simdag/platforms/evaluate_get_route_time ../examples/platforms/cluster_backbone.xml 1 2> /tmp/null ; done
11 #include "simgrid/simdag.h"
12 #include "xbt/xbt_os_time.h"
14 #define BILLION 1000000000L;
16 int main(int argc, char **argv)
20 xbt_os_timer_t timer = xbt_os_timer_new();
23 SD_create_environment(argv[1]);
25 sg_host_t *hosts = sg_host_list();
26 int host_count = sg_host_count();
28 /* Random number initialization */
29 srand( (int) (xbt_os_time()*1000) );
32 i = rand()%host_count;
33 j = rand()%host_count;
36 sg_host_t h1 = hosts[i];
37 sg_host_t h2 = hosts[j];
38 printf("%d\tand\t%d\t\t",i,j);
39 xbt_dynar_t route = xbt_dynar_new(sizeof(SD_link_t), NULL);
41 xbt_os_cputimer_start(timer);
42 sg_host_route(h1, h2, route);
43 xbt_os_cputimer_stop(timer);
45 xbt_dynar_free(&route);
47 printf("%f\n", xbt_os_timer_elapsed(timer) );