-
- /* creation of the environment */
- char * platform_file = argv[1];
- SD_create_environment(platform_file);
-
- /* test the estimation functions (use small_platform.xml) */
- 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]));
- }
- INFO2("Route latency = %f, route bandwidth = %f", SD_route_get_current_latency(w1, w2),
- SD_route_get_current_bandwidth(w1, w2));
- INFO4("Communication time for %f bytes between %s and %s: %f", communication_amount12, name1, name2,
- SD_route_get_communication_time(w1, w2, communication_amount12));
- INFO4("Communication time for %f bytes between %s and %s: %f", communication_amount21, name2, name1,
- SD_route_get_communication_time(w2, w1, communication_amount21));
- xbt_free(route);
+ XBT_INFO("Route latency = %f, route bandwidth = %f", SD_route_get_latency(h1, h2), SD_route_get_bandwidth(h1, h2));
+ XBT_INFO("Communication time for %f bytes between %s and %s: %f", comm_amount12, name1, name2,
+ SD_route_get_latency(h1, h2) + comm_amount12 / SD_route_get_bandwidth(h1, h2));
+ XBT_INFO("Communication time for %f bytes between %s and %s: %f", comm_amount21, name2, name1,
+ SD_route_get_latency(h2, h1) + comm_amount21 / SD_route_get_bandwidth(h2, h1));