Action::get_data() and Action::set_data() remain because of SimDag ...
/** @brief Set the user data associated to the current action */
void set_data(void* data) { data_ = data; }
+ /** @brief Get the user data associated to the current action */
+ activity::ActivityImpl* get_activity() const { return activity_; }
+ /** @brief Set the user data associated to the current action */
+ void set_activity(activity::ActivityImpl* activity) { activity_ = activity; }
+
/** @brief Get the cost of the current action */
double get_cost() const { return cost_; }
/** @brief Set the cost of the current action */
double cost_;
simgrid::kernel::resource::Model* model_;
- void* data_ = nullptr; /**< for your convenience */
+ void* data_ = nullptr; /**< for your convenience */
+ activity::ActivityImpl* activity_ = nullptr;
/* LMM */
double last_update_ = 0;
comm->finish();
} else { /* we need a sleep action (even when there is no timeout) to be notified of host failures */
simgrid::kernel::resource::Action* sleep = simcall->issuer->get_host()->pimpl_cpu->sleep(timeout);
- sleep->set_data(comm);
+ sleep->set_activity(comm);
if (simcall->issuer == comm->src_actor_)
comm->src_timeout_ = sleep;
s4u::Host* receiver = dst_actor_->get_host();
surf_action_ = surf_network_model->communicate(sender, receiver, size_, rate_);
- surf_action_->set_data(this);
+ surf_action_->set_activity(this);
surf_action_->set_category(get_tracing_category());
state_ = SIMIX_RUNNING;
{
if (timeout > 0 && not MC_is_active() && not MC_record_replay_is_active()) {
timeout_detector_ = hosts_.front()->pimpl_cpu->sleep(timeout);
- timeout_detector_->set_data(this);
+ timeout_detector_->set_activity(this);
}
return *this;
}
} else {
surf_action_ = surf_host_model->execute_parallel(hosts_, flops_amounts_.data(), bytes_amounts_.data(), -1);
}
- surf_action_->set_data(this);
+ surf_action_->set_activity(this);
}
XBT_DEBUG("Create execute synchro %p: %s", this, get_cname());
resource::Action* old_action = this->surf_action_;
resource::Action* new_action = to->pimpl_cpu->execution_start(old_action->get_cost());
new_action->set_remains(old_action->get_remains());
- new_action->set_data(this);
+ new_action->set_activity(this);
new_action->set_priority(old_action->get_priority());
// FIXME: the user-defined bound seem to not be kept by LMM, that seem to overwrite it for the multi-core modeling.
// I hope that the user did not provide any.
- old_action->set_data(nullptr);
+ old_action->set_activity(nullptr);
old_action->cancel();
old_action->unref();
this->surf_action_ = new_action;
{
state_ = SIMIX_RUNNING;
surf_action_ = storage_->io_start(size_, type_);
- surf_action_->set_data(this);
+ surf_action_->set_activity(this);
XBT_DEBUG("Create IO synchro %p %s", this, get_cname());
IoImpl::on_start(*this);
SleepImpl* SleepImpl::start()
{
surf_action_ = host_->pimpl_cpu->sleep(duration_);
- surf_action_->set_data(this);
+ surf_action_->set_activity(this);
XBT_DEBUG("Create sleep synchronization %p", this);
return this;
}
RawImpl* RawImpl::start()
{
surf_action_ = host_->pimpl_cpu->sleep(timeout_);
- surf_action_->set_data(this);
+ surf_action_->set_activity(this);
return this;
}
XBT_DEBUG("Handling the processes whose action failed (if any)");
while ((action = model->extract_failed_action())) {
XBT_DEBUG(" Handling Action %p",action);
- SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->get_data()));
+ SIMIX_simcall_exit(action->get_activity());
}
XBT_DEBUG("Handling the processes whose action terminated normally (if any)");
while ((action = model->extract_done_action())) {
XBT_DEBUG(" Handling Action %p",action);
- if (action->get_data() == nullptr)
+ if (action->get_activity() == nullptr)
XBT_DEBUG("probably vcpu's action %p, skip", action);
else
- SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->get_data()));
+ SIMIX_simcall_exit(action->get_activity());
}
}
}