return *this;
}
+ExecImpl& ExecImpl::set_thread_count(int thread_count)
+{
+ thread_count_ = thread_count;
+
+ return *this;
+}
ExecImpl* ExecImpl::start()
{
set_state(State::RUNNING);
if (not MC_is_active() && not MC_record_replay_is_active()) {
if (hosts_.size() == 1) {
- surf_action_ = hosts_.front()->get_cpu()->execution_start(flops_amounts_.front(), bound_);
- surf_action_->set_sharing_penalty(sharing_penalty_);
+ if (thread_count_ == 1) {
+ surf_action_ = hosts_.front()->get_cpu()->execution_start(flops_amounts_.front(), bound_);
+ surf_action_->set_sharing_penalty(sharing_penalty_);
+ } else {
+ auto host_model = hosts_.front()->get_netpoint()->get_englobing_zone()->get_host_model();
+ surf_action_ = host_model->execute_thread(hosts_.front(), flops_amounts_.front(), thread_count_);
+ }
surf_action_->set_category(get_tracing_category());
} else {
// get the model from first host since we have only 1 by now
if (issuer->get_host()->is_on())
issuer->exception_ = std::make_exception_ptr(HostFailureException(XBT_THROW_POINT, "Host failed"));
else /* else, the actor will be killed with no possibility to survive */
- issuer->context_->set_wannadie();
+ issuer->set_wannadie();
break;
case State::CANCELED:
{
XBT_DEBUG("ExecImpl::finish() in state %s", get_state_str());
while (not simcalls_.empty()) {
- smx_simcall_t simcall = simcalls_.front();
+ actor::Simcall* simcall = simcalls_.front();
simcalls_.pop_front();
- if (simcall->call_ == simix::Simcall::NONE) // FIXME: maybe a better way to handle this case
- continue; // if process handling comm is killed
+ if (simcall->call_ == actor::Simcall::Type::NONE) // FIXME: maybe a better way to handle this case
+ continue; // if process handling comm is killed
handle_activity_waitany(simcall);
if (simcall->issuer_->get_host()->is_on())
simcall->issuer_->simcall_answer();
else
- simcall->issuer_->context_->set_wannadie();
+ simcall->issuer_->set_wannadie();
}
}