Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case some resource::Action fields and cleanups
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 25 Mar 2018 16:49:37 +0000 (18:49 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 25 Mar 2018 17:45:23 +0000 (19:45 +0200)
- 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:
include/simgrid/kernel/resource/Action.hpp
include/simgrid/kernel/resource/Model.hpp
src/kernel/activity/CommImpl.cpp
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/SleepImpl.cpp
src/kernel/activity/SynchroIo.cpp
src/kernel/activity/SynchroRaw.cpp
src/kernel/lmm/maxmin.hpp
src/kernel/resource/Action.cpp
src/kernel/resource/Model.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/simdag/sd_global.cpp
src/simdag/sd_task.cpp
src/simix/ActorImpl.cpp
src/simix/libsmx.cpp
src/simix/smx_global.cpp
src/simix/smx_host.cpp
src/simix/smx_io.cpp
src/simix/smx_network.cpp
src/simix/smx_synchro.cpp
src/surf/StorageImpl.cpp
src/surf/StorageImpl.hpp
src/surf/cpu_cas01.cpp
src/surf/cpu_cas01.hpp
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/network_cm02.cpp
src/surf/network_ib.cpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/network_ns3.cpp
src/surf/ptask_L07.cpp
src/surf/storage_n11.cpp
src/surf/surf_c_bindings.cpp
teshsuite/surf/surf_usage/surf_usage.cpp

index 39a2a07..47efce3 100644 (file)
@@ -24,23 +24,20 @@ typedef boost::heap::pairing_heap<heap_element_type, boost::heap::constant_time_
                                   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        */
@@ -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)
    */
    * @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
@@ -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
    */
    * @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();
 
 
   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 */
   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_; }
@@ -166,19 +163,19 @@ public:
   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_;
+  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 */
   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 */
@@ -212,9 +209,6 @@ protected:
   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
index 5de68af..541bbd9 100644 (file)
@@ -35,19 +35,19 @@ public:
   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_; }
@@ -98,10 +98,10 @@ protected:
 
 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_;
 };
 
index 954704f..bbcce11 100644 (file)
@@ -97,15 +97,15 @@ void simgrid::kernel::activity::CommImpl::cleanupSurf()
 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;
index 9f2c205..e5eba51 100644 (file)
@@ -66,7 +66,7 @@ double simgrid::kernel::activity::ExecImpl::remainingRatio()
 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()
@@ -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;
                                  /* 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;
@@ -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());
     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;
index ec7d083..054d467 100644 (file)
@@ -32,7 +32,7 @@ void simgrid::kernel::activity::SleepImpl::post()
     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;
index 33b8c68..3f4e149 100644 (file)
@@ -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;
     case simgrid::kernel::resource::Action::State::failed:
       state = SIMIX_FAILED;
       break;
index e0911fe..b9e089e 100644 (file)
@@ -27,9 +27,9 @@ void simgrid::kernel::activity::RawImpl::resume()
 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)
     state = SIMIX_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);
     state = SIMIX_SRC_TIMEOUT;
 
   SIMIX_synchro_finish(this);
index 65a2cd1..f5006fc 100644 (file)
@@ -601,7 +601,7 @@ public:
                                                                    &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);
 
index a7d037a..4281441 100644 (file)
@@ -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)
 }
 
 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();
@@ -38,10 +38,10 @@ Action::~Action()
 void Action::finish(Action::State state)
 {
   finish_time_ = surf_get_clock();
 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;
 {
   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;
 }
 
   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) {
@@ -78,12 +78,12 @@ void Action::setState(Action::State 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_)
@@ -124,9 +124,9 @@ void Action::setSharingWeight(double weight)
 
 void Action::cancel()
 {
 
 void Action::cancel()
 {
-  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());
   }
@@ -136,14 +136,14 @@ int Action::unref()
 {
   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;
index 7354c6e..4252b66 100644 (file)
@@ -31,7 +31,7 @@ Action* Model::actionHeapPop()
   return action;
 }
 
   return action;
 }
 
-ActionLmmListPtr Model::getModifiedSet() const
+Action::ModifiedSet* Model::getModifiedSet() const
 {
   return maxmin_system_->modified_set_;
 }
 {
   return maxmin_system_->modified_set_;
 }
@@ -81,16 +81,16 @@ double Model::nextOccuringEventLazy(double now)
     }
 
     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);
index 69070f0..7530cd2 100644 (file)
@@ -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. */
     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();
@@ -279,7 +279,7 @@ void VirtualMachineImpl::setPm(s4u::Host* destination)
 
 void VirtualMachineImpl::setBound(double bound)
 {
 
 void VirtualMachineImpl::setBound(double bound)
 {
-  action_->setBound(bound);
+  action_->set_bound(bound);
 }
 
 }
 }
 
 }
