From: Frederic Suter Date: Wed, 27 Jan 2016 00:36:57 +0000 (+0100) Subject: kill another dummy function X-Git-Tag: v3_13~1058^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/637ea584259092fe072dcc89bfe9857522c9728a kill another dummy function --- diff --git a/examples/simdag/scheduling/minmin_test.c b/examples/simdag/scheduling/minmin_test.c index 560f981fcf..10ae769e26 100644 --- a/examples/simdag/scheduling/minmin_test.c +++ b/examples/simdag/scheduling/minmin_test.c @@ -116,10 +116,16 @@ static double finish_on_at(SD_task_t task, sg_host_t workstation) 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; diff --git a/examples/simdag/sd_test.c b/examples/simdag/sd_test.c index d773d39368..2f236a65d2 100644 --- a/examples/simdag/sd_test.c +++ b/examples/simdag/sd_test.c @@ -78,10 +78,12 @@ int main(int argc, char **argv) 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); diff --git a/include/simgrid/simdag.h b/include/simgrid/simdag.h index 7d2ac9ec2a..0fcdfbd337 100644 --- a/include/simgrid/simdag.h +++ b/include/simgrid/simdag.h @@ -95,9 +95,6 @@ XBT_PUBLIC(int) SD_route_get_size(sg_host_t src, sg_host_t dst); 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); /** @} */ diff --git a/src/simdag/sd_task.cpp b/src/simdag/sd_task.cpp index 828ac09635..9309197d37 100644 --- a/src/simdag/sd_task.cpp +++ b/src/simdag/sd_task.cpp @@ -904,12 +904,13 @@ double SD_task_get_execution_time(SD_task_t task, 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) { diff --git a/src/simdag/sd_workstation.cpp b/src/simdag/sd_workstation.cpp index 8caaff51c9..83343296ba 100644 --- a/src/simdag/sd_workstation.cpp +++ b/src/simdag/sd_workstation.cpp @@ -129,31 +129,6 @@ double SD_route_get_bandwidth(sg_host_t src, sg_host_t dst) 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