- Rename the hooks and associated typedefs for the intrusive lists
Action::ModifiedSet (used by lazy lmm) and Action::StateSet
(grouping all actions in the same state)
- Start snake_case()ing the public interface of simix::kernel::resource.
It's public, but since really short, and since some methods are
virtual and overriden, deprecating them properly will be really
hard. I think it's useless since nobody (but me) uses it in external
projects yet.
- Remove some extraneous namespace specifications (we are already in
simgrid::kernel)
37 files changed:
boost::heap::compare<simgrid::xbt::HeapComparator<heap_element_type>>>
heap_type;
boost::heap::compare<simgrid::xbt::HeapComparator<heap_element_type>>>
heap_type;
-/** @ingroup SURF_interface
- * @brief SURF action interface class
- * @details An action is an event generated by a resource (e.g.: a communication for the network)
- */
+/** @details An action is a consumption on a resource (e.g.: a communication for the network) */
class XBT_PUBLIC Action {
public:
class XBT_PUBLIC Action {
public:
- boost::intrusive::list_member_hook<> modifiedSetHook_; /* Used by the lazy update to list the actions to track */
- bool isLinkedModifiedSet() const { return modifiedSetHook_.is_linked(); }
-
- typedef boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::modifiedSetHook_>
- ActionLmmOptions;
- typedef boost::intrusive::list<Action, ActionLmmOptions> ActionLmmList;
-
- boost::intrusive::list_member_hook<> stateSetHook_;
- typedef boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::stateSetHook_>
- ActionOptions;
- typedef boost::intrusive::list<Action, ActionOptions> ActionList;
+ /* Lazy update needs this Set hook to maintain a list of the tracked actions */
+ boost::intrusive::list_member_hook<> modified_set_hook_;
+ bool isLinkedModifiedSet() const { return modified_set_hook_.is_linked(); }
+ typedef boost::intrusive::list<
+ Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::modified_set_hook_>>
+ ModifiedSet;
+
+ boost::intrusive::list_member_hook<> state_set_hook_;
+ typedef boost::intrusive::list<
+ Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::state_set_hook_>>
+ StateSet;
enum class State {
ready = 0, /**< Ready */
enum class State {
ready = 0, /**< Ready */
* @param cost The cost of the Action
* @param failed If the action is impossible (e.g.: execute something on a switched off host)
*/
* @param cost The cost of the Action
* @param failed If the action is impossible (e.g.: execute something on a switched off host)
*/
- Action(simgrid::kernel::resource::Model* model, double cost, bool failed);
+ Action(Model* model, double cost, bool failed);
/**
* @brief Action constructor
/**
* @brief Action constructor
* @param failed If the action is impossible (e.g.: execute something on a switched off host)
* @param var The lmm variable associated to this Action if it is part of a LMM component
*/
* @param failed If the action is impossible (e.g.: execute something on a switched off host)
* @param var The lmm variable associated to this Action if it is part of a LMM component
*/
- Action(simgrid::kernel::resource::Model* model, double cost, bool failed, kernel::lmm::Variable* var);
+ Action(Model* model, double cost, bool failed, lmm::Variable* var);
void finish(Action::State state);
/** @brief Get the [state](\ref simgrid::kernel::resource::Action::State) of the current Action */
void finish(Action::State state);
/** @brief Get the [state](\ref simgrid::kernel::resource::Action::State) of the current Action */
- Action::State getState() const; /**< get the state*/
+ Action::State get_state() const; /**< get the state*/
/** @brief Set the [state](\ref simgrid::kernel::resource::Action::State) of the current Action */
/** @brief Set the [state](\ref simgrid::kernel::resource::Action::State) of the current Action */
- virtual void setState(Action::State state);
+ virtual void set_state(Action::State state);
/** @brief Get the bound of the current Action */
/** @brief Get the bound of the current Action */
- double getBound() const;
+ double get_bound() const;
/** @brief Set the bound of the current Action */
/** @brief Set the bound of the current Action */
- void setBound(double bound);
+ void set_bound(double bound);
/** @brief Get the start time of the current action */
/** @brief Get the start time of the current action */
- double getStartTime() const { return start_; }
+ double get_start_time() const { return start_time_; }
/** @brief Get the finish time of the current action */
double getFinishTime() const { return finish_time_; }
/** @brief Get the user data associated to the current action */
/** @brief Get the finish time of the current action */
double getFinishTime() const { return finish_time_; }
/** @brief Get the user data associated to the current action */
- void* getData() const { return data_; }
+ void* get_data() const { return data_; }
/** @brief Set the user data associated to the current action */
/** @brief Set the user data associated to the current action */
- void setData(void* data) { data_ = data; }
+ void set_data(void* data) { data_ = data; }
/** @brief Get the cost of the current action */
double getCost() const { return cost_; }
/** @brief Get the cost of the current action */
double getCost() const { return cost_; }
void setSharingWeightNoUpdate(double weight) { sharing_weight_ = weight; }
/** @brief Get the state set in which the action is */
void setSharingWeightNoUpdate(double weight) { sharing_weight_ = weight; }
/** @brief Get the state set in which the action is */
- ActionList* getStateSet() const { return state_set_; };
+ StateSet* getStateSet() const { return state_set_; };
simgrid::kernel::resource::Model* getModel() const { return model_; }
protected:
simgrid::kernel::resource::Model* getModel() const { return model_; }
protected:
- ActionList* state_set_;
int refcount_ = 1;
private:
double sharing_weight_ = 1.0; /**< priority (1.0 by default) */
double max_duration_ = NO_MAX_DURATION; /*< max_duration (may fluctuate until the task is completed) */
double remains_; /**< How much of that cost remains to be done in the currently running task */
int refcount_ = 1;
private:
double sharing_weight_ = 1.0; /**< priority (1.0 by default) */
double max_duration_ = NO_MAX_DURATION; /*< max_duration (may fluctuate until the task is completed) */
double remains_; /**< How much of that cost remains to be done in the currently running task */
- double start_; /**< start time */
+ double start_time_; /**< start time */
char* category_ = nullptr; /**< tracing category for categorized resource utilization monitoring */
double finish_time_ =
-1; /**< finish time : this is modified during the run and fluctuates until the task is completed */
char* category_ = nullptr; /**< tracing category for categorized resource utilization monitoring */
double finish_time_ =
-1; /**< finish time : this is modified during the run and fluctuates until the task is completed */
Action::SuspendStates suspended_ = Action::SuspendStates::not_suspended;
};
Action::SuspendStates suspended_ = Action::SuspendStates::not_suspended;
};
-typedef Action::ActionList ActionList;
-typedef Action::ActionLmmList ActionLmmList;
-typedef Action::ActionLmmList* ActionLmmListPtr;
} // namespace resource
} // namespace kernel
} // namespace simgrid
} // namespace resource
} // namespace kernel
} // namespace simgrid
virtual ~Model();
/** @brief Get the set of [actions](@ref Action) in *ready* state */
virtual ~Model();
/** @brief Get the set of [actions](@ref Action) in *ready* state */
- ActionList* getReadyActionSet() const { return ready_action_set_; }
+ Action::StateSet* getReadyActionSet() const { return ready_action_set_; }
/** @brief Get the set of [actions](@ref Action) in *running* state */
/** @brief Get the set of [actions](@ref Action) in *running* state */
- ActionList* getRunningActionSet() const { return running_action_set_; }
+ Action::StateSet* getRunningActionSet() const { return running_action_set_; }
/** @brief Get the set of [actions](@ref Action) in *failed* state */
/** @brief Get the set of [actions](@ref Action) in *failed* state */
- ActionList* getFailedActionSet() const { return failed_action_set_; }
+ Action::StateSet* getFailedActionSet() const { return failed_action_set_; }
/** @brief Get the set of [actions](@ref Action) in *done* state */
/** @brief Get the set of [actions](@ref Action) in *done* state */
- ActionList* getDoneActionSet() const { return done_action_set_; }
+ Action::StateSet* getDoneActionSet() const { return done_action_set_; }
/** @brief Get the set of modified [actions](@ref Action) */
/** @brief Get the set of modified [actions](@ref Action) */
- ActionLmmListPtr getModifiedSet() const;
+ Action::ModifiedSet* getModifiedSet() const;
/** @brief Get the maxmin system of the current Model */
lmm::System* getMaxminSystem() const { return maxmin_system_; }
/** @brief Get the maxmin system of the current Model */
lmm::System* getMaxminSystem() const { return maxmin_system_; }
private:
e_UM_t update_mechanism_ = UM_UNDEFINED;
private:
e_UM_t update_mechanism_ = UM_UNDEFINED;
- ActionList* ready_action_set_ = new ActionList(); /**< Actions in state SURF_ACTION_READY */
- ActionList* running_action_set_ = new ActionList(); /**< Actions in state SURF_ACTION_RUNNING */
- ActionList* failed_action_set_ = new ActionList(); /**< Actions in state SURF_ACTION_FAILED */
- ActionList* done_action_set_ = new ActionList(); /**< Actions in state SURF_ACTION_DONE */
+ Action::StateSet* ready_action_set_ = new Action::StateSet(); /**< Actions in state SURF_ACTION_READY */
+ Action::StateSet* running_action_set_ = new Action::StateSet(); /**< Actions in state SURF_ACTION_RUNNING */
+ Action::StateSet* failed_action_set_ = new Action::StateSet(); /**< Actions in state SURF_ACTION_FAILED */
+ Action::StateSet* done_action_set_ = new Action::StateSet(); /**< Actions in state SURF_ACTION_DONE */
heap_type action_heap_;
};
heap_type action_heap_;
};
void simgrid::kernel::activity::CommImpl::post()
{
/* Update synchro state */
void simgrid::kernel::activity::CommImpl::post()
{
/* Update synchro state */
- if (src_timeout && src_timeout->getState() == simgrid::kernel::resource::Action::State::done)
+ if (src_timeout && src_timeout->get_state() == simgrid::kernel::resource::Action::State::done)
state = SIMIX_SRC_TIMEOUT;
state = SIMIX_SRC_TIMEOUT;
- else if (dst_timeout && dst_timeout->getState() == simgrid::kernel::resource::Action::State::done)
+ else if (dst_timeout && dst_timeout->get_state() == simgrid::kernel::resource::Action::State::done)
state = SIMIX_DST_TIMEOUT;
state = SIMIX_DST_TIMEOUT;
- else if (src_timeout && src_timeout->getState() == simgrid::kernel::resource::Action::State::failed)
+ else if (src_timeout && src_timeout->get_state() == simgrid::kernel::resource::Action::State::failed)
state = SIMIX_SRC_HOST_FAILURE;
state = SIMIX_SRC_HOST_FAILURE;
- else if (dst_timeout && dst_timeout->getState() == simgrid::kernel::resource::Action::State::failed)
+ else if (dst_timeout && dst_timeout->get_state() == simgrid::kernel::resource::Action::State::failed)
state = SIMIX_DST_HOST_FAILURE;
state = SIMIX_DST_HOST_FAILURE;
- else if (surfAction_ && surfAction_->getState() == simgrid::kernel::resource::Action::State::failed) {
+ else if (surfAction_ && surfAction_->get_state() == simgrid::kernel::resource::Action::State::failed) {
state = SIMIX_LINK_FAILURE;
} else
state = SIMIX_DONE;
state = SIMIX_LINK_FAILURE;
} else
state = SIMIX_DONE;
void simgrid::kernel::activity::ExecImpl::setBound(double bound)
{
if (surfAction_)
void simgrid::kernel::activity::ExecImpl::setBound(double bound)
{
if (surfAction_)
- surfAction_->setBound(bound);
+ surfAction_->set_bound(bound);
}
void simgrid::kernel::activity::ExecImpl::post()
}
void simgrid::kernel::activity::ExecImpl::post()
/* If the host running the synchro failed, notice it. This way, the asking
* process can be killed if it runs on that host itself */
state = SIMIX_FAILED;
/* If the host running the synchro failed, notice it. This way, the asking
* process can be killed if it runs on that host itself */
state = SIMIX_FAILED;
- } else if (surfAction_->getState() == simgrid::kernel::resource::Action::State::failed) {
+ } else if (surfAction_->get_state() == simgrid::kernel::resource::Action::State::failed) {
/* If the host running the synchro didn't fail, then the synchro was canceled */
state = SIMIX_CANCELED;
/* If the host running the synchro didn't fail, then the synchro was canceled */
state = SIMIX_CANCELED;
- } else if (timeoutDetector && timeoutDetector->getState() == simgrid::kernel::resource::Action::State::done) {
+ } else if (timeoutDetector && timeoutDetector->get_state() == simgrid::kernel::resource::Action::State::done) {
state = SIMIX_TIMEOUT;
} else {
state = SIMIX_DONE;
state = SIMIX_TIMEOUT;
} else {
state = SIMIX_DONE;
simgrid::kernel::resource::Action* oldAction = this->surfAction_;
simgrid::kernel::resource::Action* newAction = to->pimpl_cpu->execution_start(oldAction->getCost());
newAction->setRemains(oldAction->getRemains());
simgrid::kernel::resource::Action* oldAction = this->surfAction_;
simgrid::kernel::resource::Action* newAction = to->pimpl_cpu->execution_start(oldAction->getCost());
newAction->setRemains(oldAction->getRemains());
- newAction->setData(this);
+ newAction->set_data(this);
newAction->setSharingWeight(oldAction->getPriority());
// 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.
newAction->setSharingWeight(oldAction->getPriority());
// 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.
- oldAction->setData(nullptr);
+ oldAction->set_data(nullptr);
oldAction->cancel();
oldAction->unref();
this->surfAction_ = newAction;
oldAction->cancel();
oldAction->unref();
this->surfAction_ = newAction;
simcalls.pop_front();
e_smx_state_t result;
simcalls.pop_front();
e_smx_state_t result;
- switch (surf_sleep->getState()) {
+ switch (surf_sleep->get_state()) {
case simgrid::kernel::resource::Action::State::failed:
simcall->issuer->context->iwannadie = 1;
result = SIMIX_SRC_HOST_FAILURE;
case simgrid::kernel::resource::Action::State::failed:
simcall->issuer->context->iwannadie = 1;
result = SIMIX_SRC_HOST_FAILURE;
- switch (surf_io->getState()) {
+ switch (surf_io->get_state()) {
case simgrid::kernel::resource::Action::State::failed:
state = SIMIX_FAILED;
break;
case simgrid::kernel::resource::Action::State::failed:
state = SIMIX_FAILED;
break;
void simgrid::kernel::activity::RawImpl::post()
{
XBT_IN("(%p)",this);
void simgrid::kernel::activity::RawImpl::post()
{
XBT_IN("(%p)",this);
- if (sleep->getState() == simgrid::kernel::resource::Action::State::failed)
+ if (sleep->get_state() == simgrid::kernel::resource::Action::State::failed)
- else if (sleep->getState() == simgrid::kernel::resource::Action::State::done)
+ else if (sleep->get_state() == simgrid::kernel::resource::Action::State::done)
state = SIMIX_SRC_TIMEOUT;
SIMIX_synchro_finish(this);
state = SIMIX_SRC_TIMEOUT;
SIMIX_synchro_finish(this);
&Constraint::saturated_constraint_set_hook>>
saturated_constraint_set;
&Constraint::saturated_constraint_set_hook>>
saturated_constraint_set;
- simgrid::kernel::resource::ActionLmmListPtr modified_set_ = nullptr;
+ simgrid::kernel::resource::Action::ModifiedSet* modified_set_ = nullptr;
void (*solve_fun)(lmm::System* self);
void (*solve_fun)(lmm::System* self);
}
Action::Action(simgrid::kernel::resource::Model* model, double cost, bool failed, kernel::lmm::Variable* var)
}
Action::Action(simgrid::kernel::resource::Model* model, double cost, bool failed, kernel::lmm::Variable* var)
- : remains_(cost), start_(surf_get_clock()), cost_(cost), model_(model), variable_(var)
+ : remains_(cost), start_time_(surf_get_clock()), cost_(cost), model_(model), variable_(var)
{
if (failed)
state_set_ = getModel()->getFailedActionSet();
{
if (failed)
state_set_ = getModel()->getFailedActionSet();
void Action::finish(Action::State state)
{
finish_time_ = surf_get_clock();
void Action::finish(Action::State state)
{
finish_time_ = surf_get_clock();
-Action::State Action::getState() const
+Action::State Action::get_state() const
{
if (state_set_ == model_->getReadyActionSet())
return Action::State::ready;
{
if (state_set_ == model_->getReadyActionSet())
return Action::State::ready;
return Action::State::not_in_the_system;
}
return Action::State::not_in_the_system;
}
-void Action::setState(Action::State state)
+void Action::set_state(Action::State state)
{
simgrid::xbt::intrusive_erase(*state_set_, *this);
switch (state) {
{
simgrid::xbt::intrusive_erase(*state_set_, *this);
switch (state) {
state_set_->push_back(*this);
}
state_set_->push_back(*this);
}
-double Action::getBound() const
+double Action::get_bound() const
{
return variable_ ? variable_->get_bound() : 0;
}
{
return variable_ ? variable_->get_bound() : 0;
}
-void Action::setBound(double bound)
+void Action::set_bound(double bound)
{
XBT_IN("(%p,%g)", this, bound);
if (variable_)
{
XBT_IN("(%p,%g)", this, bound);
if (variable_)
- setState(Action::State::failed);
+ set_state(Action::State::failed);
if (getModel()->getUpdateMechanism() == UM_LAZY) {
if (getModel()->getUpdateMechanism() == UM_LAZY) {
- if (modifiedSetHook_.is_linked())
+ if (modified_set_hook_.is_linked())
simgrid::xbt::intrusive_erase(*getModel()->getModifiedSet(), *this);
heapRemove(getModel()->getActionHeap());
}
simgrid::xbt::intrusive_erase(*getModel()->getModifiedSet(), *this);
heapRemove(getModel()->getActionHeap());
}
{
refcount_--;
if (not refcount_) {
{
refcount_--;
if (not refcount_) {
- if (stateSetHook_.is_linked())
+ if (state_set_hook_.is_linked())
simgrid::xbt::intrusive_erase(*state_set_, *this);
if (getVariable())
getModel()->getMaxminSystem()->variable_free(getVariable());
if (getModel()->getUpdateMechanism() == UM_LAZY) {
/* remove from heap */
heapRemove(getModel()->getActionHeap());
simgrid::xbt::intrusive_erase(*state_set_, *this);
if (getVariable())
getModel()->getMaxminSystem()->variable_free(getVariable());
if (getModel()->getUpdateMechanism() == UM_LAZY) {
/* remove from heap */
heapRemove(getModel()->getActionHeap());
- if (modifiedSetHook_.is_linked())
+ if (modified_set_hook_.is_linked())
simgrid::xbt::intrusive_erase(*getModel()->getModifiedSet(), *this);
}
delete this;
simgrid::xbt::intrusive_erase(*getModel()->getModifiedSet(), *this);
}
delete this;
-ActionLmmListPtr Model::getModifiedSet() const
+Action::ModifiedSet* Model::getModifiedSet() const
{
return maxmin_system_->modified_set_;
}
{
return maxmin_system_->modified_set_;
}
}
if ((action->getMaxDuration() > NO_MAX_DURATION) &&
}
if ((action->getMaxDuration() > NO_MAX_DURATION) &&
- (min <= -1 || action->getStartTime() + action->getMaxDuration() < min)) {
+ (min <= -1 || action->get_start_time() + action->getMaxDuration() < min)) {
// when the task will complete anyway because of the deadline if any
// when the task will complete anyway because of the deadline if any
- min = action->getStartTime() + action->getMaxDuration();
+ min = action->get_start_time() + action->getMaxDuration();
max_dur_flag = true;
}
XBT_DEBUG("Action(%p) corresponds to variable %d", action, action->getVariable()->id_int);
XBT_DEBUG("Action(%p) Start %f. May finish at %f (got a share of %f). Max_duration %f", action,
max_dur_flag = true;
}
XBT_DEBUG("Action(%p) corresponds to variable %d", action, action->getVariable()->id_int);
XBT_DEBUG("Action(%p) Start %f. May finish at %f (got a share of %f). Max_duration %f", action,
- action->getStartTime(), min, share, action->getMaxDuration());
+ action->get_start_time(), min, share, action->getMaxDuration());
if (min > -1) {
action->heapUpdate(action_heap_, min, max_dur_flag ? Action::Type::MAX_DURATION : Action::Type::NORMAL);
if (min > -1) {
action->heapUpdate(action_heap_, min, max_dur_flag ? Action::Type::MAX_DURATION : Action::Type::NORMAL);
XBT_CRITICAL("FIXME: need copy the state(?), %f", action_->getRemainsNoUpdate());
/* keep the bound value of the cpu action of the VM. */
XBT_CRITICAL("FIXME: need copy the state(?), %f", action_->getRemainsNoUpdate());
/* keep the bound value of the cpu action of the VM. */
- double old_bound = action_->getBound();
+ double old_bound = action_->get_bound();
if (old_bound > 0) {
XBT_DEBUG("migrate VM(%s): set bound (%f) at %s", vm_name, old_bound, pm_name_dst);
if (old_bound > 0) {
XBT_DEBUG("migrate VM(%s): set bound (%f) at %s", vm_name, old_bound, pm_name_dst);
- new_cpu_action->setBound(old_bound);
+ new_cpu_action->set_bound(old_bound);
}
XBT_ATTRIB_UNUSED int ret = action_->unref();
}
XBT_ATTRIB_UNUSED int ret = action_->unref();
void VirtualMachineImpl::setBound(double bound)
{
void VirtualMachineImpl::setBound(double bound)
{
- action_->setBound(bound);
+ action_->set_bound(bound);
/* let's see which tasks are done */
for (auto const& model : *all_existing_models) {
simgrid::kernel::resource::Action* action = surf_model_extract_done_action_set(model);
/* let's see which tasks are done */
for (auto const& model : *all_existing_models) {
simgrid::kernel::resource::Action* action = surf_model_extract_done_action_set(model);
- while (action != nullptr && action->getData() != nullptr) {
- SD_task_t task = static_cast<SD_task_t>(action->getData());
+ while (action != nullptr && action->get_data() != nullptr) {
+ SD_task_t task = static_cast<SD_task_t>(action->get_data());
XBT_VERB("Task '%s' done", SD_task_get_name(task));
SD_task_set_state(task, SD_DONE);
XBT_VERB("Task '%s' done", SD_task_get_name(task));
SD_task_set_state(task, SD_DONE);
/* let's see which tasks have just failed */
action = surf_model_extract_failed_action_set(model);
while (action != nullptr) {
/* let's see which tasks have just failed */
action = surf_model_extract_failed_action_set(model);
while (action != nullptr) {
- SD_task_t task = static_cast<SD_task_t>(action->getData());
+ SD_task_t task = static_cast<SD_task_t>(action->get_data());
XBT_VERB("Task '%s' failed", SD_task_get_name(task));
SD_task_set_state(task, SD_FAILED);
sd_global->return_set->insert(task);
XBT_VERB("Task '%s' failed", SD_task_get_name(task));
SD_task_set_state(task, SD_FAILED);
sd_global->return_set->insert(task);
if (new_state == SD_DONE || new_state == SD_FAILED){
sd_global->completed_tasks->insert(task);
if (new_state == SD_DONE || new_state == SD_FAILED){
sd_global->completed_tasks->insert(task);
- task->start_time = task->surf_action->getStartTime();
+ task->start_time = task->surf_action->get_start_time();
if (new_state == SD_DONE){
task->finish_time = task->surf_action->getFinishTime();
#if SIMGRID_HAVE_JEDULE
if (new_state == SD_DONE){
task->finish_time = task->surf_action->getFinishTime();
#if SIMGRID_HAVE_JEDULE
task->surf_action = surf_host_model->executeParallelTask(host_nb, hosts, flops_amount, bytes_amount, task->rate);
task->surf_action = surf_host_model->executeParallelTask(host_nb, hosts, flops_amount, bytes_amount, task->rate);
- task->surf_action->setData(task);
+ task->surf_action->set_data(task);
XBT_DEBUG("surf_action = %p", task->surf_action);
XBT_DEBUG("surf_action = %p", task->surf_action);
double SD_task_get_start_time(SD_task_t task)
{
if (task->surf_action)
double SD_task_get_start_time(SD_task_t task)
{
if (task->surf_action)
- return task->surf_action->getStartTime();
+ return task->surf_action->get_start_time();
else
return task->start_time;
}
else
return task->start_time;
}
simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
synchro->host = host;
synchro->surf_sleep = host->pimpl_cpu->sleep(duration);
simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
synchro->host = host;
synchro->surf_sleep = host->pimpl_cpu->sleep(duration);
- synchro->surf_sleep->setData(synchro);
+ synchro->surf_sleep->set_data(synchro);
XBT_DEBUG("Create sleep synchronization %p", synchro);
return synchro;
XBT_DEBUG("Create sleep synchronization %p", synchro);
return synchro;
simgrid::kernel::activity::ExecImplPtr exec =
boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
if (exec->surfAction_)
simgrid::kernel::activity::ExecImplPtr exec =
boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
if (exec->surfAction_)
- exec->surfAction_->setBound(bound);
+ exec->surfAction_->set_bound(bound);
XBT_DEBUG("Handling the processes whose action failed (if any)");
while ((action = surf_model_extract_failed_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
XBT_DEBUG("Handling the processes whose action failed (if any)");
while ((action = surf_model_extract_failed_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
- SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->getData()));
+ SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->get_data()));
}
XBT_DEBUG("Handling the processes whose action terminated normally (if any)");
while ((action = surf_model_extract_done_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
}
XBT_DEBUG("Handling the processes whose action terminated normally (if any)");
while ((action = surf_model_extract_done_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
- if (action->getData() == nullptr)
+ if (action->get_data() == nullptr)
XBT_DEBUG("probably vcpu's action %p, skip", action);
else
XBT_DEBUG("probably vcpu's action %p, skip", action);
else
- SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->getData()));
+ SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->get_data()));
if (not MC_is_active() && not MC_record_replay_is_active()) {
exec->surfAction_ = host->pimpl_cpu->execution_start(flops_amount);
if (not MC_is_active() && not MC_record_replay_is_active()) {
exec->surfAction_ = host->pimpl_cpu->execution_start(flops_amount);
- exec->surfAction_->setData(exec.get());
+ exec->surfAction_->set_data(exec.get());
exec->surfAction_->setSharingWeight(priority);
if (bound > 0)
exec->surfAction_->setSharingWeight(priority);
if (bound > 0)
- static_cast<simgrid::surf::CpuAction*>(exec->surfAction_)->setBound(bound);
+ static_cast<simgrid::surf::CpuAction*>(exec->surfAction_)->set_bound(bound);
}
XBT_DEBUG("Create execute synchro %p: %s", exec.get(), exec->name.c_str());
}
XBT_DEBUG("Create execute synchro %p: %s", exec.get(), exec->name.c_str());
sg_host_t* host_list_cpy = new sg_host_t[host_nb];
std::copy_n(host_list, host_nb, host_list_cpy);
exec->surfAction_ = surf_host_model->executeParallelTask(host_nb, host_list_cpy, flops_amount, bytes_amount, rate);
sg_host_t* host_list_cpy = new sg_host_t[host_nb];
std::copy_n(host_list, host_nb, host_list_cpy);
exec->surfAction_ = surf_host_model->executeParallelTask(host_nb, host_list_cpy, flops_amount, bytes_amount, rate);
- exec->surfAction_->setData(exec.get());
+ exec->surfAction_->set_data(exec.get());
if (timeout > 0) {
exec->timeoutDetector = host_list[0]->pimpl_cpu->sleep(timeout);
if (timeout > 0) {
exec->timeoutDetector = host_list[0]->pimpl_cpu->sleep(timeout);
- exec->timeoutDetector->setData(exec.get());
+ exec->timeoutDetector->set_data(exec.get());
}
}
XBT_DEBUG("Create parallel execute synchro %p", exec.get());
}
}
XBT_DEBUG("Create parallel execute synchro %p", exec.get());
simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
synchro->surf_io = st->read(size);
simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
synchro->surf_io = st->read(size);
- synchro->surf_io->setData(synchro);
+ synchro->surf_io->set_data(synchro);
XBT_DEBUG("Create io synchro %p", synchro);
return synchro;
XBT_DEBUG("Create io synchro %p", synchro);
return synchro;
{
simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
synchro->surf_io = st->write(size);
{
simgrid::kernel::activity::IoImpl* synchro = new simgrid::kernel::activity::IoImpl();
synchro->surf_io = st->write(size);
- synchro->surf_io->setData(synchro);
+ synchro->surf_io->set_data(synchro);
XBT_DEBUG("Create io synchro %p", synchro);
return synchro;
XBT_DEBUG("Create io synchro %p", synchro);
return synchro;
} else { /* we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host
fails */
simgrid::kernel::resource::Action* sleep = simcall->issuer->host->pimpl_cpu->sleep(timeout);
} else { /* we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host
fails */
simgrid::kernel::resource::Action* sleep = simcall->issuer->host->pimpl_cpu->sleep(timeout);
- sleep->setData(synchro.get());
+ sleep->set_data(synchro.get());
simgrid::kernel::activity::CommImplPtr comm =
boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
simgrid::kernel::activity::CommImplPtr comm =
boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
simgrid::s4u::Host* receiver = comm->dst_proc->host;
comm->surfAction_ = surf_network_model->communicate(sender, receiver, comm->task_size, comm->rate);
simgrid::s4u::Host* receiver = comm->dst_proc->host;
comm->surfAction_ = surf_network_model->communicate(sender, receiver, comm->task_size, comm->rate);
- comm->surfAction_->setData(comm.get());
+ comm->surfAction_->set_data(comm.get());
comm->state = SIMIX_RUNNING;
XBT_DEBUG("Starting communication %p from '%s' to '%s' (surf_action: %p)", comm.get(), sender->getCname(),
receiver->getCname(), comm->surfAction_);
/* If a link is failed, detect it immediately */
comm->state = SIMIX_RUNNING;
XBT_DEBUG("Starting communication %p from '%s' to '%s' (surf_action: %p)", comm.get(), sender->getCname(),
receiver->getCname(), comm->surfAction_);
/* If a link is failed, detect it immediately */
- if (comm->surfAction_->getState() == simgrid::kernel::resource::Action::State::failed) {
+ if (comm->surfAction_->get_state() == simgrid::kernel::resource::Action::State::failed) {
XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure", sender->getCname(),
receiver->getCname());
comm->state = SIMIX_LINK_FAILURE;
XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure", sender->getCname(),
receiver->getCname());
comm->state = SIMIX_LINK_FAILURE;
simgrid::kernel::activity::RawImplPtr sync =
simgrid::kernel::activity::RawImplPtr(new simgrid::kernel::activity::RawImpl());
sync->sleep = smx_host->pimpl_cpu->sleep(timeout);
simgrid::kernel::activity::RawImplPtr sync =
simgrid::kernel::activity::RawImplPtr(new simgrid::kernel::activity::RawImpl());
sync->sleep = smx_host->pimpl_cpu->sleep(timeout);
- sync->sleep->setData(sync.get());
+ sync->sleep->set_data(sync.get());
XBT_OUT();
return sync;
}
XBT_OUT();
return sync;
}
/**********
* Action *
**********/
/**********
* Action *
**********/
-void StorageAction::setState(Action::State state)
+void StorageAction::set_state(Action::State state)
- Action::State old = getState();
- Action::setState(state);
+ Action::State old = get_state();
+ Action::set_state(state);
storageActionStateChangedCallbacks(this, old, state);
}
}
storageActionStateChangedCallbacks(this, old, state);
}
}
StorageImpl* storage, e_surf_action_storage_type_t type)
: Action(model, cost, failed, var), type_(type), storage_(storage){};
StorageImpl* storage, e_surf_action_storage_type_t type)
: Action(model, cost, failed, var), type_(type), storage_(storage){};
- void setState(simgrid::kernel::resource::Action::State state) override;
+ void set_state(simgrid::kernel::resource::Action::State state) override;
e_surf_action_storage_type_t type_;
StorageImpl* storage_;
e_surf_action_storage_type_t type_;
StorageImpl* storage_;
maxmin_system_ = new simgrid::kernel::lmm::System(select);
if (getUpdateMechanism() == UM_LAZY)
maxmin_system_ = new simgrid::kernel::lmm::System(select);
if (getUpdateMechanism() == UM_LAZY)
- maxmin_system_->modified_set_ = new kernel::resource::ActionLmmList();
+ maxmin_system_->modified_set_ = new kernel::resource::Action::ModifiedSet();
}
CpuCas01Model::~CpuCas01Model()
}
CpuCas01Model::~CpuCas01Model()
while ((var = cnst->get_variable(&elem))) {
kernel::resource::Action* action = static_cast<kernel::resource::Action*>(var->get_id());
while ((var = cnst->get_variable(&elem))) {
kernel::resource::Action* action = static_cast<kernel::resource::Action*>(var->get_id());
- if (action->getState() == kernel::resource::Action::State::running ||
- action->getState() == kernel::resource::Action::State::ready ||
- action->getState() == kernel::resource::Action::State::not_in_the_system) {
+ if (action->get_state() == kernel::resource::Action::State::running ||
+ action->get_state() == kernel::resource::Action::State::ready ||
+ action->get_state() == kernel::resource::Action::State::not_in_the_system) {
action->setFinishTime(date);
action->setFinishTime(date);
- action->setState(kernel::resource::Action::State::failed);
+ action->set_state(kernel::resource::Action::State::failed);
if (duration < 0) { // NO_MAX_DURATION
/* Move to the *end* of the corresponding action set. This convention is used to speed up update_resource_state */
simgrid::xbt::intrusive_erase(*action->getStateSet(), *action);
if (duration < 0) { // NO_MAX_DURATION
/* Move to the *end* of the corresponding action set. This convention is used to speed up update_resource_state */
simgrid::xbt::intrusive_erase(*action->getStateSet(), *action);
- action->state_set_ = &static_cast<CpuCas01Model*>(model())->p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
+ action->state_set_ = &static_cast<CpuCas01Model*>(model())->cpuRunningActionSetThatDoesNotNeedBeingChecked_;
action->getStateSet()->push_back(*action);
}
action->getStateSet()->push_back(*action);
}
~CpuCas01Model() override;
Cpu *createCpu(simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core) override;
~CpuCas01Model() override;
Cpu *createCpu(simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core) override;
- kernel::resource::ActionList p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
+ kernel::resource::Action::StateSet cpuRunningActionSetThatDoesNotNeedBeingChecked_;
simgrid::xbt::signal<void(simgrid::surf::CpuAction*, kernel::resource::Action::State)> CpuAction::onStateChange;
void CpuAction::suspend(){
simgrid::xbt::signal<void(simgrid::surf::CpuAction*, kernel::resource::Action::State)> CpuAction::onStateChange;
void CpuAction::suspend(){
- Action::State previous = getState();
+ Action::State previous = get_state();
onStateChange(this, previous);
Action::suspend();
}
void CpuAction::resume(){
onStateChange(this, previous);
Action::suspend();
}
void CpuAction::resume(){
- Action::State previous = getState();
+ Action::State previous = get_state();
onStateChange(this, previous);
Action::resume();
}
onStateChange(this, previous);
Action::resume();
}
-void CpuAction::setState(Action::State state){
- Action::State previous = getState();
- Action::setState(state);
+void CpuAction::set_state(Action::State state)
+{
+ Action::State previous = get_state();
+ Action::set_state(state);
onStateChange(this, previous);
}
/** @brief returns a list of all CPUs that this action is using */
onStateChange(this, previous);
}
/** @brief returns a list of all CPUs that this action is using */
- void setState(simgrid::kernel::resource::Action::State state) override;
+ void set_state(simgrid::kernel::resource::Action::State state) override;
void updateRemainingLazy(double now) override;
std::list<Cpu*> cpus();
void updateRemainingLazy(double now) override;
std::list<Cpu*> cpus();
/* put all action running on cpu to failed */
for (CpuTiAction& action : actionSet_) {
/* put all action running on cpu to failed */
for (CpuTiAction& action : actionSet_) {
- if (action.getState() == kernel::resource::Action::State::running ||
- action.getState() == kernel::resource::Action::State::ready ||
- action.getState() == kernel::resource::Action::State::not_in_the_system) {
+ if (action.get_state() == kernel::resource::Action::State::running ||
+ action.get_state() == kernel::resource::Action::State::ready ||
+ action.get_state() == kernel::resource::Action::State::not_in_the_system) {
action.setFinishTime(date);
action.setFinishTime(date);
- action.setState(kernel::resource::Action::State::failed);
+ action.set_state(kernel::resource::Action::State::failed);
action.heapRemove(model()->getActionHeap());
}
}
action.heapRemove(model()->getActionHeap());
}
}
action.setFinishTime(speedIntegratedTrace_->solve(now, total_area));
/* verify which event will happen before (max_duration or finish time) */
if (action.getMaxDuration() > NO_MAX_DURATION &&
action.setFinishTime(speedIntegratedTrace_->solve(now, total_area));
/* verify which event will happen before (max_duration or finish time) */
if (action.getMaxDuration() > NO_MAX_DURATION &&
- action.getStartTime() + action.getMaxDuration() < action.getFinishTime())
- min_finish = action.getStartTime() + action.getMaxDuration();
+ action.get_start_time() + action.getMaxDuration() < action.getFinishTime())
+ min_finish = action.get_start_time() + action.getMaxDuration();
else
min_finish = action.getFinishTime();
} else {
/* put the max duration time on heap */
if (action.getMaxDuration() > NO_MAX_DURATION)
else
min_finish = action.getFinishTime();
} else {
/* put the max duration time on heap */
if (action.getMaxDuration() > NO_MAX_DURATION)
- min_finish = action.getStartTime() + action.getMaxDuration();
+ min_finish = action.get_start_time() + action.getMaxDuration();
}
/* add in action heap */
if (min_finish > NO_MAX_DURATION)
}
/* add in action heap */
if (min_finish > NO_MAX_DURATION)
action.heapRemove(model()->getActionHeap());
XBT_DEBUG("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f", getCname(),
action.heapRemove(model()->getActionHeap());
XBT_DEBUG("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f", getCname(),
- &action, action.getStartTime(), action.getFinishTime(), action.getMaxDuration());
+ &action, action.get_start_time(), action.getFinishTime(), action.getMaxDuration());
}
/* remove from modified cpu */
modified(false);
}
/* remove from modified cpu */
modified(false);
continue;
/* action don't need update */
continue;
/* action don't need update */
- if (action.getStartTime() >= now)
+ if (action.get_start_time() >= now)
continue;
/* skip action that are finishing now */
continue;
/* skip action that are finishing now */
-void CpuTiAction::setState(Action::State state)
+void CpuTiAction::set_state(Action::State state)
- CpuAction::setState(state);
+ CpuAction::set_state(state);
{
refcount_--;
if (not refcount_) {
{
refcount_--;
if (not refcount_) {
- if (stateSetHook_.is_linked())
+ if (state_set_hook_.is_linked())
simgrid::xbt::intrusive_erase(*getStateSet(), *this);
/* remove from action_set */
if (action_ti_hook.is_linked())
simgrid::xbt::intrusive_erase(*getStateSet(), *this);
/* remove from action_set */
if (action_ti_hook.is_linked())
void CpuTiAction::cancel()
{
void CpuTiAction::cancel()
{
- this->setState(Action::State::failed);
+ this->set_state(Action::State::failed);
heapRemove(getModel()->getActionHeap());
cpu_->modified(true);
}
heapRemove(getModel()->getActionHeap());
cpu_->modified(true);
}
Action::setMaxDuration(duration);
if (duration >= 0)
Action::setMaxDuration(duration);
if (duration >= 0)
- min_finish = (getStartTime() + getMaxDuration()) < getFinishTime() ?
- (getStartTime() + getMaxDuration()) : getFinishTime();
+ min_finish = (get_start_time() + getMaxDuration()) < getFinishTime() ? (get_start_time() + getMaxDuration())
+ : getFinishTime();
else
min_finish = getFinishTime();
else
min_finish = getFinishTime();
public:
CpuTiAction(CpuTiModel *model, double cost, bool failed, CpuTi *cpu);
public:
CpuTiAction(CpuTiModel *model, double cost, bool failed, CpuTi *cpu);
- void setState(simgrid::kernel::resource::Action::State state) override;
+ void set_state(simgrid::kernel::resource::Action::State state) override;
int unref() override;
void cancel() override;
void suspend() override;
int unref() override;
void cancel() override;
void suspend() override;
double nextOccuringEvent(double now) override;
void updateActionsState(double now, double delta) override;
double nextOccuringEvent(double now) override;
void updateActionsState(double now, double delta) override;
- kernel::resource::ActionList runningActionSetThatDoesNotNeedBeingChecked_;
+ kernel::resource::Action::StateSet runningActionSetThatDoesNotNeedBeingChecked_;
CpuTiList modifiedCpu_;
};
CpuTiList modifiedCpu_;
};
loopback_ = NetworkCm02Model::createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
if (getUpdateMechanism() == UM_LAZY)
loopback_ = NetworkCm02Model::createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
if (getUpdateMechanism() == UM_LAZY)
- maxmin_system_->modified_set_ = new kernel::resource::ActionLmmList();
+ maxmin_system_->modified_set_ = new kernel::resource::Action::ModifiedSet();
}
NetworkCm02Model::NetworkCm02Model(void (*specificSolveFun)(kernel::lmm::System* self)) : NetworkCm02Model()
}
NetworkCm02Model::NetworkCm02Model(void (*specificSolveFun)(kernel::lmm::System* self)) : NetworkCm02Model()
while ((var = constraint()->get_variable(&elem))) {
kernel::resource::Action* action = static_cast<kernel::resource::Action*>(var->get_id());
while ((var = constraint()->get_variable(&elem))) {
kernel::resource::Action* action = static_cast<kernel::resource::Action*>(var->get_id());
- if (action->getState() == kernel::resource::Action::State::running ||
- action->getState() == kernel::resource::Action::State::ready) {
+ if (action->get_state() == kernel::resource::Action::State::running ||
+ action->get_state() == kernel::resource::Action::State::ready) {
action->setFinishTime(now);
action->setFinishTime(now);
- action->setState(kernel::resource::Action::State::failed);
+ action->set_state(kernel::resource::Action::State::failed);
using simgrid::surf::NetworkIBModel;
using simgrid::surf::IBNode;
using simgrid::surf::NetworkIBModel;
using simgrid::surf::IBNode;
- if (action->getState() != simgrid::kernel::resource::Action::State::done)
+ if (action->get_state() != simgrid::kernel::resource::Action::State::done)
return;
std::pair<IBNode*,IBNode*> pair = ((NetworkIBModel*)surf_network_model)->active_comms[action];
XBT_DEBUG("IB callback - action %p finished", action);
return;
std::pair<IBNode*,IBNode*> pair = ((NetworkIBModel*)surf_network_model)->active_comms[action];
XBT_DEBUG("IB callback - action %p finished", action);
double penalty = std::max(my_penalty_in, max_penalty_out);
double penalty = std::max(my_penalty_in, max_penalty_out);
- double rate_before_update = (*it)->action->getBound();
+ double rate_before_update = (*it)->action->get_bound();
// save initial rate of the action
if ((*it)->init_rate == -1)
(*it)->init_rate = rate_before_update;
// save initial rate of the action
if ((*it)->init_rate == -1)
(*it)->init_rate = rate_before_update;
if (not double_equals(penalized_bw, rate_before_update, sg_surf_precision)) {
XBT_DEBUG("%d->%d action %p penalty updated : bw now %f, before %f , initial rate %f", root->id,
if (not double_equals(penalized_bw, rate_before_update, sg_surf_precision)) {
XBT_DEBUG("%d->%d action %p penalty updated : bw now %f, before %f , initial rate %f", root->id,
- (*it)->destination->id, (*it)->action, penalized_bw, (*it)->action->getBound(), (*it)->init_rate);
+ (*it)->destination->id, (*it)->action, penalized_bw, (*it)->action->get_bound(), (*it)->init_rate);
maxmin_system_->update_variable_bound((*it)->action->getVariable(), penalized_bw);
} else {
XBT_DEBUG("%d->%d action %p penalty not updated : bw %f, initial rate %f", root->id, (*it)->destination->id,
maxmin_system_->update_variable_bound((*it)->action->getVariable(), penalized_bw);
} else {
XBT_DEBUG("%d->%d action %p penalty not updated : bw %f, initial rate %f", root->id, (*it)->destination->id,
- void NetworkAction::setState(Action::State state)
+ void NetworkAction::set_state(Action::State state)
- Action::setState(state);
+ Action::set_state(state);
s4u::Link::onCommunicationStateChange(this);
}
s4u::Link::onCommunicationStateChange(this);
}
NetworkAction(simgrid::kernel::resource::Model* model, double cost, bool failed, kernel::lmm::Variable* var)
: simgrid::kernel::resource::Action(model, cost, failed, var){};
NetworkAction(simgrid::kernel::resource::Model* model, double cost, bool failed, kernel::lmm::Variable* var)
: simgrid::kernel::resource::Action(model, cost, failed, var){};
- void setState(simgrid::kernel::resource::Action::State state) override;
+ void set_state(simgrid::kernel::resource::Action::State state) override;
virtual std::list<LinkImpl*> links();
double latency_ = {};
virtual std::list<LinkImpl*> links();
double latency_ = {};
XBT_DEBUG("Processing socket %p (action %p)",sgFlow,action);
action->setRemains(action->getCost() - sgFlow->sentBytes_);
XBT_DEBUG("Processing socket %p (action %p)",sgFlow,action);
action->setRemains(action->getCost() - sgFlow->sentBytes_);
- if (TRACE_is_enabled() && action->getState() == kernel::resource::Action::State::running) {
+ if (TRACE_is_enabled() && action->get_state() == kernel::resource::Action::State::running) {
double data_delta_sent = sgFlow->sentBytes_ - action->lastSent_;
std::vector<LinkImpl*> route = std::vector<LinkImpl*>();
double data_delta_sent = sgFlow->sentBytes_ - action->lastSent_;
std::vector<LinkImpl*> route = std::vector<LinkImpl*>();
{
refcount_--;
if (not refcount_) {
{
refcount_--;
if (not refcount_) {
- if (stateSetHook_.is_linked())
+ if (state_set_hook_.is_linked())
simgrid::xbt::intrusive_erase(*state_set_, *this);
XBT_DEBUG ("Removing action %p", this);
delete this;
simgrid::xbt::intrusive_erase(*state_set_, *this);
XBT_DEBUG ("Removing action %p", this);
delete this;
const L07Action& net_action = static_cast<const L07Action&>(action);
if (net_action.latency_ > 0 && (min < 0 || net_action.latency_ < min)) {
min = net_action.latency_;
const L07Action& net_action = static_cast<const L07Action&>(action);
if (net_action.latency_ > 0 && (min < 0 || net_action.latency_ < min)) {
min = net_action.latency_;
- XBT_DEBUG("Updating min with %p (start %f): %f", &net_action, net_action.getStartTime(), min);
+ XBT_DEBUG("Updating min with %p (start %f): %f", &net_action, net_action.get_start_time(), min);
}
}
XBT_DEBUG("min value: %f", min);
}
}
XBT_DEBUG("min value: %f", min);
{
refcount_--;
if (not refcount_) {
{
refcount_--;
if (not refcount_) {
- if (stateSetHook_.is_linked())
+ if (state_set_hook_.is_linked())
simgrid::xbt::intrusive_erase(*state_set_, *this);
if (getVariable())
getModel()->getMaxminSystem()->variable_free(getVariable());
simgrid::xbt::intrusive_erase(*state_set_, *this);
if (getVariable())
getModel()->getMaxminSystem()->variable_free(getVariable());
{
refcount_--;
if (not refcount_) {
{
refcount_--;
if (not refcount_) {
- if (stateSetHook_.is_linked())
+ if (state_set_hook_.is_linked())
simgrid::xbt::intrusive_erase(*state_set_, *this);
if (getVariable())
getModel()->getMaxminSystem()->variable_free(getVariable());
simgrid::xbt::intrusive_erase(*state_set_, *this);
if (getVariable())
getModel()->getMaxminSystem()->variable_free(getVariable());
void StorageN11Action::cancel()
{
void StorageN11Action::cancel()
{
- setState(Action::State::failed);
+ set_state(Action::State::failed);
}
void StorageN11Action::suspend()
}
void StorageN11Action::suspend()
/*********
* MODEL *
*********/
/*********
* MODEL *
*********/
-static simgrid::kernel::resource::Action* ActionListExtract(simgrid::kernel::resource::ActionList* list)
+static simgrid::kernel::resource::Action* ActionListExtract(simgrid::kernel::resource::Action::StateSet* list)
{
if (list->empty())
return nullptr;
{
if (list->empty())
return nullptr;
void surf_cpu_action_set_bound(simgrid::kernel::resource::Action* action, double bound)
{
void surf_cpu_action_set_bound(simgrid::kernel::resource::Action* action, double bound)
{
- static_cast<simgrid::surf::CpuAction*>(action)->setBound(bound);
+ static_cast<simgrid::surf::CpuAction*>(action)->set_bound(bound);
simgrid::kernel::resource::Action* actionB = hostB->pimpl_cpu->execution_start(1000.0);
simgrid::kernel::resource::Action* actionC = hostB->pimpl_cpu->sleep(7.32);
simgrid::kernel::resource::Action* actionB = hostB->pimpl_cpu->execution_start(1000.0);
simgrid::kernel::resource::Action* actionC = hostB->pimpl_cpu->sleep(7.32);
- simgrid::kernel::resource::Action::State stateActionA = actionA->getState();
- simgrid::kernel::resource::Action::State stateActionB = actionB->getState();
- simgrid::kernel::resource::Action::State stateActionC = actionC->getState();
+ simgrid::kernel::resource::Action::State stateActionA = actionA->get_state();
+ simgrid::kernel::resource::Action::State stateActionB = actionB->get_state();
+ simgrid::kernel::resource::Action::State stateActionC = actionC->get_state();
/* And just look at the state of these tasks */
XBT_INFO("actionA state: %s", string_action(stateActionA));
/* And just look at the state of these tasks */
XBT_INFO("actionA state: %s", string_action(stateActionA));
XBT_INFO("Next Event : %g", surf_get_clock());
XBT_DEBUG("\t CPU actions");
XBT_INFO("Next Event : %g", surf_get_clock());
XBT_DEBUG("\t CPU actions");
- simgrid::kernel::resource::ActionList* action_list = surf_cpu_model_pm->getFailedActionSet();
+ simgrid::kernel::resource::Action::StateSet* action_list = surf_cpu_model_pm->getFailedActionSet();
while (not action_list->empty()) {
simgrid::kernel::resource::Action& action = action_list->front();
XBT_INFO(" CPU Failed action");
while (not action_list->empty()) {
simgrid::kernel::resource::Action& action = action_list->front();
XBT_INFO(" CPU Failed action");