index 24034d4..1a31386 100644 (file)
@@ -58,8 +58,8 @@ std::set<SD_task_t>* 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);
     /* 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);
 
@@ -109,7 +109,7 @@ std::set<SD_task_t>* simulate(double how_long){
       /* 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);
index 8bbfa7f..9f8900e 100644 (file)
@@ -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);
 
   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
@@ -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 = 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);
 
@@ -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)
 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;
 }
index 8d94d4e..bf3a1bf 100644 (file)
@@ -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);
   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;
index 9f692a5..2a3adc8 100644 (file)
@@ -156,7 +156,7 @@ void simcall_execution_set_bound(smx_activity_t execution, double bound)
     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);
   });
 }
 
   });
 }
 
index adcb65e..f79169b 100644 (file)
@@ -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);
     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()));
     }
   }
 }
     }
   }
 }
index 7872929..a6455ee 100644 (file)
@@ -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);
   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());
@@ -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);
     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());
index 39c13a1..b0363e9 100644 (file)
@@ -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);
 
   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;
@@ -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);
 {
   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;
index 45ce0ca..3852732 100644 (file)
@@ -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);
   } 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);
@@ -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);
     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;
index 2fca155..76574a1 100644 (file)
@@ -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);
   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;
 }
index 1cdd353..bafab94 100644 (file)
@@ -94,10 +94,10 @@ void StorageImpl::turnOff()
 /**********
  * 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);
 }
 }
index 5027331..9b3610f 100644 (file)
@@ -175,7 +175,7 @@ public:
                 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_;
index cdad05f..74e8263 100644 (file)
@@ -54,7 +54,7 @@ CpuCas01Model::CpuCas01Model() : simgrid::surf::CpuModel()
   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()
@@ -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<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);
         }
       }
     }
         }
       }
     }
@@ -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);
   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);
   }
 
index cefa230..7ed577b 100644 (file)
@@ -28,7 +28,7 @@ public:
   ~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_;
 };
 
 /************
 };
 
 /************
index a223b68..d5ffeef 100644 (file)
@@ -200,20 +200,21 @@ void CpuAction::updateRemainingLazy(double now)
 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 */
index 131a0a8..c642170 100644 (file)
@@ -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<Cpu*> cpus();
 
   void updateRemainingLazy(double now) override;
   std::list<Cpu*> cpus();
index 10d6cb6..d285431 100644 (file)
@@ -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_) {
 
       /* 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());
         }
       }
@@ -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.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)
@@ -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.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);
@@ -554,7 +554,7 @@ void CpuTi::updateRemainingAmount(double now)
       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 */
@@ -626,9 +626,9 @@ CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed, CpuTi *cp
   cpu_->modified(true);
 }
 
   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);
 }
 
   cpu_->modified(true);
 }
 
@@ -636,7 +636,7 @@ int CpuTiAction::unref()
 {
   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())
@@ -652,7 +652,7 @@ int CpuTiAction::unref()
 
 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);
 }
@@ -687,8 +687,8 @@ void CpuTiAction::setMaxDuration(double duration)
   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();
 
index 5ce1af9..7b5d3bc 100644 (file)
@@ -84,7 +84,7 @@ class CpuTiAction: public CpuAction {
 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;
@@ -151,7 +151,7 @@ public:
   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_;
 };
 
index c5d3c9d..133893e 100644 (file)
@@ -155,7 +155,7 @@ NetworkCm02Model::NetworkCm02Model()
   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()
@@ -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<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);
         }
       }
     }
         }
       }
     }
index c37b9f5..ceb99fc 100644 (file)
@@ -34,7 +34,7 @@ static void IB_action_state_changed_callback(simgrid::surf::NetworkAction* actio
   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);
@@ -164,7 +164,7 @@ void NetworkIBModel::computeIBfactors(IBNode* root)
 
     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;
@@ -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,
 
     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,
index 0549d1d..d49a04e 100644 (file)
@@ -186,9 +186,9 @@ namespace simgrid {
      * Action *
      **********/
 
      * 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);
     }
 
       s4u::Link::onCommunicationStateChange(this);
     }
 
index e1e88ee..36f2801 100644 (file)
@@ -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){};
 
   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_    = {};
index 16f288d..1b3d772 100644 (file)
@@ -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_);
 
     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*>();
@@ -354,7 +354,7 @@ int NetworkNS3Action::unref()
 {
   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;
index 87778c7..9b160b6 100644 (file)
@@ -74,7 +74,7 @@ double HostL07Model::nextOccuringEvent(double now)
     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);
@@ -411,7 +411,7 @@ int L07Action::unref()
 {
   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());
index 4ee0d4a..1dcce83 100644 (file)
@@ -143,7 +143,7 @@ int StorageN11Action::unref()
 {
   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());
@@ -156,7 +156,7 @@ int StorageN11Action::unref()
 
 void StorageN11Action::cancel()
 {
 
 void StorageN11Action::cancel()
 {
-  setState(Action::State::failed);
+  set_state(Action::State::failed);
 }
 
 void StorageN11Action::suspend()
 }
 
 void StorageN11Action::suspend()
index 659be87..99354ad 100644 (file)
@@ -150,7 +150,7 @@ double surf_solve(double max_date)
 /*********
  * 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;
@@ -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)
 {
 
 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);
 }
 }
index e05c1f5..37fc127 100644 (file)
@@ -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* 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));
@@ -66,7 +66,7 @@ int main(int argc, char **argv)
     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");