X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/72a65816fe8cd9943700afe186b186be9a07ab82..fe6302bb22ba202d3e193ee8ec436c14adb7ecd6:/src/simdag/sd_task.c?ds=sidebyside diff --git a/src/simdag/sd_task.c b/src/simdag/sd_task.c index 9ab54e6cde..4673948af0 100644 --- a/src/simdag/sd_task.c +++ b/src/simdag/sd_task.c @@ -292,9 +292,10 @@ void SD_task_set_data(SD_task_t task, void *data) * \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) @@ -306,8 +307,11 @@ void SD_task_set_rate(SD_task_t task, double rate) { 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); + } } /**