XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
-simgrid::kernel::activity::ExecImpl::ExecImpl(const char* name, sg_host_t host) : host_(host)
+simgrid::kernel::activity::ExecImpl::ExecImpl(const char* name, resource::Action* surf_action,
+ resource::Action* timeout_detector, s4u::Host* host)
+ : host_(host)
{
if (name)
this->name = name;
this->state = SIMIX_RUNNING;
+
+ surfAction_ = surf_action;
+ surfAction_->set_data(this);
+ if (timeout_detector != nullptr) {
+ timeout_detector->set_data(this);
+ timeoutDetector = timeout_detector;
+ }
+
XBT_DEBUG("Create exec %p", this);
}
surfAction_->resume();
}
-double simgrid::kernel::activity::ExecImpl::remains()
+double simgrid::kernel::activity::ExecImpl::get_remaining()
{
xbt_assert(host_ != nullptr, "Calling remains() on a parallel execution is not allowed. "
"We would need to return a vector instead of a scalar. "
return surfAction_ ? surfAction_->get_remains() : 0;
}
-double simgrid::kernel::activity::ExecImpl::remainingRatio()
+double simgrid::kernel::activity::ExecImpl::get_remaining_ratio()
{
if (host_ == nullptr) // parallel task: their remain is already between 0 and 1 (see comment in ExecImpl::remains())
return surfAction_->get_remains();
return surfAction_->get_remains() / surfAction_->get_cost();
}
-void simgrid::kernel::activity::ExecImpl::setBound(double bound)
+void simgrid::kernel::activity::ExecImpl::set_bound(double bound)
{
if (surfAction_)
surfAction_->set_bound(bound);