Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Start the SimDag revolution: function renaming
[simgrid.git] / teshsuite / simdag / availability / availability_test.c
index 0bec63589017d33c913447407db5b6985c366fc8..02a70204ea15d56c15939616fb837cc2d729aefa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014. The SimGrid Team.
+/* Copyright (c) 2013-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -9,7 +9,7 @@
 #include <string.h>
 #include <stddef.h>
 #include <unistd.h>
-#include <simdag/simdag.h>
+#include <simgrid/simdag.h>
 #include <xbt/log.h>
 #include <xbt/ex.h>
 #include <signal.h>
@@ -69,12 +69,11 @@ static void scheduleDAX(xbt_dynar_t dax)
   SD_task_t task;
 
   const SD_workstation_t *ws_list = SD_workstation_get_list();
-  int totalHosts = SD_workstation_get_number();
+  int totalHosts = SD_workstation_get_count();
   qsort((void *) ws_list, totalHosts, sizeof(SD_workstation_t),
         name_compare_hosts);
 
-  int count = SD_workstation_get_number();
-  //fprintf(stdout, "No. workstations: %d, %d\n", count, (dax != NULL));
+  //fprintf(stdout, "No. workstations: %d, %d\n", totalHosts, (dax != NULL));
 
   xbt_dynar_foreach(dax, cursor, task) {
     if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {
@@ -85,8 +84,8 @@ static void scheduleDAX(xbt_dynar_t dax)
         SD_task_schedulel(task, 1, ws_list[0]);
       } else {
         fprintf(stdout, "Scheduling %s to node: %s\n", SD_task_get_name(task),
-                SD_workstation_get_name(ws_list[(cursor) % count]));
-        SD_task_schedulel(task, 1, ws_list[(cursor) % count]);
+                SD_workstation_get_name(ws_list[(cursor) % totalHosts]));
+        SD_task_schedulel(task, 1, ws_list[(cursor) % totalHosts]);
       }
     }
   }
@@ -144,8 +143,7 @@ static xbt_dynar_t initDynamicThrottling(int *argc, char *argv[])
   fprintf(stdout, "Scheduling DAX...\n");
   scheduleDAX(dax);
   fprintf(stdout, "DAX scheduled\n");
-  xbt_dynar_t ret = SD_simulate(-1);
-  xbt_dynar_free(&ret);
+  SD_simulate(-1);
   fprintf(stdout, "Simulation end. Time: %f\n", SD_get_clock());
 
   return dax;