Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use standard function fmax() for doubles.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 17 Apr 2018 19:20:37 +0000 (21:20 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Apr 2018 20:53:31 +0000 (22:53 +0200)
examples/simdag/scheduling/sd_scheduling.c

index 92c3e92..b1b06aa 100644 (file)
@@ -5,8 +5,9 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* simple test to schedule a DAX file with the Min-Min algorithm.           */
-#include <string.h>
 #include "simgrid/simdag.h"
+#include <math.h>
+#include <string.h>
 
 #if SIMGRID_HAVE_JEDULE
 #include "simgrid/jedule/jedule_sd_binding.h"
@@ -101,7 +102,7 @@ static double finish_on_at(SD_task_t task, sg_host_t host)
 
     xbt_dynar_free_container(&parents);
 
-    result = MAX(sg_host_get_available_at(host), last_data_available) + SD_task_get_amount(task)/sg_host_speed(host);
+    result = fmax(sg_host_get_available_at(host), last_data_available) + SD_task_get_amount(task) / sg_host_speed(host);
   } else {
     xbt_dynar_free_container(&parents);