From 803b51fa5b9a19216ac58a29a315436623432a8d Mon Sep 17 00:00:00 2001 From: jpocurul Date: Tue, 9 Jul 2024 10:58:32 +0200 Subject: [PATCH 1/5] Add relative Y possition in Paraver configurations This commit changes the paraver configurations that are generated automatically so that they don't appear at random positions in the screen. They will appear one on top of the other. --- src/backends/extrae/extrae_type_stack.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/backends/extrae/extrae_type_stack.cpp b/src/backends/extrae/extrae_type_stack.cpp index bf8f5d2..cdadde3 100644 --- a/src/backends/extrae/extrae_type_stack.cpp +++ b/src/backends/extrae/extrae_type_stack.cpp @@ -36,6 +36,8 @@ const std::string ExtraeTypeStackStrategy::paraverConfigOverviewWindow = R"( ################################################################################ window_name neSmiK Annotation Overview window_type single +window_position_x 400 +window_position_y 150 window_width 600 window_height 114 window_comm_lines_enabled false @@ -73,6 +75,8 @@ const std::string ExtraeTypeStackStrategy::paraverConfigLevelWindow = R"( ################################################################################ window_name NESMIK_REPLACE_WINDOW_NAME window_type single +window_position_x 400 +window_position_y NESMIK_REPLACE_WINDOW_Y_POSITION window_width 600 window_height 114 window_comm_lines_enabled false @@ -237,8 +241,11 @@ void ExtraeTypeStackStrategy::Finalize() noexcept { auto replacedEventType = std::regex_replace( paraverConfigLevelWindow, std::regex("NESMIK_REPLACE_EVENT_TYPE"), std::to_string(baseType + level)); + auto replacedWindowYPosition = std::regex_replace( + replacedEventType, std::regex("NESMIK_REPLACE_WINDOW_Y_POSITION"), + std::to_string(150+150*(level+1))); // auto replacedWindowName = std::regex_replace( - replacedEventType, std::regex("NESMIK_REPLACE_WINDOW_NAME"), + replacedWindowYPosition, std::regex("NESMIK_REPLACE_WINDOW_NAME"), windowName); // write Overview -- GitLab From 9d83bc8e07892e1ed2929731cf02a83b3897044b Mon Sep 17 00:00:00 2001 From: jpocurul Date: Tue, 9 Jul 2024 11:09:36 +0200 Subject: [PATCH 2/5] Fixed format --- src/backends/extrae/extrae_type_stack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/extrae/extrae_type_stack.cpp b/src/backends/extrae/extrae_type_stack.cpp index cdadde3..594d83c 100644 --- a/src/backends/extrae/extrae_type_stack.cpp +++ b/src/backends/extrae/extrae_type_stack.cpp @@ -243,7 +243,7 @@ void ExtraeTypeStackStrategy::Finalize() noexcept { std::to_string(baseType + level)); auto replacedWindowYPosition = std::regex_replace( replacedEventType, std::regex("NESMIK_REPLACE_WINDOW_Y_POSITION"), - std::to_string(150+150*(level+1))); // + std::to_string(150 + 150 * (level + 1))); auto replacedWindowName = std::regex_replace( replacedWindowYPosition, std::regex("NESMIK_REPLACE_WINDOW_NAME"), windowName); -- GitLab From f2579c72f53c4d6bedeb0f614fdddfd29ee92ab1 Mon Sep 17 00:00:00 2001 From: JOAN VINYALS YLLA CATALA Date: Tue, 9 Jul 2024 12:07:12 +0200 Subject: [PATCH 3/5] Make it more readable --- src/backends/extrae/extrae_type_stack.cpp | 12 +++++++++--- src/backends/extrae/extrae_type_stack.hpp | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/backends/extrae/extrae_type_stack.cpp b/src/backends/extrae/extrae_type_stack.cpp index 594d83c..db8904f 100644 --- a/src/backends/extrae/extrae_type_stack.cpp +++ b/src/backends/extrae/extrae_type_stack.cpp @@ -78,7 +78,7 @@ window_type single window_position_x 400 window_position_y NESMIK_REPLACE_WINDOW_Y_POSITION window_width 600 -window_height 114 +window_height NESMIK_REPLACE_WINDOW_HEIGHT window_comm_lines_enabled false window_flags_enabled false window_noncolor_mode true @@ -241,12 +241,18 @@ void ExtraeTypeStackStrategy::Finalize() noexcept { auto replacedEventType = std::regex_replace( paraverConfigLevelWindow, std::regex("NESMIK_REPLACE_EVENT_TYPE"), std::to_string(baseType + level)); + auto replacedWindowHeight = std::regex_replace( + replacedEventType, std::regex("NESMIK_REPLACE_WINDOW_HEIGHT"), + std::to_string(paraverConfigWindowHeight_)); auto replacedWindowYPosition = std::regex_replace( - replacedEventType, std::regex("NESMIK_REPLACE_WINDOW_Y_POSITION"), - std::to_string(150 + 150 * (level + 1))); + replacedWindowHeight, std::regex("NESMIK_REPLACE_WINDOW_Y_POSITION"), + std::to_string( + (paraverConfigWindowHeight_ + paraverConfigWindowHeightPad_) * + (level + 2 /* offset with overview window */))); auto replacedWindowName = std::regex_replace( replacedWindowYPosition, std::regex("NESMIK_REPLACE_WINDOW_NAME"), windowName); + // NESMIK_REPLACE_WINDOW_HEIGHT // write Overview outputFile << replacedWindowName; diff --git a/src/backends/extrae/extrae_type_stack.hpp b/src/backends/extrae/extrae_type_stack.hpp index 207894a..616766f 100644 --- a/src/backends/extrae/extrae_type_stack.hpp +++ b/src/backends/extrae/extrae_type_stack.hpp @@ -29,6 +29,9 @@ class ExtraeTypeStackStrategy : public ProperlyNestedAnnotationStrategy { "EXTRAE_WRITE_CONFIG_FILE", "Write corresponding Paraver .cfg file if set to True", false); + inline static const int paraverConfigWindowHeight_ = 115; + inline static const int paraverConfigWindowHeightPad_ = 35; + inline static bool didInitialize{false}; inline static thread_local RegionStackData regionStackData; -- GitLab From 06d067a1011a325b5649911053b4a062ddc7d98d Mon Sep 17 00:00:00 2001 From: JOAN VINYALS YLLA CATALA Date: Tue, 9 Jul 2024 12:19:59 +0200 Subject: [PATCH 4/5] Apply 1 suggestion(s) to 1 file(s) --- src/backends/extrae/extrae_type_stack.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/backends/extrae/extrae_type_stack.cpp b/src/backends/extrae/extrae_type_stack.cpp index db8904f..3ab398f 100644 --- a/src/backends/extrae/extrae_type_stack.cpp +++ b/src/backends/extrae/extrae_type_stack.cpp @@ -252,7 +252,6 @@ void ExtraeTypeStackStrategy::Finalize() noexcept { auto replacedWindowName = std::regex_replace( replacedWindowYPosition, std::regex("NESMIK_REPLACE_WINDOW_NAME"), windowName); - // NESMIK_REPLACE_WINDOW_HEIGHT // write Overview outputFile << replacedWindowName; -- GitLab From 724bcedc7b5314863d8e3dc59c3c4ccaec2f1f4b Mon Sep 17 00:00:00 2001 From: JOSEP POCURULL SERRA Date: Tue, 9 Jul 2024 12:33:39 +0200 Subject: [PATCH 5/5] Looks good. --- src/backends/extrae/extrae_type_stack.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backends/extrae/extrae_type_stack.cpp b/src/backends/extrae/extrae_type_stack.cpp index 3ab398f..a5b5c49 100644 --- a/src/backends/extrae/extrae_type_stack.cpp +++ b/src/backends/extrae/extrae_type_stack.cpp @@ -39,7 +39,7 @@ window_type single window_position_x 400 window_position_y 150 window_width 600 -window_height 114 +window_height NESMIK_REPLACE_WINDOW_HEIGHT window_comm_lines_enabled false window_flags_enabled false window_noncolor_mode true @@ -224,8 +224,11 @@ void ExtraeTypeStackStrategy::Finalize() noexcept { auto overviewReplacedNumLevels = std::regex_replace( paraverConfigOverviewWindow, std::regex("NESMIK_REPLACE_NUM_LEVELS"), std::to_string(numberOfEventTypes)); + auto replacedWindowHeightOverview = std::regex_replace( + overviewReplacedNumLevels, std::regex("NESMIK_REPLACE_WINDOW_HEIGHT"), + std::to_string(paraverConfigWindowHeight_)); auto overviewReplacedAllTypes = - std::regex_replace(overviewReplacedNumLevels, + std::regex_replace(replacedWindowHeightOverview, std::regex("NESMIK_REPLACE_LEVELS"), allTypesString); // write Overview -- GitLab