Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill some memory leaks.
[simgrid.git] / examples / simdag / sd_typed_tasks_test.c
index f72d8aa..f262166 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -66,6 +66,16 @@ int main(int argc, char **argv)
   SD_task_schedulev(par_comp1, 4, workstations);
   SD_task_schedulev(par_comp2, 3, workstations);
 
+  /* Let's unschedule these tasks and test the auto-scheduling in the
+   * opposite way.
+   */
+  SD_task_unschedule(par_comp1);
+  SD_task_unschedule(par_comp2);
+  SD_task_unschedule(redist); /* yes, it was scheduled too */
+
+  SD_task_schedulev(par_comp2, 3, workstations);
+  SD_task_schedulev(par_comp1, 4, workstations);
+
   for (i=0;i<4;i++){
     workstation_list[i]=workstations[i+4];
     /* Apply Amdahl's law manually assuming a 20% serial part */
@@ -82,7 +92,7 @@ int main(int argc, char **argv)
           SD_task_get_start_time(task), SD_task_get_finish_time(task));
     SD_task_destroy(task);
   }
-
+  xbt_dynar_free_container(&changed_tasks);
   SD_exit();
   return 0;
 }