- const SD_workstation_t *workstations = SD_workstation_get_list();
- SD_workstation_t w1 = workstations[0];
- SD_workstation_t w2 = workstations[1];
- const char *name1 = SD_workstation_get_name(w1);
- const char *name2 = SD_workstation_get_name(w2);
- const double computation_amount1 = 2000000;
- const double computation_amount2 = 1000000;
- const double communication_amount12 = 2000000;
- const double communication_amount21 = 3000000;
- INFO3("Computation time for %f flops on %s: %f", computation_amount1, name1,
- SD_workstation_get_computation_time(w1, computation_amount1));
- INFO3("Computation time for %f flops on %s: %f", computation_amount2, name2,
- SD_workstation_get_computation_time(w2, computation_amount2));
-
- INFO2("Route between %s and %s:", name1, name2);
- SD_link_t *route = SD_route_get_list(w1, w2);
- int route_size = SD_route_get_size(w1, w2);
- for (i = 0; i < route_size; i++) {
- INFO3("\tLink %s: latency = %f, bandwidth = %f", SD_link_get_name(route[i]),
- SD_link_get_current_latency(route[i]), SD_link_get_current_bandwidth(route[i]));
+ const sg_host_t *hosts = sg_host_list();
+ sg_host_t h1 = hosts[0];
+ sg_host_t h2 = hosts[1];
+ const char *name1 = sg_host_get_name(h1);
+ const char *name2 = sg_host_get_name(h2);
+ double comp_amount1 = 2000000;
+ double comp_amount2 = 1000000;
+ double comm_amount12 = 2000000;
+ double comm_amount21 = 3000000;
+ XBT_INFO("Computation time for %f flops on %s: %f", comp_amount1, name1, comp_amount1/sg_host_speed(h1));
+ XBT_INFO("Computation time for %f flops on %s: %f", comp_amount2, name2, comp_amount2/sg_host_speed(h2));
+
+ XBT_INFO("Route between %s and %s:", name1, name2);
+ const SD_link_t *route = SD_route_get_list(h1, h2);
+ int route_size = SD_route_get_size(h1, h2);
+ for (int i = 0; i < route_size; i++) {
+ XBT_INFO(" Link %s: latency = %f, bandwidth = %f", sg_link_name(route[i]), sg_link_latency(route[i]),
+ sg_link_bandwidth(route[i]));