Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
pluginify storage contents
[simgrid.git] / src / surf / storage_n11.cpp
index 54f2847..71ee41d 100644 (file)
@@ -78,20 +78,13 @@ 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
-    double current_progress = lrint(lmm_variable_getvalue(action.getVariable()) * delta);
-    action.updateRemains(current_progress);
-    if (action.type_ == WRITE) {
-      action.storage_->usedSize_ += current_progress;
-    }
+    action.updateRemains(lrint(lmm_variable_getvalue(action.getVariable()) * delta));
 
     if (action.getMaxDuration() > NO_MAX_DURATION)
       action.updateMaxDuration(delta);
 
-    if (action.getRemainsNoUpdate() > 0 && lmm_get_variable_weight(action.getVariable()) > 0 &&
-        action.storage_->usedSize_ == action.storage_->getSize()) {
-      action.finish(Action::State::failed);
-    } else if (((action.getRemainsNoUpdate() <= 0) && (lmm_get_variable_weight(action.getVariable()) > 0)) ||
-               ((action.getMaxDuration() > NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
+    if (((action.getRemainsNoUpdate() <= 0) && (lmm_get_variable_weight(action.getVariable()) > 0)) ||
+        ((action.getMaxDuration() > NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
       action.finish(Action::State::done);
     }
   }