Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / teshsuite / simdag / incomplete / incomplete.c
index 68238f0..142dc5c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2012, 2014-2015. The SimGrid Team.
+/* Copyright (c) 2007-2020. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -38,15 +38,15 @@ int main(int argc, char **argv)
   SD_task_t taskC = SD_task_create("Task C", NULL, 1.0);
   SD_task_t taskD = SD_task_create("Task D", NULL, 1.0);
 
-  SD_task_dependency_add(NULL, NULL, taskInit, taskA);
-  SD_task_dependency_add(NULL, NULL, taskInit, taskB);
-  SD_task_dependency_add(NULL, NULL, taskC, taskD);
+  SD_task_dependency_add(taskInit, taskA);
+  SD_task_dependency_add(taskInit, taskB);
+  SD_task_dependency_add(taskC, taskD);
 
-  const sg_host_t *hosts = sg_host_list();
-
-  SD_task_schedule(taskInit, 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, 1, &hosts[0], &no_cost, &communication_amount1, -1.0);
   SD_task_schedule(taskD, 1, &hosts[0], &no_cost, &communication_amount1, -1.0);
+  xbt_free(hosts);
 
   /* let's launch the simulation! */
   SD_simulate(-1.);
@@ -59,6 +59,6 @@ int main(int argc, char **argv)
 
   XBT_INFO("Simulation time: %f", SD_get_clock());
 
-  SD_exit();
+
   return 0;
 }