Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix dependency issue to prevent problems with make -jx
[simgrid.git] / teshsuite / simdag / basic3 / basic3.c
index 6c2e431..03c7308 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2012, 2014-2015. The SimGrid Team.
+/* Copyright (c) 2007-2012, 2014-2018. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -30,12 +30,14 @@ int main(int argc, char **argv)
   SD_task_t taskA = SD_task_create("Task A", NULL, 1.0);
   SD_task_t taskFin = SD_task_create("Task Fin", NULL, 1.0);
 
-  SD_task_dependency_add(NULL, NULL, taskInit, taskA);
-  SD_task_dependency_add(NULL, NULL, taskA, taskFin);
+  SD_task_dependency_add(taskInit, taskA);
+  SD_task_dependency_add(taskA, taskFin);
 
-  SD_task_schedule(taskInit, 1, sg_host_list(), no_cost, no_cost, -1.0);
-  SD_task_schedule(taskA, 2, sg_host_list(), no_cost, no_cost, -1.0);
-  SD_task_schedule(taskFin, 1, sg_host_list(), no_cost, no_cost, -1.0);
+  sg_host_t *hosts = sg_host_list();
+  SD_task_schedule(taskInit, 1, hosts, no_cost, no_cost, -1.0);
+  SD_task_schedule(taskA, 2, hosts, no_cost, no_cost, -1.0);
+  SD_task_schedule(taskFin, 1, hosts, no_cost, no_cost, -1.0);
+  xbt_free(hosts);
 
   /* let's launch the simulation! */
   SD_simulate(-1.0);
@@ -45,6 +47,5 @@ int main(int argc, char **argv)
 
   XBT_INFO("Simulation time: %f", SD_get_clock());
 
-  SD_exit();
   return 0;
 }