X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cdf6a962eb4e88efbed3df9c41343adabcf09e6c..ce930ad96b622e2b3856b7d9c3d97e60ec2c93a1:/src/s4u/s4u_Exec.cpp diff --git a/src/s4u/s4u_Exec.cpp b/src/s4u/s4u_Exec.cpp index 76dbb61622..7684d9cf78 100644 --- a/src/s4u/s4u_Exec.cpp +++ b/src/s4u/s4u_Exec.cpp @@ -98,6 +98,16 @@ ExecPtr Exec::set_timeout(double timeout) return this; } +ExecPtr Exec::set_name(const std::string& name) +{ + xbt_assert(state_ == State::INITED, "Cannot change the name of an exec after its start"); + name_ = name; + return this; +} + +/** @brief Retrieve the host on which this activity takes place. + * If it runs on more than one host, only the first host is returned. + */ Host* Exec::get_host() const { return static_cast(pimpl_.get())->get_host(); @@ -165,18 +175,10 @@ ExecPtr ExecSeq::set_host(Host* host) "Cannot change the host of an exec once it's done (state: %d)", (int)state_); if (state_ == State::STARTED) boost::static_pointer_cast(pimpl_)->migrate(host); - host_ = host; boost::static_pointer_cast(pimpl_)->set_host(host); return this; } - -/** @brief Retrieve the host on which this activity takes place. */ -Host* ExecSeq::get_host() -{ - return host_; -} - /** @brief Returns the amount of flops that remain to be done */ double ExecSeq::get_remaining() {