X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/82bdeeeb1a432be6d7ef85292391a697917855cf..d2a6882ed727ec836d89520998918056aa355cac:/examples/simdag/dot/dot_test2.c diff --git a/examples/simdag/dot/dot_test2.c b/examples/simdag/dot/dot_test2.c index fd52e8f273..47f327a8c4 100644 --- a/examples/simdag/dot/dot_test2.c +++ b/examples/simdag/dot/dot_test2.c @@ -1,6 +1,6 @@ /* simple test trying to load a DOT file. */ -/* Copyright (c) 2010. The SimGrid Team. +/* Copyright (c) 2010-2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -8,7 +8,7 @@ #include #include -#include "simdag/simdag.h" +#include "simgrid/simdag.h" #include "xbt/log.h" #include "xbt/ex.h" #include @@ -22,12 +22,12 @@ int main(int argc, char **argv) unsigned int cursor; SD_task_t task, *dot_as_array=NULL; - /* initialisation of SD */ + /* SD initialization */ SD_init(&argc, argv); /* Check our arguments */ if (argc < 2) { - INFO1("Usage: %s dot_file", argv[0]); + XBT_INFO("Usage: %s dot_file", argv[0]); exit(1); } @@ -35,27 +35,28 @@ int main(int argc, char **argv) dot = SD_dotload(argv[1]); /* Display all the tasks */ - INFO0 + XBT_INFO ("------------------- Display all tasks of the loaded DAG ---------------------------"); xbt_dynar_foreach(dot, cursor, task) { SD_task_dump(task); } - INFO0 + XBT_INFO ("--------------------- Transform the dynar into an array ---------------------------"); cursor=0; dot_as_array = (SD_task_t*) xbt_dynar_to_array(dot); - INFO0 + XBT_INFO ("----------------------------- dump tasks again ------------------------------------"); while ((task=dot_as_array[cursor++])){ SD_task_dump(task); } - xbt_dynar_foreach(dot, cursor, task) { + cursor=0; + while ((task=dot_as_array[cursor++])){ SD_task_destroy(task); } - xbt_dynar_free_container(&dot); + free(dot_as_array); /* exit */ SD_exit();