+ /* test the estimation functions */
+ workstations = sg_host_list();
+ w1 = workstations[0];
+ w2 = workstations[1];
+ name1 = sg_host_get_name(w1);
+ name2 = sg_host_get_name(w2);
+ computation_amount1 = 2000000;
+ computation_amount2 = 1000000;
+ communication_amount12 = 2000000;
+ communication_amount21 = 3000000;
+ XBT_INFO("Computation time for %f flops on %s: %f", computation_amount1,
+ name1, computation_amount1/sg_host_speed(w1));
+ XBT_INFO("Computation time for %f flops on %s: %f", computation_amount2,
+ name2, computation_amount2/sg_host_speed(w2));
+
+ XBT_INFO("Route between %s and %s:", name1, name2);
+ route = SD_route_get_list(w1, w2);
+ route_size = SD_route_get_size(w1, w2);
+ for (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]));
+ }
+ XBT_INFO("Route latency = %f, route bandwidth = %f",
+ SD_route_get_latency(w1, w2),
+ SD_route_get_bandwidth(w1, w2));
+ XBT_INFO("Communication time for %f bytes between %s and %s: %f",
+ communication_amount12, name1, name2,
+ SD_route_get_latency(w1, w2) +
+ communication_amount12 / SD_route_get_bandwidth(w1, w2));
+ XBT_INFO("Communication time for %f bytes between %s and %s: %f",
+ communication_amount21, name2, name1,
+ SD_route_get_latency(w2, w1) +
+ communication_amount21 / SD_route_get_bandwidth(w2, w1));
+