}
}
+double ActivityImpl::get_remaining() const
+{
+ return surf_action_ ? surf_action_->get_remains() : 0;
+}
+
void ActivityImpl::suspend()
{
if (surf_action_ == nullptr)
virtual void post() = 0; // What to do when a simcall terminates
virtual void finish() = 0;
+ virtual double get_remaining() const;
// boost::intrusive_ptr<ActivityImpl> support:
friend XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
friend XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
other_comm = std::move(this_synchro);
mbox->push(other_comm);
} else {
- if (other_comm->surf_action_ && other_comm->remains() < 1e-12) {
+ if (other_comm->surf_action_ && other_comm->get_remaining() < 1e-12) {
XBT_DEBUG("comm %p has been already sent, and is finished, destroy it", other_comm.get());
other_comm->state_ = SIMIX_DONE;
other_comm->set_type(simgrid::kernel::activity::CommImpl::Type::DONE);
}
}
-/** @brief get the amount remaining from the communication */
-double CommImpl::remains()
-{
- return surf_action_->get_remains();
-}
-
/** @brief This is part of the cleanup process, probably an internal command */
void CommImpl::cleanupSurf()
{
void post() override;
void finish() override;
void cancel();
- double remains();
CommImpl::Type type_; /* Type of the communication (SIMIX_COMM_SEND or SIMIX_COMM_RECEIVE) */
MailboxImpl* mbox = nullptr; /* Rendez-vous where the comm is queued */
surf_action_->cancel();
}
-double ExecImpl::get_remaining() const
-{
- return surf_action_ ? surf_action_->get_remains() : 0;
-}
-
double ExecImpl::get_seq_remaining_ratio()
{
return (surf_action_ == nullptr) ? 0 : surf_action_->get_remains() / surf_action_->get_cost();
ExecImpl& set_hosts(const std::vector<s4u::Host*>& hosts);
unsigned int get_host_number() const { return hosts_.size(); }
- double get_remaining() const;
double get_seq_remaining_ratio();
double get_par_remaining_ratio();
virtual ActivityImpl* migrate(s4u::Host* to);
state_ = SIMIX_CANCELED;
}
-double IoImpl::get_remaining()
-{
- return surf_action_ ? surf_action_->get_remains() : 0;
-}
-
void IoImpl::post()
{
performed_ioops_ = surf_action_->get_cost();
void post() override;
void finish() override;
void cancel();
- double get_remaining();
static xbt::signal<void(IoImpl const&)> on_start;
static xbt::signal<void(IoImpl const&)> on_completion;