X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b4ace96f8a501a6659817d9741aeb103cbcfd2c4..04ac83f8e0edcc8dc577c4d28c8c419bc46abd5b:/src/s4u/s4u_Exec.cpp diff --git a/src/s4u/s4u_Exec.cpp b/src/s4u/s4u_Exec.cpp index 698c1b1261..0bee8d4dab 100644 --- a/src/s4u/s4u_Exec.cpp +++ b/src/s4u/s4u_Exec.cpp @@ -98,13 +98,9 @@ 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(); @@ -139,13 +135,6 @@ ExecPtr Exec::set_priority(double priority) return this; } -ExecPtr Exec::set_tracing_category(const std::string& category) -{ - xbt_assert(state_ == State::INITED, "Cannot change the tracing category of an exec after its start"); - tracing_category_ = category; - return this; -} - ///////////// SEQUENTIAL EXECUTIONS //////// ExecSeq::ExecSeq(sg_host_t host, double flops_amount) : Exec(), flops_amount_(flops_amount) { @@ -157,8 +146,8 @@ Exec* ExecSeq::start() { kernel::actor::simcall([this] { (*boost::static_pointer_cast(pimpl_)) - .set_name(name_) - .set_tracing_category(tracing_category_) + .set_name(get_name()) + .set_tracing_category(get_tracing_category()) .set_sharing_penalty(1. / priority_) .set_bound(bound_) .set_flops_amount(flops_amount_) @@ -179,18 +168,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() {