X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/92c0f1f93abd31aabba2b867265ee78d0fa082ca..80d9a48e7538e146c639c538a52a1113d4fa922f:/examples/simdag/dag-dotload/sd_dag-dotload.c diff --git a/examples/simdag/dag-dotload/sd_dag-dotload.c b/examples/simdag/dag-dotload/sd_dag-dotload.c index a2006ba092..6baccb0fbc 100644 --- a/examples/simdag/dag-dotload/sd_dag-dotload.c +++ b/examples/simdag/dag-dotload/sd_dag-dotload.c @@ -9,7 +9,6 @@ #include "simgrid/simdag.h" #include "xbt/log.h" #include -#include #include XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this SimDag example"); @@ -34,7 +33,6 @@ int main(int argc, char **argv) dot = SD_dotload(argv[2]); if(dot == NULL){ XBT_CRITICAL("No dot loaded. Do you have a cycle in your graph?"); - SD_exit(); exit(2); } @@ -60,17 +58,18 @@ int main(int argc, char **argv) /* Schedule them all on the first workstation */ XBT_INFO("------------------- Schedule tasks ---------------------------"); - const sg_host_t *ws_list = sg_host_list(); + sg_host_t *hosts = sg_host_list(); int count = sg_host_count(); xbt_dynar_foreach(dot, cursor, task) { if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) { if (!strcmp(SD_task_get_name(task), "end")) - SD_task_schedulel(task, 1, ws_list[0]); + SD_task_schedulel(task, 1, hosts[0]); else - SD_task_schedulel(task, 1, ws_list[cursor % count]); + SD_task_schedulel(task, 1, hosts[cursor % count]); } } + xbt_free(hosts); XBT_INFO("------------------- Run the schedule ---------------------------"); SD_simulate(-1); @@ -104,6 +103,5 @@ int main(int argc, char **argv) fclose(out); /* exit */ - SD_exit(); return 0; }