- if (SD_task_get_state(taskC) == SD_DONE)
- SD_task_set_rate(taskD, 0.5);
+ /* the bandwidth is 1.25e8, the data size is 1e7, and we want to throttle
+ * the bandwidth by a factor 2. the rate is then 1.25e8/(2*1e7)=6.25
+ * Changing the rate is possible before the task execution starts (in SD_RUNNING
+ * state).
+ */
+ if (SD_task_get_state(taskC) == SD_DONE && SD_task_get_state(taskD) < SD_RUNNING)
+ SD_task_set_rate(taskD, 6.25);
+ xbt_dynar_free_container(&changed_tasks);