-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2014. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
xbt_dynar_push(result, &root_task);
end_task = SD_task_create_comp_seq("end", NULL, 0);
- _XBT_GNUC_UNUSED int res;
- res = dax_lex();
- xbt_assert(!res, "Parse error in %s: %s", filename,
- dax__parse_err_msg());
+ int res = dax_lex();
+ if (res != 0)
+ xbt_die("Parse error in %s: %s", filename, dax__parse_err_msg());
dax__delete_buffer(input_buffer);
fclose(in_file);
dax_lex_destroy();
xbt_dynar_foreach(result, cpt, file) {
if (SD_task_get_kind(file) == SD_TASK_COMM_E2E) {
uniq_transfer_task_name(file);
+ } else if (SD_task_get_kind(file) == SD_TASK_COMP_SEQ){
+ /* If some tasks do not take files as input, connect them to the root, if
+ * they don't produce files, connect them to the end node.
+ */
+ if ((file != root_task) && xbt_dynar_is_empty(file->tasks_before)) {
+ SD_task_dependency_add(NULL, NULL, root_task, file);
+ }
+ if ((file != end_task) && xbt_dynar_is_empty(file->tasks_after)) {
+ SD_task_dependency_add(NULL, NULL, file, end_task);
+ }
}
}