* \brief Sets the rate of a task
*
* 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.
+ * cannot be dynamically changed. Once the task has started, this call
+ * is ineffective. 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.
*
* To divide the nominal bandwidth by 2, the rate then has to be :
* rate = bandwidth/(2*amount)
{
xbt_assert(task->kind == SD_TASK_COMM_E2E,
"The rate can be modified for end-to-end communications only.");
-
- task->rate = rate;
+ if(task->start_time<0) {
+ task->rate = rate;
+ } else {
+ XBT_WARN("Task %p has started. Changing rate is ineffective.", task);
+ }
}
/**