X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/849226e40378b44314a42ccd76ccfd7a0a59f6db..83ade874cb34c7f3afbc9f7a782e097cbb7209bf:/examples/simdag/sd_typed_tasks_test.c diff --git a/examples/simdag/sd_typed_tasks_test.c b/examples/simdag/sd_typed_tasks_test.c index f72d8aab68..e8fe7b4a2f 100644 --- a/examples/simdag/sd_typed_tasks_test.c +++ b/examples/simdag/sd_typed_tasks_test.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team. +/* Copyright (c) 2006-2010, 2012-2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -6,7 +6,7 @@ #include #include -#include "simdag/simdag.h" +#include "simgrid/simdag.h" #include "xbt/ex.h" #include "xbt/log.h" @@ -32,11 +32,8 @@ int main(int argc, char **argv) /* xbt_log_control_set("sd.thres=debug"); */ - if (argc < 2) { - XBT_INFO("Usage: %s platform_file", argv[0]); - XBT_INFO("example: %s sd_platform.xml", argv[0]); - exit(1); - } + xbt_assert(argc > 1, "Usage: %s platform_file\n" + "\nExample: %s two_clusters.xml", argv[0], argv[0]); /* creation of the environment */ platform_file = argv[1]; @@ -66,6 +63,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 */ @@ -80,9 +87,11 @@ int main(int argc, char **argv) XBT_INFO("Task '%s' start time: %f, finish time: %f", SD_task_get_name(task), SD_task_get_start_time(task), SD_task_get_finish_time(task)); - SD_task_destroy(task); } + xbt_dynar_foreach(changed_tasks, ctr, task) { + SD_task_destroy(task); + } SD_exit(); return 0; }