XBT_DEBUG("Destroy exec %p", this);
}
-void ExecImpl::start(double flops_amount, double priority, double bound)
+ExecImpl* ExecImpl::start(double flops_amount, double priority, double bound)
{
if (not MC_is_active() && not MC_record_replay_is_active()) {
surf_action_ = host_->pimpl_cpu->execution_start(flops_amount);
XBT_DEBUG("Create execute synchro %p: %s", this, name_.c_str());
ExecImpl::on_creation(this);
+ return this;
}
void ExecImpl::cancel()
public:
explicit ExecImpl(std::string name, std::string tracing_category, resource::Action* timeout_detector,
s4u::Host* host);
- void start(double flops_amount, double priority, double bound);
+ ExecImpl* start(double flops_amount, double priority, double bound);
void cancel();
void post() override;
double get_remaining();
return nullptr;
} else {
- activity::ExecImplPtr exec = activity::ExecImplPtr(new activity::ExecImpl("suspend", "", nullptr, this->host_));
- exec->start(0.0, 1.0, 0.0);
- return exec;
+ return activity::ExecImplPtr(new activity::ExecImpl("suspend", "", nullptr, this->host_))->start(0.0, 1.0, 0.0);
}
}
double bound, sg_host_t host)
{
return simgrid::simix::simcall([name, category, flops_amount, priority, bound, host] {
- simgrid::kernel::activity::ExecImplPtr exec =
- simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl(name, category, nullptr, host));
- exec->start(flops_amount, priority, bound);
- return exec;
+ return simgrid::kernel::activity::ExecImplPtr(
+ new simgrid::kernel::activity::ExecImpl(name, category, nullptr, host))
+ ->start(flops_amount, priority, bound);
});
}