Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Dump dotty info for verification
[simgrid.git] / examples / simdag / dax / dax_test.c
index f6ab0d4dc540b639f6aec7c65eb1dee42022d096..9a97ff94da0ca12464b80a8f7f36ae56894f98ad 100644 (file)
@@ -6,6 +6,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <stdlib.h>
+#include <stdio.h>
 #include "simdag/simdag.h"
 #include "xbt/log.h"
 
@@ -18,6 +19,10 @@ int main(int argc, char **argv) {
   unsigned int cursor;
   SD_task_t task;
 
+  /* initialisation of SD */
+  SD_init(&argc, argv);
+
+  /* Check our arguments */
   if (argc < 3) {
     INFO1("Usage: %s platform_file dax_file", argv[0]);
     INFO1("example: %s ../sd_platform.xml Montage_50.xml", argv[0]);
@@ -32,8 +37,17 @@ int main(int argc, char **argv) {
 
   /* Display all the tasks */
   xbt_dynar_foreach(dax,cursor,task) {
+    SD_task_dump(task);
+  }
 
+  FILE *out = fopen("dax.dot","w");
+  fprintf(out,"digraph A {\n");
+  xbt_dynar_foreach(dax,cursor,task) {
+    SD_task_dotty(task,out);
   }
+  fprintf(out,"}\n");
+  fclose(out);
+
   /* exit */
   SD_exit();
   return 1;