* \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,
{
xbt_assert(alpha < 1. && alpha >= 0.,
"Invalid parameter: alpha must be in [0.;1.[");
-
+
SD_task_t res = SD_task_create(name, data, amount);
res->alpha = alpha;
res->kind = SD_TASK_COMP_PAR_AMDAHL;
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
*
&& !__SD_task_is_scheduled_or_runnable(src) && !__SD_task_is_running(src))
THROWF(arg_error, 0,
"Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED or SD_RUNNABLE"
- " or SD_RUNNING",
+ " or SD_RUNNING",
SD_task_get_name(src));
if (!__SD_task_is_not_scheduled(dst) && !__SD_task_is_schedulable(dst)
for(i=0;i<ws_count;i++){
task->computation_amount[i] =
- (task->alpha + (1 - task->alpha)/ws_count) * task->amount;
+ (task->alpha + (1 - task->alpha)/ws_count) * task->amount;
}
}
}
if (task->kind == SD_TASK_COMP_PAR_AMDAHL) {
- XBT_VERB("Schedule computation task %s on %d hosts. It costs %.f flops on each host",
- SD_task_get_name(task),
- task->workstation_nb,
- task->computation_amount[0]);
+ XBT_VERB("Schedule computation task %s on %d hosts. It costs %.f flops on each host",
+ SD_task_get_name(task),
+ task->workstation_nb,
+ task->computation_amount[0]);
}
/* Iterate over all childs and parent being COMM_E2E to say where I am located (and start them if runnable) */