From 5d4ddd2bba5d37272aefa3108883a526b645be78 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Wed, 17 May 2017 08:28:42 +0200 Subject: [PATCH] don't create dependencies if both root and end are not connected to any task This happens when none of the actual jobs described in the DAX file consumes and produces any file. In that case, root has no successor and a dependency to end is created but end has no predecessor and a dependency from root is created ... that already exists. --- src/simdag/sd_daxloader.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/simdag/sd_daxloader.cpp b/src/simdag/sd_daxloader.cpp index 4a83abd776..543cb63ce3 100644 --- a/src/simdag/sd_daxloader.cpp +++ b/src/simdag/sd_daxloader.cpp @@ -237,12 +237,14 @@ 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; } } -- 2.20.1