1 /* Copyright (c) 2007-2014. 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 /* See examples/platforms/metaxml.xml and examples/platforms/metaxml_platform.xml
8 for examples on how to use the cluster, foreach, set, route:multi, trace and trace:connect tags
13 #include "simdag/simdag.h"
16 #include "xbt/dynar.h"
19 XBT_LOG_NEW_DEFAULT_CATEGORY(sd_test,
20 "Logging specific to this SimDag example");
22 int main(int argc, char **argv)
25 const char *platform_file;
26 const SD_workstation_t *workstations;
28 SD_workstation_t w1 = NULL;
29 SD_workstation_t w2 = NULL;
30 const char *name1, *name2;
33 /* initialisation of SD */
36 /* xbt_log_control_set("sd.thres=debug"); */
39 XBT_INFO("Usage: %s platform_file", argv[0]);
40 XBT_INFO("example: %s sd_platform.xml", argv[0]);
44 /* creation of the environment */
45 platform_file = argv[1];
46 SD_create_environment(platform_file);
48 /* test the estimation functions */
49 workstations = SD_workstation_get_list();
50 ws_nr = SD_workstation_get_number();
53 /* Show routes between all workstation */
55 for (i = 0; i < ws_nr; i++) {
56 for (j = 0; j < ws_nr; j++) {
57 const SD_link_t *route;
61 name1 = SD_workstation_get_name(w1);
62 name2 = SD_workstation_get_name(w2);
63 XBT_INFO("Route between %s and %s:", name1, name2);
64 route = SD_route_get_list(w1, w2);
65 route_size = SD_route_get_size(w1, w2);
66 for (k = 0; k < route_size; k++) {
67 XBT_INFO("\tLink %s: latency = %f, bandwidth = %f",
68 SD_link_get_name(route[k]),
69 SD_link_get_current_latency(route[k]),
70 SD_link_get_current_bandwidth(route[k]));