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. */
11 #include "simgrid/simdag.h"
16 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this SimDag example");
18 int main(int argc, char **argv)
22 SD_task_t task, *dot_as_array=NULL;
24 /* SD initialization */
27 /* Check our arguments */
28 xbt_assert(argc > 1, "Usage: %s dot_file", argv[0]);
30 /* load the DOT file */
31 dot = SD_dotload(argv[1]);
33 /* Display all the tasks */
34 XBT_INFO("------------------- Display all tasks of the loaded DAG ---------------------------");
35 xbt_dynar_foreach(dot, cursor, task) {
39 XBT_INFO("--------------------- Transform the dynar into an array ---------------------------");
41 dot_as_array = (SD_task_t*) xbt_dynar_to_array(dot);
42 XBT_INFO("----------------------------- dump tasks again ------------------------------------");
43 while ((task=dot_as_array[cursor++])){
48 while ((task=dot_as_array[cursor++])){
49 SD_task_destroy(task);