Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
When you detect a cycle in a structure supposed to be acyclic, don't
[simgrid.git] / src / simdag / sd_daxloader.c
index 40b4e62..2bbd2c7 100644 (file)
@@ -384,8 +384,16 @@ xbt_dynar_t SD_daxload(const char *filename)
     }
   }
 
-  acyclic_graph_detail(result);
-  return result;
+  if (!acyclic_graph_detail(result)){
+    XBT_ERROR("The DAX described in %s is not a DAG. It contains a cycle.",
+              filename);
+    xbt_dynar_foreach(result, cpt, file)
+      SD_task_destroy(file);
+     xbt_dynar_free_container(&result);
+    return NULL;
+  } else {
+    return result;
+  }
 }
 
 void STag_dax__adag(void)