grand_parent_workstation_list =
SD_task_get_workstation_list(grand_parent);
/* Estimate the redistribution time from this parent */
- redist_time =
- SD_route_get_communication_time(grand_parent_workstation_list
- [0], workstation,
- SD_task_get_amount(parent));
+ if (SD_task_get_amount(parent) == 0){
+ redist_time= 0;
+ } else {
+ redist_time =
+ SD_route_get_latency(grand_parent_workstation_list[0],
+ workstation) +
+ SD_task_get_amount(parent) /
+ SD_route_get_bandwidth(grand_parent_workstation_list[0],
+ workstation);
+ }
data_available =
SD_task_get_finish_time(grand_parent) + redist_time;
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_communication_time(w1, w2, communication_amount12));
+ 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_communication_time(w2, w1, communication_amount21));
+ SD_route_get_latency(w2, w1) +
+ communication_amount21 / SD_route_get_bandwidth(w2, w1));
/* creation of the tasks and their dependencies */
taskA = SD_task_create("Task A", NULL, 10.0);
XBT_PUBLIC(double) SD_route_get_latency(sg_host_t src, sg_host_t dst);
XBT_PUBLIC(double) SD_route_get_bandwidth(sg_host_t src, sg_host_t dst);
-XBT_PUBLIC(double) SD_route_get_communication_time(sg_host_t src,
- sg_host_t dst,
- double bytes_amount);
XBT_PUBLIC(const char*) SD_storage_get_host(SD_storage_t storage);
/** @} */
if (bytes_amount != NULL)
for (j = 0; j < workstation_nb; j++) {
- time +=
- SD_route_get_communication_time(workstation_list[i],
- workstation_list[j],
- bytes_amount[i *
- workstation_nb
- + j]);
+ if (bytes_amount[i * workstation_nb + j] !=0 ) {
+ time += (SD_route_get_latency(workstation_list[i],
+ workstation_list[j]) +
+ bytes_amount[i * workstation_nb + j] /
+ SD_route_get_bandwidth(workstation_list[i],
+ workstation_list[j]));
+ }
}
if (time > max_time) {
return min_bandwidth;
}
-/**
- * \brief Returns an approximative estimated time for the given
- * communication amount between two hosts
- *
- * \param src the first host
- * \param dst the second host
- * \param bytes_amount the communication amount you want to evaluate (in bytes)
- * \return an approximative estimated communication time for the given bytes amount
- * between the workstations (in seconds)
- */
-double SD_route_get_communication_time(sg_host_t src,sg_host_t dst,
- double bytes_amount)
-{
- /* total time = latency + transmission time of the slowest link
- transmission time of a link = communication amount / link bandwidth */
-
- xbt_assert(bytes_amount >= 0, "bytes_amount must be greater than or equal to zero");
-
-
- if (bytes_amount == 0.0)
- return 0.0;
-
- return SD_route_get_latency(src, dst) +
- (bytes_amount / SD_route_get_bandwidth(src,dst));
-}
/**
* \brief Returns the host name the storage is attached to