From ed1ac1aa8781205d99403c293dd41d062cf8536f Mon Sep 17 00:00:00 2001 From: Abdoulbari Zaher <32519851+a-zakir@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:45:46 +0100 Subject: [PATCH 1/2] use only area file in Benders (#960) adequacy_criterion --> outerloop area file -->Benders --- src/cpp/benders/factories/BendersFactory.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cpp/benders/factories/BendersFactory.cpp b/src/cpp/benders/factories/BendersFactory.cpp index b776abc1c..b416dbe03 100644 --- a/src/cpp/benders/factories/BendersFactory.cpp +++ b/src/cpp/benders/factories/BendersFactory.cpp @@ -183,7 +183,9 @@ BendersMainFactory::ProcessCriterionInput() { const auto fpath = std::filesystem::path(options_.INPUTROOT) / options_.OUTER_LOOP_OPTION_FILE; // if adequacy_criterion.yml is provided read it - if (std::filesystem::exists(fpath)) { + if ((method_ == BENDERSMETHOD::BENDERS_OUTERLOOP || + method_ == BENDERSMETHOD::BENDERS_BY_BATCH_OUTERLOOP) && + std::filesystem::exists(fpath)) { return Benders::Criterion::OuterLoopInputFromYaml().Read(fpath); } // else compute criterion for all areas! From 48e14747d9ea8cb08d817bf614dc551282a8ccc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jason=20Mar=C3=A9chal?= <45510813+JasonMarechal25@users.noreply.github.com> Date: Wed, 30 Oct 2024 15:26:38 +0100 Subject: [PATCH 2/2] Target to generate graph (#947) Add a "graphviz" target to generate dot, png and svg files representing CMake dependency graph. --- CMakeGraphVizOptions.cmake | 3 +++ CMakeLists.txt | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/CMakeGraphVizOptions.cmake b/CMakeGraphVizOptions.cmake index e69de29bb..4fd047468 100644 --- a/CMakeGraphVizOptions.cmake +++ b/CMakeGraphVizOptions.cmake @@ -0,0 +1,3 @@ +set(GRAPHVIZ_GENERATE_PER_TARGET FALSE) +set(GRAPHVIZ_IGNORE_TARGETS ".*test.*") +set(GRAPHVIZ_EXTERNAL_LIBS FALSE) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 6faf48e68..800819773 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -407,3 +407,10 @@ endif () #version file to define Xpansion and Antares-simulator versions configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/python/antares_xpansion/__version__.py.in ${CMAKE_CURRENT_SOURCE_DIR}/src/python/antares_xpansion/__version__.py) include(CPack) + +add_custom_target(graphviz + COMMAND ${CMAKE_COMMAND} "--graphviz=xpansion.dot" . + COMMAND dot -Tsvg xpansion.dot -o xpansion.svg + COMMAND dot -Tpng xpansion.dot -o xpansion.png + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" +)