X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/12ad1e7c01058fada33cecf2d4c4cb8bf9874f9e..c139b4e36702f58bd8a75e87cf537959da82dbc9:/src/s4u/s4u_exec.cpp diff --git a/src/s4u/s4u_exec.cpp b/src/s4u/s4u_exec.cpp index 6527decae1..e7a16ae48c 100644 --- a/src/s4u/s4u_exec.cpp +++ b/src/s4u/s4u_exec.cpp @@ -16,6 +16,7 @@ namespace s4u { Activity* Exec::start() { pimpl_ = simcall_execution_start(nullptr, flops_amount_, 1 / priority_, 0., host_); + boost::static_pointer_cast(pimpl_)->setBound(bound_); state_ = started; return this; } @@ -59,6 +60,14 @@ ExecPtr Exec::setPriority(double priority) priority_ = priority; return this; } + +ExecPtr Exec::setBound(double bound) +{ + xbt_assert(state_ == inited, "Cannot change the bound of an exec after its start"); + bound_ = bound; + return this; +} + ExecPtr Exec::setHost(Host* host) { xbt_assert(state_ == inited || state_ == started, "Cannot change the host of an exec once it's done (state: %d)", state_);