Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a small value to avoid rounding differences between x86 and x86_64.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 14 Jun 2013 09:25:47 +0000 (11:25 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 14 Jun 2013 10:45:36 +0000 (12:45 +0200)
src/surf/storage.c

index dc8b217..df2d0d4 100644 (file)
@@ -261,8 +261,11 @@ static void storage_update_actions_state(double now, double delta)
     if(action->type == WRITE)
     {
       double rate = lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable);
-      ((storage_t)(action->storage))->used_size += delta * rate; // disk usage
-      ((surf_action_t)action)->file->size += delta * rate; // file size
+      /* Hack to avoid rounding differences between x86 and x86_64
+       * (note that the next sizes are of type size_t). */
+      long incr = delta * rate + MAXMIN_PRECISION;
+      ((storage_t)(action->storage))->used_size += incr; // disk usage
+      ((surf_action_t)action)->file->size += incr; // file size
     }
   }