Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add a SD_task_set_rate function
[simgrid.git] / src / simdag / sd_task.c
index e3ab770..e62ad0f 100644 (file)
@@ -166,7 +166,7 @@ SD_task_t SD_task_create_comp_seq(const char *name, void *data,
  * \param name the name of the task (can be \c NULL)
  * \param data the user data you want to associate with the task (can be \c NULL)
  * \param amount amount of compute work to be done by the task
- * \param purely serial fraction of the work to be done (in [0.;1.[)
+ * \param alpha purely serial fraction of the work to be done (in [0.;1.[)
  * \return the new task
  */
 SD_task_t SD_task_create_comp_par_amdahl(const char *name, void *data,
@@ -249,6 +249,20 @@ void SD_task_set_data(SD_task_t task, void *data)
   task->data = data;
 }
 
+/**
+ * \brief Sets the rate of a task
+ *
+ * This will change the percentage of the available power or network bandwidth
+ * a task can use.
+ *
+ * \param task a task
+ * \param rate the new rate you want to associate with this task
+ */
+void SD_task_set_rate(SD_task_t task, double rate)
+{
+  task->rate = rate;
+}
+
 /**
  * \brief Returns the state of a task
  *