1 /* simple test trying to load a DOT file. */
3 /* Copyright (c) 2010-2016. 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. */
9 #include "simgrid/simdag.h"
12 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this SimDag example");
14 int main(int argc, char **argv)
18 SD_task_t task, *dot_as_array=NULL;
20 /* SD initialization */
23 /* Check our arguments */
24 xbt_assert(argc > 1, "Usage: %s dot_file", argv[0]);
26 /* load the DOT file */
27 dot = SD_dotload(argv[1]);
29 /* Display all the tasks */
30 XBT_INFO("------------------- Display all tasks of the loaded DAG ---------------------------");
31 xbt_dynar_foreach(dot, cursor, task) {
35 XBT_INFO("--------------------- Transform the dynar into an array ---------------------------");
37 dot_as_array = (SD_task_t*) xbt_dynar_to_array(dot);
38 XBT_INFO("----------------------------- dump tasks again ------------------------------------");
39 while ((task=dot_as_array[cursor++])){
44 while ((task=dot_as_array[cursor++])){
45 SD_task_destroy(task);