Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bug fix. Now cpu_im can handle tasks whose size is 0. That's more convenient for...
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 10 Nov 2010 20:01:53 +0000 (20:01 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 10 Nov 2010 20:01:53 +0000 (20:01 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8524 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/cpu_im.c

index 3d11906..699b59b 100644 (file)
@@ -277,13 +277,14 @@ static double cpu_im_share_resources(double now)
       min = -1;
       value = lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable);
       if (value > 0) {
-        if (GENERIC_ACTION(action).remains > 0)
+        if (GENERIC_ACTION(action).remains > 0) {
           value = GENERIC_ACTION(action).remains / value;
-        else
+          min = now + value;
+        } else {
           value = 0.0;
+          min = now;
+        }
       }
-      if (value > 0)
-        min = now + value;
 
       if ((GENERIC_ACTION(action).max_duration != NO_MAX_DURATION)
           && (min == -1