X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dccf1b41e9c7b5a696f01abceaa2779fe65f154f..983a8a691054ecec4cdc7d3a932942520f834f43:/src/simdag/sd_daxloader.cpp diff --git a/src/simdag/sd_daxloader.cpp b/src/simdag/sd_daxloader.cpp index 4a83abd776..eae376c635 100644 --- a/src/simdag/sd_daxloader.cpp +++ b/src/simdag/sd_daxloader.cpp @@ -67,7 +67,7 @@ bool acyclic_graph_detail(xbt_dynar_t dag){ current.push_back(task); } } - while(!current.empty()){ + while (not current.empty()) { std::vector next; for (auto t: current){ //Mark task @@ -98,16 +98,16 @@ bool acyclic_graph_detail(xbt_dynar_t dag){ } } - if(!all_marked){ + if (not all_marked) { XBT_VERB("there is at least one cycle in your task graph"); xbt_dynar_foreach(dag,count,task){ if(task->kind != SD_TASK_COMM_E2E && task->predecessors->empty() && task->inputs->empty()){ - task->marked = 1; - current.push_back(task); + task->marked = 1; + current.push_back(task); } } //test if something has to be done for the next iteration - while(!current.empty()){ + while (not current.empty()) { std::vector next; //test if the current iteration is done for (auto t: current){ @@ -237,16 +237,18 @@ xbt_dynar_t SD_daxload(const char *filename) /* 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) && file->inputs->empty()) - SD_task_dependency_add(nullptr, nullptr, root_task, file); - if ((file != end_task) && file->outputs->empty()) - SD_task_dependency_add(nullptr, nullptr, file, end_task); + if ((file != root_task) && (file != end_task)) { + if (file->inputs->empty()) + SD_task_dependency_add(nullptr, nullptr, root_task, file); + if (file->outputs->empty()) + SD_task_dependency_add(nullptr, nullptr, file, end_task); + } } else { - THROW_IMPOSSIBLE; + THROW_IMPOSSIBLE; } } - if (!acyclic_graph_detail(result)) { + if (not 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);