1 /* Copyright (c) 2007, 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. */
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"
20 XBT_LOG_NEW_DEFAULT_CATEGORY(sd_test,
21 "Logging specific to this SimDag example");
23 int main(int argc, char **argv)
26 const char *platform_file;
27 const SD_workstation_t *workstations;
29 SD_workstation_t w1 = NULL;
30 SD_workstation_t w2 = NULL;
31 const char *name1, *name2;
34 /* initialisation of SD */
37 /* xbt_log_control_set("sd.thres=debug"); */
40 INFO1("Usage: %s platform_file", argv[0]);
41 INFO1("example: %s sd_platform.xml", argv[0]);
45 /* creation of the environment */
46 platform_file = argv[1];
47 SD_create_environment(platform_file);
49 /* test the estimation functions */
50 workstations = SD_workstation_get_list();
51 ws_nr = SD_workstation_get_number();
54 /* Show routes between all workstation */
56 for (i = 0; i < ws_nr; i++) {
57 for (j = 0; j < ws_nr; j++) {
58 const SD_link_t *route;
62 name1 = SD_workstation_get_name(w1);
63 name2 = SD_workstation_get_name(w2);
64 INFO2("Route between %s and %s:", name1, name2);
65 route = SD_route_get_list(w1, w2);
66 route_size = SD_route_get_size(w1, w2);
67 for (k = 0; k < route_size; k++) {
68 INFO3("\tLink %s: latency = %f, bandwidth = %f",
69 SD_link_get_name(route[k]),
70 SD_link_get_current_latency(route[k]),
71 SD_link_get_current_bandwidth(route[k]));