Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to produce the same results with minmin on different setups.
authoragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 16 Nov 2010 09:25:22 +0000 (09:25 +0000)
committeragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 16 Nov 2010 09:25:22 +0000 (09:25 +0000)
Use a volatile double temporary variable to avoid rounding differences
on 32bit or 64bit x86, with or without gcc optimizations.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8557 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/simdag/scheduling/minmin_test.c

index 7fb1cca..a779dee 100644 (file)
@@ -72,6 +72,7 @@ static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax)
 
 static double finish_on_at(SD_task_t task, SD_workstation_t workstation)
 {
+  volatile double result;
   unsigned int i;
   double data_available = 0.;
   double redist_time = 0;
@@ -126,17 +127,18 @@ static double finish_on_at(SD_task_t task, SD_workstation_t workstation)
 
     xbt_dynar_free_container(&parents);
 
-    return MAX(SD_workstation_get_available_at(workstation),
+    result = MAX(SD_workstation_get_available_at(workstation),
                last_data_available) +
         SD_workstation_get_computation_time(workstation,
                                             SD_task_get_amount(task));
   } else {
     xbt_dynar_free_container(&parents);
 
-    return SD_workstation_get_available_at(workstation) +
+    result = SD_workstation_get_available_at(workstation) +
         SD_workstation_get_computation_time(workstation,
                                             SD_task_get_amount(task));
   }
+  return result;
 }
 
 static SD_workstation_t SD_task_get_best_workstation(SD_task_t task)