diff --git a/src/backends/extrae/extrae_type_stack.cpp b/src/backends/extrae/extrae_type_stack.cpp index 94e89a60aae3f0fd12d2e3891953d60e6e7f6be3..be8be21208c0899c415ce5cac53fc54a0dbc0e6a 100644 --- a/src/backends/extrae/extrae_type_stack.cpp +++ b/src/backends/extrae/extrae_type_stack.cpp @@ -13,12 +13,10 @@ extern "C" { #include } -ExtraeTypeStackStrategy::ExtraeTypeStackStrategy() { +ExtraeTypeStackStrategy::ExtraeTypeStackStrategy() : mpi_helper_{} { parallelism_descriptor_ = { .mpi_descriptor_ = MPIDescriptor::Aware, - .thread_descriptor_ = - ThreadDescriptor::Supported // i guess no test currently for this - }; + .thread_descriptor_ = ThreadDescriptor::Unsupported}; } const std::string ExtraeTypeStackStrategy::paraverConfigHead = R"( @@ -119,6 +117,7 @@ void ExtraeTypeStackStrategy::Init() noexcept { // https://github.com/bsc-performance-tools/extrae/blob/daee11a2f98e301eb146608f51df0c844e1ff381/include/extrae_types.h#L33 Extrae_init(); didInitialize = true; + std::cout << "NESMIK forced to Initialize extrae" << std::endl; } } @@ -204,7 +203,8 @@ void ExtraeTypeStackStrategy::Finalize() noexcept { routine_c_names); } - if (write_config_file_.getValue().value_or(write_config_file_default_)) { + if (write_config_file_.getValue().value_or(write_config_file_default_) && + mpi_helper_.IsRankNumber(0)) { std::string fileName = "nesmik_annotations.cfg"; std::ofstream outputFile; outputFile.open(fileName); diff --git a/src/backends/extrae/extrae_type_stack.hpp b/src/backends/extrae/extrae_type_stack.hpp index 616766f74b6511976214f57ef8489a5cfb66eb17..df59582b596a63f58982b412a0a04707810fd6fb 100644 --- a/src/backends/extrae/extrae_type_stack.hpp +++ b/src/backends/extrae/extrae_type_stack.hpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "strategies.hpp" // #include @@ -32,6 +33,8 @@ class ExtraeTypeStackStrategy : public ProperlyNestedAnnotationStrategy { inline static const int paraverConfigWindowHeight_ = 115; inline static const int paraverConfigWindowHeightPad_ = 35; + MPIHelper mpi_helper_; + inline static bool didInitialize{false}; inline static thread_local RegionStackData regionStackData;