X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b3e114ae7d1b41bd4ecf3e60213344e2e2c4813f..cc4ca208c5e056ac569cd07e08f09a416f3606fe:/src/s4u/s4u_exec.cpp diff --git a/src/s4u/s4u_exec.cpp b/src/s4u/s4u_exec.cpp index 1fb2e5b6d8..ca3623d279 100644 --- a/src/s4u/s4u_exec.cpp +++ b/src/s4u/s4u_exec.cpp @@ -15,7 +15,7 @@ namespace s4u { void Exec::start() { - pimpl_ = simcall_execution_start(nullptr, flops_amount_, 1 / priority_, 0.); + pimpl_ = simcall_execution_start(nullptr, flops_amount_, 1 / priority_, 0., host_); state_ = started; } @@ -41,14 +41,26 @@ bool Exec::test() this->start(); } + if (simcall_execution_test(pimpl_)) { + state_ = finished; + return true; + } + return false; } ExecPtr Exec::setPriority(double priority) { + xbt_assert(state_ == inited, "Cannot change the priority of an exec after its start"); priority_ = priority; return this; } +ExecPtr Exec::setHost(Host* host) +{ + xbt_assert(state_ == inited, "Cannot change the host of an exec after its start"); + host_ = host; + return this; +} double Exec::getRemains() {