From: Frederic Suter Date: Mon, 25 Feb 2019 10:44:47 +0000 (+0100) Subject: priority and bound of MSG tasks can only be set BEFORE execution X-Git-Tag: v3_22~253 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d21feacc9eab1017d4e5b9d989a5c68c89d1f47c priority and bound of MSG tasks can only be set BEFORE execution this is the rule for S4U, should be the same for MSG. BTW, the behavior of the LMM is likely to be confused by such dynamic changes during execution. Side effect: we should remove the setters in ExecImpl, but there are used by two simcalls that are tagged as deprected with v3.25 --- diff --git a/src/kernel/activity/ExecImpl.hpp b/src/kernel/activity/ExecImpl.hpp index cda277cd9b..38cedadf04 100644 --- a/src/kernel/activity/ExecImpl.hpp +++ b/src/kernel/activity/ExecImpl.hpp @@ -26,8 +26,8 @@ public: void finish() override; double get_remaining(); double get_remaining_ratio(); - void set_bound(double bound); - void set_priority(double priority); + void set_bound(double bound); // deprecated. To be removed in v3.25 + void set_priority(double priority); // deprecated. To be removed in v3.25 virtual ActivityImpl* migrate(s4u::Host* to); /* The host where the execution takes place. nullptr means this is a parallel exec (and only surf knows the hosts) */ diff --git a/src/msg/msg_task.cpp b/src/msg/msg_task.cpp index 7101756d5e..42ec522c5a 100644 --- a/src/msg/msg_task.cpp +++ b/src/msg/msg_task.cpp @@ -285,8 +285,6 @@ void MSG_task_set_priority(msg_task_t task, double priority) { task->simdata->priority = 1 / priority; xbt_assert(std::isfinite(task->simdata->priority), "priority is not finite!"); - if (task->simdata->compute) - simgrid::simix::simcall([task] { task->simdata->compute->set_priority(task->simdata->priority); }); } /** @brief Changes the maximum CPU utilization of a computation task (in flops/s). @@ -297,8 +295,5 @@ void MSG_task_set_bound(msg_task_t task, double bound) { if (bound < 1e-12) /* close enough to 0 without any floating precision surprise */ XBT_INFO("bound == 0 means no capping (i.e., unlimited)."); - task->simdata->bound = bound; - if (task->simdata->compute) - simgrid::simix::simcall([task, bound] { task->simdata->compute->set_bound(bound); }); }