From 6ca0df6f5bb17b5708c11a19846c0e90e25b7889 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 25 Mar 2018 18:49:37 +0200 Subject: [PATCH] snake_case some resource::Action fields and cleanups - 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) --- include/simgrid/kernel/resource/Action.hpp | 54 ++++++++++------------ include/simgrid/kernel/resource/Model.hpp | 18 ++++---- src/kernel/activity/CommImpl.cpp | 10 ++-- src/kernel/activity/ExecImpl.cpp | 10 ++-- src/kernel/activity/SleepImpl.cpp | 2 +- src/kernel/activity/SynchroIo.cpp | 2 +- src/kernel/activity/SynchroRaw.cpp | 4 +- src/kernel/lmm/maxmin.hpp | 2 +- src/kernel/resource/Action.cpp | 20 ++++---- src/kernel/resource/Model.cpp | 8 ++-- src/plugins/vm/VirtualMachineImpl.cpp | 6 +-- src/simdag/sd_global.cpp | 6 +-- src/simdag/sd_task.cpp | 6 +-- src/simix/ActorImpl.cpp | 2 +- src/simix/libsmx.cpp | 2 +- src/simix/smx_global.cpp | 6 +-- src/simix/smx_host.cpp | 8 ++-- src/simix/smx_io.cpp | 4 +- src/simix/smx_network.cpp | 6 +-- src/simix/smx_synchro.cpp | 2 +- src/surf/StorageImpl.cpp | 6 +-- src/surf/StorageImpl.hpp | 2 +- src/surf/cpu_cas01.cpp | 12 ++--- src/surf/cpu_cas01.hpp | 2 +- src/surf/cpu_interface.cpp | 11 +++-- src/surf/cpu_interface.hpp | 2 +- src/surf/cpu_ti.cpp | 30 ++++++------ src/surf/cpu_ti.hpp | 4 +- src/surf/network_cm02.cpp | 8 ++-- src/surf/network_ib.cpp | 6 +-- src/surf/network_interface.cpp | 4 +- src/surf/network_interface.hpp | 2 +- src/surf/network_ns3.cpp | 4 +- src/surf/ptask_L07.cpp | 4 +- src/surf/storage_n11.cpp | 4 +- src/surf/surf_c_bindings.cpp | 4 +- teshsuite/surf/surf_usage/surf_usage.cpp | 8 ++-- 37 files changed, 143 insertions(+), 148 deletions(-) diff --git a/include/simgrid/kernel/resource/Action.hpp b/include/simgrid/kernel/resource/Action.hpp index 39a2a07525..47efce3305 100644 --- a/include/simgrid/kernel/resource/Action.hpp +++ b/include/simgrid/kernel/resource/Action.hpp @@ -24,23 +24,20 @@ typedef boost::heap::pairing_heap>> 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: - 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::modifiedSetHook_> - ActionLmmOptions; - typedef boost::intrusive::list ActionLmmList; - - boost::intrusive::list_member_hook<> stateSetHook_; - typedef boost::intrusive::member_hook, &Action::stateSetHook_> - ActionOptions; - typedef boost::intrusive::list 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::modified_set_hook_>> + ModifiedSet; + + boost::intrusive::list_member_hook<> state_set_hook_; + typedef boost::intrusive::list< + Action, boost::intrusive::member_hook, &Action::state_set_hook_>> + StateSet; enum class State { ready = 0, /**< Ready */ @@ -66,7 +63,7 @@ public: * @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 @@ -76,7 +73,7 @@ public: * @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); virtual ~Action(); @@ -88,24 +85,24 @@ public: 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 */ - virtual void setState(Action::State state); + virtual void set_state(Action::State state); /** @brief Get the bound of the current Action */ - double getBound() const; + double get_bound() const; /** @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 */ - 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 */ - void* getData() const { return data_; } + void* get_data() const { return data_; } /** @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_; } @@ -166,19 +163,19 @@ public: 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: - ActionList* state_set_; + StateSet* 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 */ - 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 */ @@ -212,9 +209,6 @@ protected: 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 diff --git a/include/simgrid/kernel/resource/Model.hpp b/include/simgrid/kernel/resource/Model.hpp index 5de68af026..541bbd90c2 100644 --- a/include/simgrid/kernel/resource/Model.hpp +++ b/include/simgrid/kernel/resource/Model.hpp @@ -35,19 +35,19 @@ public: 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 */ - 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 */ - 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 */ - ActionList* getDoneActionSet() const { return done_action_set_; } + Action::StateSet* getDoneActionSet() const { return done_action_set_; } /** @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_; } @@ -98,10 +98,10 @@ protected: 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_; }; diff --git a/src/kernel/activity/CommImpl.cpp b/src/kernel/activity/CommImpl.cpp index 954704f7ef..bbcce11406 100644 --- a/src/kernel/activity/CommImpl.cpp +++ b/src/kernel/activity/CommImpl.cpp @@ -97,15 +97,15 @@ void simgrid::kernel::activity::CommImpl::cleanupSurf() 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; - 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; - 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; - 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; - 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; diff --git a/src/kernel/activity/ExecImpl.cpp b/src/kernel/activity/ExecImpl.cpp index 9f2c2057f5..e5eba51088 100644 --- a/src/kernel/activity/ExecImpl.cpp +++ b/src/kernel/activity/ExecImpl.cpp @@ -66,7 +66,7 @@ double simgrid::kernel::activity::ExecImpl::remainingRatio() void simgrid::kernel::activity::ExecImpl::setBound(double bound) { if (surfAction_) - surfAction_->setBound(bound); + surfAction_->set_bound(bound); } void simgrid::kernel::activity::ExecImpl::post() @@ -75,10 +75,10 @@ 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; - } 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; - } 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; @@ -107,13 +107,13 @@ simgrid::kernel::activity::ExecImpl::migrate(simgrid::s4u::Host* to) 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. - oldAction->setData(nullptr); + oldAction->set_data(nullptr); oldAction->cancel(); oldAction->unref(); this->surfAction_ = newAction; diff --git a/src/kernel/activity/SleepImpl.cpp b/src/kernel/activity/SleepImpl.cpp index ec7d083def..054d467e47 100644 --- a/src/kernel/activity/SleepImpl.cpp +++ b/src/kernel/activity/SleepImpl.cpp @@ -32,7 +32,7 @@ void simgrid::kernel::activity::SleepImpl::post() 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; diff --git a/src/kernel/activity/SynchroIo.cpp b/src/kernel/activity/SynchroIo.cpp index 33b8c68b9f..3f4e149771 100644 --- a/src/kernel/activity/SynchroIo.cpp +++ b/src/kernel/activity/SynchroIo.cpp @@ -35,7 +35,7 @@ void simgrid::kernel::activity::IoImpl::post() } } - switch (surf_io->getState()) { + switch (surf_io->get_state()) { case simgrid::kernel::resource::Action::State::failed: state = SIMIX_FAILED; break; diff --git a/src/kernel/activity/SynchroRaw.cpp b/src/kernel/activity/SynchroRaw.cpp index e0911fef61..b9e089e208 100644 --- a/src/kernel/activity/SynchroRaw.cpp +++ b/src/kernel/activity/SynchroRaw.cpp @@ -27,9 +27,9 @@ void simgrid::kernel::activity::RawImpl::resume() 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) state = SIMIX_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); diff --git a/src/kernel/lmm/maxmin.hpp b/src/kernel/lmm/maxmin.hpp index 65a2cd186e..f5006fcb42 100644 --- a/src/kernel/lmm/maxmin.hpp +++ b/src/kernel/lmm/maxmin.hpp @@ -601,7 +601,7 @@ public: &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); diff --git a/src/kernel/resource/Action.cpp b/src/kernel/resource/Action.cpp index a7d037a786..4281441afb 100644 --- a/src/kernel/resource/Action.cpp +++ b/src/kernel/resource/Action.cpp @@ -20,7 +20,7 @@ Action::Action(simgrid::kernel::resource::Model* model, double cost, bool failed } 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(); @@ -38,10 +38,10 @@ Action::~Action() void Action::finish(Action::State state) { finish_time_ = surf_get_clock(); - setState(state); + set_state(state); } -Action::State Action::getState() const +Action::State Action::get_state() const { if (state_set_ == model_->getReadyActionSet()) return Action::State::ready; @@ -54,7 +54,7 @@ Action::State Action::getState() const 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) { @@ -78,12 +78,12 @@ void Action::setState(Action::State state) state_set_->push_back(*this); } -double Action::getBound() const +double Action::get_bound() const { 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_) @@ -124,9 +124,9 @@ void Action::setSharingWeight(double weight) void Action::cancel() { - setState(Action::State::failed); + set_state(Action::State::failed); 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()); } @@ -136,14 +136,14 @@ int Action::unref() { 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()); - if (modifiedSetHook_.is_linked()) + if (modified_set_hook_.is_linked()) simgrid::xbt::intrusive_erase(*getModel()->getModifiedSet(), *this); } delete this; diff --git a/src/kernel/resource/Model.cpp b/src/kernel/resource/Model.cpp index 7354c6ea42..4252b66645 100644 --- a/src/kernel/resource/Model.cpp +++ b/src/kernel/resource/Model.cpp @@ -31,7 +31,7 @@ Action* Model::actionHeapPop() return action; } -ActionLmmListPtr Model::getModifiedSet() const +Action::ModifiedSet* Model::getModifiedSet() const { return maxmin_system_->modified_set_; } @@ -81,16 +81,16 @@ double Model::nextOccuringEventLazy(double now) } 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 - 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, - 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); diff --git a/src/plugins/vm/VirtualMachineImpl.cpp b/src/plugins/vm/VirtualMachineImpl.cpp index 69070f01d2..7530cd26ff 100644 --- a/src/plugins/vm/VirtualMachineImpl.cpp +++ b/src/plugins/vm/VirtualMachineImpl.cpp @@ -263,10 +263,10 @@ void VirtualMachineImpl::setPm(s4u::Host* destination) 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); - new_cpu_action->setBound(old_bound); + new_cpu_action->set_bound(old_bound); } XBT_ATTRIB_UNUSED int ret = action_->unref(); @@ -279,7 +279,7 @@ void VirtualMachineImpl::setPm(s4u::Host* destination) void VirtualMachineImpl::setBound(double bound) { - action_->setBound(bound); + action_->set_bound(bound); } } diff --git a/src/simdag/sd_global.cpp b/src/simdag/sd_global.cpp index 24034d4d3d..1a31386a8d 100644 --- a/src/simdag/sd_global.cpp +++ b/src/simdag/sd_global.cpp @@ -58,8 +58,8 @@ std::set* simulate(double how_long){ /* 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(action->getData()); + while (action != nullptr && action->get_data() != nullptr) { + SD_task_t task = static_cast(action->get_data()); XBT_VERB("Task '%s' done", SD_task_get_name(task)); SD_task_set_state(task, SD_DONE); @@ -109,7 +109,7 @@ std::set* simulate(double how_long){ /* 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(action->getData()); + SD_task_t task = static_cast(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); diff --git a/src/simdag/sd_task.cpp b/src/simdag/sd_task.cpp index 8bbfa7f291..9f8900ed0f 100644 --- a/src/simdag/sd_task.cpp +++ b/src/simdag/sd_task.cpp @@ -287,7 +287,7 @@ void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state) 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 @@ -810,7 +810,7 @@ void SD_task_run(SD_task_t task) 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); @@ -830,7 +830,7 @@ void SD_task_run(SD_task_t task) 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; } diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index 8d94d4e807..bf3a1bf874 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -255,7 +255,7 @@ smx_activity_t ActorImpl::sleep(double 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; diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 9f692a557a..2a3adc8985 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -156,7 +156,7 @@ void simcall_execution_set_bound(smx_activity_t execution, double bound) simgrid::kernel::activity::ExecImplPtr exec = boost::static_pointer_cast(execution); if (exec->surfAction_) - exec->surfAction_->setBound(bound); + exec->surfAction_->set_bound(bound); }); } diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index adcb65e55d..f79169b16a 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -337,15 +337,15 @@ static void SIMIX_wake_processes() 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(action->getData())); + SIMIX_simcall_exit(static_cast(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); - if (action->getData() == nullptr) + if (action->get_data() == nullptr) XBT_DEBUG("probably vcpu's action %p, skip", action); else - SIMIX_simcall_exit(static_cast(action->getData())); + SIMIX_simcall_exit(static_cast(action->get_data())); } } } diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 7872929702..a6455ee5af 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -147,11 +147,11 @@ SIMIX_execution_start(const char* name, double flops_amount, double priority, do 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) - static_cast(exec->surfAction_)->setBound(bound); + static_cast(exec->surfAction_)->set_bound(bound); } XBT_DEBUG("Create execute synchro %p: %s", exec.get(), exec->name.c_str()); @@ -182,10 +182,10 @@ SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_li 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); - exec->timeoutDetector->setData(exec.get()); + exec->timeoutDetector->set_data(exec.get()); } } XBT_DEBUG("Create parallel execute synchro %p", exec.get()); diff --git a/src/simix/smx_io.cpp b/src/simix/smx_io.cpp index 39c13a1913..b0363e9d38 100644 --- a/src/simix/smx_io.cpp +++ b/src/simix/smx_io.cpp @@ -32,7 +32,7 @@ smx_activity_t SIMIX_storage_read(surf_storage_t st, sg_size_t 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; @@ -49,7 +49,7 @@ smx_activity_t SIMIX_storage_write(surf_storage_t st, sg_size_t 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; diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index 45ce0ca2fc..3852732056 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -323,7 +323,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, do } 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(synchro); @@ -461,14 +461,14 @@ static inline void SIMIX_comm_start(simgrid::kernel::activity::CommImplPtr comm) 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 */ - 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; diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index 2fca1552f8..76574a1ee1 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -30,7 +30,7 @@ smx_activity_t SIMIX_synchro_wait(sg_host_t smx_host, double 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; } diff --git a/src/surf/StorageImpl.cpp b/src/surf/StorageImpl.cpp index 1cdd353b3d..bafab94625 100644 --- a/src/surf/StorageImpl.cpp +++ b/src/surf/StorageImpl.cpp @@ -94,10 +94,10 @@ void StorageImpl::turnOff() /********** * 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); } } diff --git a/src/surf/StorageImpl.hpp b/src/surf/StorageImpl.hpp index 5027331d51..9b3610f2e1 100644 --- a/src/surf/StorageImpl.hpp +++ b/src/surf/StorageImpl.hpp @@ -175,7 +175,7 @@ public: 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_; diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index cdad05f79f..74e82634db 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -54,7 +54,7 @@ CpuCas01Model::CpuCas01Model() : simgrid::surf::CpuModel() 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() @@ -136,11 +136,11 @@ void CpuCas01::apply_event(tmgr_trace_event_t event, double value) while ((var = cnst->get_variable(&elem))) { kernel::resource::Action* action = static_cast(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->setState(kernel::resource::Action::State::failed); + action->set_state(kernel::resource::Action::State::failed); } } } @@ -176,7 +176,7 @@ CpuAction *CpuCas01::sleep(double duration) 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(model())->p_cpuRunningActionSetThatDoesNotNeedBeingChecked; + action->state_set_ = &static_cast(model())->cpuRunningActionSetThatDoesNotNeedBeingChecked_; action->getStateSet()->push_back(*action); } diff --git a/src/surf/cpu_cas01.hpp b/src/surf/cpu_cas01.hpp index cefa230180..7ed577b719 100644 --- a/src/surf/cpu_cas01.hpp +++ b/src/surf/cpu_cas01.hpp @@ -28,7 +28,7 @@ public: ~CpuCas01Model() override; Cpu *createCpu(simgrid::s4u::Host *host, std::vector *speedPerPstate, int core) override; - kernel::resource::ActionList p_cpuRunningActionSetThatDoesNotNeedBeingChecked; + kernel::resource::Action::StateSet cpuRunningActionSetThatDoesNotNeedBeingChecked_; }; /************ diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index a223b686b8..d5ffeef752 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -200,20 +200,21 @@ void CpuAction::updateRemainingLazy(double now) simgrid::xbt::signal CpuAction::onStateChange; void CpuAction::suspend(){ - Action::State previous = getState(); + Action::State previous = get_state(); onStateChange(this, previous); Action::suspend(); } void CpuAction::resume(){ - Action::State previous = getState(); + Action::State previous = get_state(); 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 */ diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 131a0a8b11..c642170664 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -161,7 +161,7 @@ public: { } - 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 cpus(); diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 10d6cb6e5d..d285431452 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -439,11 +439,11 @@ void CpuTi::apply_event(tmgr_trace_event_t event, double value) /* 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.setState(kernel::resource::Action::State::failed); + action.set_state(kernel::resource::Action::State::failed); action.heapRemove(model()->getActionHeap()); } } @@ -496,14 +496,14 @@ void CpuTi::updateActionsFinishTime(double now) 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) - min_finish = action.getStartTime() + action.getMaxDuration(); + min_finish = action.get_start_time() + action.getMaxDuration(); } /* add in action heap */ if (min_finish > NO_MAX_DURATION) @@ -512,7 +512,7 @@ void CpuTi::updateActionsFinishTime(double now) 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); @@ -554,7 +554,7 @@ void CpuTi::updateRemainingAmount(double now) continue; /* action don't need update */ - if (action.getStartTime() >= now) + if (action.get_start_time() >= now) continue; /* skip action that are finishing now */ @@ -626,9 +626,9 @@ CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed, CpuTi *cp cpu_->modified(true); } -void CpuTiAction::setState(Action::State state) +void CpuTiAction::set_state(Action::State state) { - CpuAction::setState(state); + CpuAction::set_state(state); cpu_->modified(true); } @@ -636,7 +636,7 @@ int CpuTiAction::unref() { 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()) @@ -652,7 +652,7 @@ int CpuTiAction::unref() void CpuTiAction::cancel() { - this->setState(Action::State::failed); + this->set_state(Action::State::failed); heapRemove(getModel()->getActionHeap()); cpu_->modified(true); } @@ -687,8 +687,8 @@ void CpuTiAction::setMaxDuration(double duration) 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(); diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index 5ce1af9fc7..7b5d3bc8b0 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -84,7 +84,7 @@ class CpuTiAction: public CpuAction { 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; @@ -151,7 +151,7 @@ public: double nextOccuringEvent(double now) override; void updateActionsState(double now, double delta) override; - kernel::resource::ActionList runningActionSetThatDoesNotNeedBeingChecked_; + kernel::resource::Action::StateSet runningActionSetThatDoesNotNeedBeingChecked_; CpuTiList modifiedCpu_; }; diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index c5d3c9dc00..133893eab1 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -155,7 +155,7 @@ NetworkCm02Model::NetworkCm02Model() 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() @@ -387,10 +387,10 @@ void NetworkCm02Link::apply_event(tmgr_trace_event_t triggered, double value) while ((var = constraint()->get_variable(&elem))) { kernel::resource::Action* action = static_cast(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->setState(kernel::resource::Action::State::failed); + action->set_state(kernel::resource::Action::State::failed); } } } diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index c37b9f5684..ceb99fc87d 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -34,7 +34,7 @@ static void IB_action_state_changed_callback(simgrid::surf::NetworkAction* actio 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 pair = ((NetworkIBModel*)surf_network_model)->active_comms[action]; XBT_DEBUG("IB callback - action %p finished", action); @@ -164,7 +164,7 @@ void NetworkIBModel::computeIBfactors(IBNode* root) 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; @@ -173,7 +173,7 @@ void NetworkIBModel::computeIBfactors(IBNode* root) 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, diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index 0549d1dda2..d49a04e864 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -186,9 +186,9 @@ namespace simgrid { * Action * **********/ - void NetworkAction::setState(Action::State state) + void NetworkAction::set_state(Action::State state) { - Action::setState(state); + Action::set_state(state); s4u::Link::onCommunicationStateChange(this); } diff --git a/src/surf/network_interface.hpp b/src/surf/network_interface.hpp index e1e88ee1c0..36f280123d 100644 --- a/src/surf/network_interface.hpp +++ b/src/surf/network_interface.hpp @@ -213,7 +213,7 @@ public: 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 links(); double latency_ = {}; diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 16f288d66f..1b3d77212c 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -223,7 +223,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta) 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 route = std::vector(); @@ -354,7 +354,7 @@ int NetworkNS3Action::unref() { 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; diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index 87778c7ab3..9b160b615e 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -74,7 +74,7 @@ double HostL07Model::nextOccuringEvent(double now) const L07Action& net_action = static_cast(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); @@ -411,7 +411,7 @@ int L07Action::unref() { 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()); diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index 4ee0d4a68e..1dcce836f5 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -143,7 +143,7 @@ int StorageN11Action::unref() { 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()); @@ -156,7 +156,7 @@ int StorageN11Action::unref() void StorageN11Action::cancel() { - setState(Action::State::failed); + set_state(Action::State::failed); } void StorageN11Action::suspend() diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index 659be87a77..99354ad0c9 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -150,7 +150,7 @@ double surf_solve(double max_date) /********* * 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; @@ -176,5 +176,5 @@ int surf_model_running_action_set_size(simgrid::kernel::resource::Model* model) void surf_cpu_action_set_bound(simgrid::kernel::resource::Action* action, double bound) { - static_cast(action)->setBound(bound); + static_cast(action)->set_bound(bound); } diff --git a/teshsuite/surf/surf_usage/surf_usage.cpp b/teshsuite/surf/surf_usage/surf_usage.cpp index e05c1f5ec9..37fc127080 100644 --- a/teshsuite/surf/surf_usage/surf_usage.cpp +++ b/teshsuite/surf/surf_usage/surf_usage.cpp @@ -48,9 +48,9 @@ int main(int argc, char **argv) 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)); @@ -66,7 +66,7 @@ int main(int argc, char **argv) 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"); -- 2.20.1