Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Sun, 4 Sep 2016 15:19:17 +0000 (17:19 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Sun, 4 Sep 2016 15:19:17 +0000 (17:19 +0200)
src/surf/storage_n11.cpp

index e23abc2..21fbb42 100644 (file)
@@ -174,17 +174,15 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta)
 
     action->updateRemains(lmm_variable_getvalue(action->getVariable()) * delta);
 
-    if (action->getMaxDuration() != NO_MAX_DURATION)
+    if (action->getMaxDuration() > NO_MAX_DURATION)
       action->updateMaxDuration(delta);
 
     if(action->getRemainsNoUpdate() > 0 && lmm_get_variable_weight(action->getVariable()) > 0 &&
         action->p_storage->usedSize_ == action->p_storage->size_) {
       action->finish();
       action->setState(Action::State::failed);
-    } else if ((action->getRemainsNoUpdate() <= 0) && (lmm_get_variable_weight(action->getVariable()) > 0)) {
-      action->finish();
-      action->setState(Action::State::done);
-    } else if ((action->getMaxDuration() != NO_MAX_DURATION) && (action->getMaxDuration() <= 0)) {
+    } else if (((action->getRemainsNoUpdate() <= 0) && (lmm_get_variable_weight(action->getVariable()) > 0)) ||
+               ((action->getMaxDuration() > NO_MAX_DURATION) && (action->getMaxDuration() <= 0))) {
       action->finish();
       action->setState(Action::State::done);
     }