A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Finally understand how the rate works. Explain it in the doxygen header.
[simgrid.git]
/
src
/
simdag
/
sd_task.c
diff --git
a/src/simdag/sd_task.c
b/src/simdag/sd_task.c
index
11d27bb
..
c51d5f2
100644
(file)
--- a/
src/simdag/sd_task.c
+++ b/
src/simdag/sd_task.c
@@
-279,14
+279,22
@@
void SD_task_set_data(SD_task_t task, void *data)
/**
* \brief Sets the rate of a task
*
/**
* \brief Sets the rate of a task
*
- * This will change the percentage of the available power or network bandwidth
- * a task can use.
+ * This will change the network bandwidth a task can use. This rate
+ * depends on both the nominal bandwidth on the route onto which the task is
+ * scheduled (\see SD_task_get_current_bandwidth) and the amount of data to
+ * transfer.
*
*
- * \param task a task
- * \param rate the new rate (in percent) you want to associate with this task
+ * To divide the nominal bandwidth by 2, the rate then has to be :
+ * rate = bandwidth/(2*amount)
+ *
+ * \param task a \see SD_TASK_COMM_E2E task (end-to-end communication)
+ * \param rate the new rate you want to associate with this task.
*/
void SD_task_set_rate(SD_task_t task, double rate)
{
*/
void SD_task_set_rate(SD_task_t task, double rate)
{
+ xbt_assert(task->kind == SD_TASK_COMM_E2E,
+ "The rate can be modified for end-to-end communications only.");
+
task->rate = rate;
}
task->rate = rate;
}