1 /* simple test trying to load a DOT file. */
3 /* Copyright (c) 2010. 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"
17 XBT_LOG_NEW_DEFAULT_CATEGORY(test,
18 "Logging specific to this SimDag example");
20 int main(int argc, char **argv)
24 SD_task_t task, *dot_as_array=NULL;
26 /* initialisation of SD */
29 /* Check our arguments */
31 XBT_INFO("Usage: %s dot_file", argv[0]);
35 /* load the DOT file */
36 dot = SD_dotload(argv[1]);
38 /* Display all the tasks */
40 ("------------------- Display all tasks of the loaded DAG ---------------------------");
41 xbt_dynar_foreach(dot, cursor, task) {
46 ("--------------------- Transform the dynar into an array ---------------------------");
48 dot_as_array = (SD_task_t*) xbt_dynar_to_array(dot);
50 ("----------------------------- dump tasks again ------------------------------------");
51 while ((task=dot_as_array[cursor++])){
53 SD_task_destroy(task);