X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f0837fbf862b4bbf7f074314f95df143c6285cef..61ab70f5ec5869d57fb0712101280e304d38dcbc:/src/simdag/sd_daxloader.cpp diff --git a/src/simdag/sd_daxloader.cpp b/src/simdag/sd_daxloader.cpp index d2e15eda43..9d542db6a0 100644 --- a/src/simdag/sd_daxloader.cpp +++ b/src/simdag/sd_daxloader.cpp @@ -285,24 +285,20 @@ xbt_dynar_t SD_daxload(const char *filename) 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(nullptr, nullptr, root_task, file); + if ((file != end_task) && xbt_dynar_is_empty(file->tasks_after)) + SD_task_dependency_add(nullptr, nullptr, file, end_task); } 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(nullptr, nullptr, root_task, file); - } - if ((file != end_task) && xbt_dynar_is_empty(file->tasks_after)) { - SD_task_dependency_add(nullptr, nullptr, file, end_task); - } - } else { - THROW_IMPOSSIBLE; - } + THROW_IMPOSSIBLE; } } - if (!acyclic_graph_detail(result)){ + if (!acyclic_graph_detail(result)) { char* base = xbt_basename(filename); XBT_ERROR("The DAX described in %s is not a DAG. It contains a cycle.", base); free(base); @@ -344,7 +340,7 @@ void STag_dax__uses(void) SD_task_t file = static_cast(xbt_dict_get_or_null(files, A_dax__uses_file)); if (file == nullptr) { file = SD_task_create_comm_e2e(A_dax__uses_file, nullptr, size); - xbt_dynar_pop(sd_global->initial_task_set,nullptr); + sd_global->initial_tasks->erase(file); xbt_dict_set(files, A_dax__uses_file, file, nullptr); } else { if (SD_task_get_amount(file) != size) {