1 /* Copyright (c) 2008, 2009, 2010. 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. */
9 #include "simdag/simdag.h"
11 int main(int argc, char **argv)
13 /* initialisation of SD */
15 SD_workstation_t w1, w2;
16 const SD_workstation_t *workstations;
17 const SD_link_t *route;
24 /* creation of the environment */
25 SD_create_environment(argv[1]);
27 printf("\n\nWorkstation number: %d, link number: %d\n\n",
28 SD_workstation_get_number(), SD_link_get_number());
30 workstations = SD_workstation_get_list();
33 name1 = SD_workstation_get_name(w1);
34 name2 = SD_workstation_get_name(w2);
36 printf("Route between %s and %s\n", name1, name2);
37 route = SD_route_get_list(w1, w2);
38 route_size = SD_route_get_size(w1, w2);
39 for (i = 0; i < route_size; i++) {
40 printf(" Link %s: latency = %f, bandwidth = %f\n",
41 SD_link_get_name(route[i]), SD_link_get_current_latency(route[i]),
42 SD_link_get_current_bandwidth(route[i]));
44 printf("Route latency = %f, route bandwidth = %fn",
45 SD_route_get_current_latency(w1, w2),
46 SD_route_get_current_bandwidth(w1, w2));