include examples/cpp/dag-failure/s4u-dag-failure.cpp
include examples/cpp/dag-failure/s4u-dag-failure.tesh
include examples/cpp/dag-from-dot/dag.dot
-include examples/cpp/dag-from-dot/s4u_dag-frm-dot.cpp
-include examples/cpp/dag-from-dot/s4u_dag-frm-dot.tesh
+include examples/cpp/dag-from-dot/s4u_dag-from-dot.cpp
+include examples/cpp/dag-from-dot/s4u_dag-from-dot.tesh
include examples/cpp/dag-io/s4u-dag-io.cpp
include examples/cpp/dag-io/s4u-dag-io.tesh
include examples/cpp/dag-simple/s4u-dag-simple.cpp
* It is forbidden to change the amount of work once the Activity is started */
Activity* set_remaining(double remains);
+ double get_start_time() const;
+ double get_finish_time() const;
+
/** Returns the internal implementation of this Activity */
kernel::activity::ActivityImpl* get_impl() const { return pimpl_.get(); }
Host* get_host() const;
unsigned int get_host_number() const;
- double get_start_time() const;
- double get_finish_time() const;
double get_cost() const;
bool is_parallel() const { return parallel_; }
bool is_assigned() const override;
else {
// If nobody told the interface that the activity is finished, that's because no actor waits on it (maestro
// started it). SimDAG I see you!
- // The finish time of an Exec has to be set before the emission of the on_completion signal by complete
- auto* exec = dynamic_cast<activity::ExecImpl*>(action->get_activity());
- if (exec != nullptr)
- exec->set_finish_time(action->get_finish_time());
+ action->get_activity()->set_finish_time(action->get_finish_time());
if (action->get_activity()->get_actor() == maestro_)
action->get_activity()->get_iface()->complete(s4u::Activity::State::FINISHED);
resource::Action* surf_action_ = nullptr;
actor::ActorImpl* actor_ = nullptr;
s4u::Activity* piface_ = nullptr;
+ double start_time_ = -1.0;
+ double finish_time_ = -1.0;
protected:
void inline set_name(const std::string& name)
void set_iface(s4u::Activity* iface) { piface_ = iface; }
s4u::Activity* get_iface() { return piface_; }
+ double get_start_time() const { return start_time_; }
+ void set_finish_time(double finish_time) { finish_time_ = finish_time; }
+ double get_finish_time() const { return finish_time_; }
+
virtual bool test();
virtual void wait_for(actor::ActorImpl* issuer, double timeout);
virtual ActivityImpl& set_timeout(double) { THROW_UNIMPLEMENTED; }
surf_action_ = net_model->communicate(from_, to_, size_, rate_);
surf_action_->set_activity(this);
surf_action_->set_category(get_tracing_category());
+ start_time_ = surf_action_->get_start_time();
state_ = State::RUNNING;
on_start(*this);
state_ = State::DONE;
}
- finish_time_ = surf_action_->get_finish_time();
-
clean_action();
timeout_detector_.reset();
if (get_actor() != nullptr) {
nullptr, [](resource::Action* a) { a->unref(); }};
double sharing_penalty_ = 1.0;
double bound_ = 0.0;
- double start_time_ = -1.0;
- double finish_time_ = -1.0;
std::vector<s4u::Host*> hosts_;
std::vector<double> flops_amounts_;
std::vector<double> bytes_amounts_;
void set_cb_id(unsigned int cb_id) { cb_id_ = cb_id; }
- double get_start_time() const { return start_time_; }
- void set_finish_time(double finish_time) { finish_time_ = finish_time; }
- double get_finish_time() const { return finish_time_; }
-
ExecImpl& set_flops_amount(double flop_amount);
ExecImpl& set_host(s4u::Host* host);
s4u::Host* get_host() const { return hosts_.front(); }
disk_->get_host()->get_netpoint()->get_englobing_zone()->get_disk_model()->io_start(disk_, size_, type_);
surf_action_->set_sharing_penalty(sharing_penalty_);
surf_action_->set_activity(this);
+ start_time_ = surf_action_->get_start_time();
XBT_DEBUG("Create IO synchro %p %s", this, get_cname());
#include <simgrid/s4u/Io.hpp>
#include <xbt/log.h>
+#include "src/kernel/activity/ActivityImpl.hpp"
#include "src/kernel/actor/ActorImpl.hpp"
#include "src/kernel/actor/SimcallObserver.hpp"
else
return pimpl_->get_remaining();
}
+double Activity::get_start_time() const
+{
+ return pimpl_->get_start_time();
+}
+double Activity::get_finish_time() const
+{
+ return pimpl_->get_finish_time();
+}
Activity* Activity::set_remaining(double remains)
{
return static_cast<kernel::activity::ExecImpl*>(pimpl_.get())->get_host_number();
}
-double Exec::get_start_time() const
-{
- return static_cast<kernel::activity::ExecImpl*>(pimpl_.get())->get_start_time();
-}
-
-double Exec::get_finish_time() const
-{
- return static_cast<kernel::activity::ExecImpl*>(pimpl_.get())->get_finish_time();
-}
-
/** @brief Change the host on which this activity takes place.
*
* The activity cannot be terminated already (but it may be started). */