1 /* simple test trying to load a DOT file. */
3 /* Copyright (c) 2010-2012. The SimGrid Team.
4 * All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
11 #include "simdag/simdag.h"
16 XBT_LOG_NEW_DEFAULT_CATEGORY(test,
17 "Logging specific to this SimDag example");
19 int main(int argc, char **argv)
23 SD_task_t task, *dot_as_array=NULL;
25 /* initialisation of SD */
28 /* Check our arguments */
30 XBT_INFO("Usage: %s dot_file", argv[0]);
34 /* load the DOT file */
35 dot = SD_dotload(argv[1]);
37 /* Display all the tasks */
39 ("------------------- Display all tasks of the loaded DAG ---------------------------");
40 xbt_dynar_foreach(dot, cursor, task) {
45 ("--------------------- Transform the dynar into an array ---------------------------");
47 dot_as_array = (SD_task_t*) xbt_dynar_to_array(dot);
49 ("----------------------------- dump tasks again ------------------------------------");
50 while ((task=dot_as_array[cursor++])){
55 while ((task=dot_as_array[cursor++])){
56 SD_task_destroy(task);