X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9ab646c308891c340270d62264b0d08354a1302b..9104957deccc59e0e804215d5db498fabfd40d29:/src/s4u/s4u_Exec.cpp diff --git a/src/s4u/s4u_Exec.cpp b/src/s4u/s4u_Exec.cpp index a0d3cc5302..72ab23817d 100644 --- a/src/s4u/s4u_Exec.cpp +++ b/src/s4u/s4u_Exec.cpp @@ -31,7 +31,7 @@ bool Exec::test() if (state_ == State::INITED || state_ == State::STARTING) this->vetoable_start(); - if (simcall_execution_test(pimpl_)) { + if (simcall_execution_test(get_impl())) { state_ = State::FINISHED; this->release_dependencies(); return true; @@ -49,7 +49,7 @@ Exec* Exec::wait_for(double timeout) { if (state_ == State::INITED) vetoable_start(); - simcall_execution_wait(pimpl_, timeout); + simcall_execution_wait(get_impl(), timeout); state_ = State::FINISHED; on_completion(*Actor::self(), *this); this->release_dependencies(); @@ -166,8 +166,7 @@ ExecPtr ExecSeq::set_host(Host* host) return this; } -/** @brief Returns the amount of flops that remain to be done */ -double ExecSeq::get_remaining() +double ExecSeq::get_remaining() const { return kernel::actor::simcall( [this]() { return boost::static_pointer_cast(pimpl_)->get_remaining(); }); @@ -177,7 +176,7 @@ double ExecSeq::get_remaining() * * The returned value is between 0 (completely done) and 1 (nothing done yet). */ -double ExecSeq::get_remaining_ratio() +double ExecSeq::get_remaining_ratio() const { return kernel::actor::simcall( [this]() { return boost::static_pointer_cast(pimpl_)->get_seq_remaining_ratio(); }); @@ -205,13 +204,13 @@ Exec* ExecPar::start() return this; } -double ExecPar::get_remaining_ratio() +double ExecPar::get_remaining_ratio() const { return kernel::actor::simcall( [this]() { return boost::static_pointer_cast(pimpl_)->get_par_remaining_ratio(); }); } -double ExecPar::get_remaining() +double ExecPar::get_remaining() const { XBT_WARN("Calling get_remaining() on a parallel execution is not allowed. Call get_remaining_ratio() instead."); return get_remaining_ratio();