Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't try to change the rate of task once it's done, the new test in
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 25 Jun 2015 13:56:08 +0000 (15:56 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 25 Jun 2015 13:56:22 +0000 (15:56 +0200)
SD_task_set_rate raises a justified warn.
Add a comment to warn readers that such a change must be done before the
beginning of the execution of a task.

examples/simdag/sd_comm_throttling.c

index b97e811..8f5f294 100644 (file)
@@ -74,8 +74,10 @@ int main(int argc, char **argv)
     /* let throttle the communication for taskD if its parent is SD_DONE */
     /* 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
     /* let throttle the communication for taskD if its parent is SD_DONE */
     /* 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)
+    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);
   }
       SD_task_set_rate(taskD, 6.25);
     xbt_dynar_free_container(&changed_tasks);
   }