Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[DVFS] Rephrase debug statements
[simgrid.git] / src / surf / storage_n11.cpp
index 9bad4ae..130879d 100644 (file)
@@ -4,9 +4,10 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "storage_n11.hpp"
-#include "maxmin_private.hpp"
 #include "simgrid/s4u/Engine.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
+#include "xbt/utility.hpp"
 #include <cmath> /*ceil*/
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_storage);
@@ -79,12 +80,12 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta)
   for (auto it = std::begin(*getRunningActionSet()); it != std::end(*getRunningActionSet());) {
     StorageAction& action = static_cast<StorageAction&>(*it);
     ++it; // increment iterator here since the following calls to action.finish() may invalidate it
-    action.updateRemains(lrint(lmm_variable_getvalue(action.getVariable()) * delta));
+    action.updateRemains(lrint(action.getVariable()->get_value() * delta));
 
     if (action.getMaxDuration() > NO_MAX_DURATION)
       action.updateMaxDuration(delta);
 
-    if (((action.getRemainsNoUpdate() <= 0) && (lmm_get_variable_weight(action.getVariable()) > 0)) ||
+    if (((action.getRemainsNoUpdate() <= 0) && (action.getVariable()->get_weight() > 0)) ||
         ((action.getMaxDuration() > NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
       action.finish(Action::State::done);
     }
@@ -143,7 +144,7 @@ int StorageN11Action::unref()
   refcount_--;
   if (not refcount_) {
     if (action_hook.is_linked())
-      stateSet_->erase(stateSet_->iterator_to(*this));
+      simgrid::xbt::intrusive_erase(*stateSet_, *this);
     if (getVariable())
       getModel()->getMaxminSystem()->variable_free(getVariable());
     xbt_free(getCategory());