diff --git a/src/backends/extrae_partial_tracer/extrae_partial_tracer.cpp b/src/backends/extrae_partial_tracer/extrae_partial_tracer.cpp index 79f069190af1a281c41d9d10e419a81b2774b1c8..b59040c59a40c8c91ebb5ad399ebcba6aeb6f5c3 100644 --- a/src/backends/extrae_partial_tracer/extrae_partial_tracer.cpp +++ b/src/backends/extrae_partial_tracer/extrae_partial_tracer.cpp @@ -19,27 +19,27 @@ ExtraePartialTracer::ExtraePartialTracer() extrae_wrapper_.RegisterTypeWithDescription(type_description_, state_type_); } -void ExtraePartialTracer::shutdown() noexcept { +void ExtraePartialTracer::shutdown(bool annotate) noexcept { if (debug_output_.getValue().value_or(false) && mpi_helper_.IsRankNumber(0)) { std::cout << "neSmiK Partial Tracer: Shutting down" << std::endl; } - extrae_wrapper_.StopWithTypeAndRegionName(state_type_, "ON"); + if (annotate) extrae_wrapper_.StopWithTypeAndRegionName(state_type_, "ON"); Extrae_shutdown(); is_shutdown_ = true; } -void ExtraePartialTracer::start() noexcept { +void ExtraePartialTracer::start(bool annotate) noexcept { if (debug_output_.getValue().value_or(false) && mpi_helper_.IsRankNumber(0)) { std::cout << "neSmiK Partial Tracer: Starting up" << std::endl; } Extrae_restart(); - extrae_wrapper_.StartWithTypeAndRegionName(state_type_, "ON"); + if (annotate) extrae_wrapper_.StartWithTypeAndRegionName(state_type_, "ON"); is_shutdown_ = false; } void ExtraePartialTracer::Init() noexcept { // And pause extrae - shutdown(); + shutdown(true); // then we check the env const auto number_of_names = region_names_env_.getValue().value().size(); @@ -119,7 +119,7 @@ void ExtraePartialTracer::RegionStart( << std::endl; } // We need to startup extrae and emit the region_start event - start(); + start(true); } else { if (debug_output_.getValue().value_or(false) && mpi_helper_.IsRankNumber(0)) { @@ -136,9 +136,11 @@ void ExtraePartialTracer::RegionStart( } else // If we are not running but env is set, we still add it to the trace if (write_all_regions_.getValue().value_or(false)) { - start(); + // We don't want to annotate this start and shutdownd as it is + // conceptually turned of. + start(false); type_stack_strategy_->RegionStart(region); - shutdown(); + shutdown(false); } } @@ -152,9 +154,11 @@ void ExtraePartialTracer::RegionStopLast( } else // If were shutdown we still add it if the env is set if (write_all_regions_.getValue().value_or(false)) { - start(); + // We don't want to annotate this start and shutdownd as it is + // conceptually turned of. + start(false); type_stack_strategy_->RegionStopLast(region); - shutdown(); + shutdown(false); } std::vector matching_jobs; @@ -184,7 +188,7 @@ void ExtraePartialTracer::RegionStopLast( << std::endl; } // We need to stop extrae - shutdown(); + shutdown(true); } else { if (debug_output_.getValue().value_or(false) && mpi_helper_.IsRankNumber(0)) { diff --git a/src/backends/extrae_partial_tracer/extrae_partial_tracer.hpp b/src/backends/extrae_partial_tracer/extrae_partial_tracer.hpp index d613fd75c4b5de5010c5ea79a7419b03e5495f4e..5b7d74d1c90982ebfc0b14b9ba3707ed46aaaf0c 100644 --- a/src/backends/extrae_partial_tracer/extrae_partial_tracer.hpp +++ b/src/backends/extrae_partial_tracer/extrae_partial_tracer.hpp @@ -55,8 +55,8 @@ class ExtraePartialTracer : public ProperlyNestedAnnotationStrategy { bool is_shutdown_{true}; ExtraeWrapper extrae_wrapper_; std::unique_ptr type_stack_strategy_; - void shutdown() noexcept; - void start() noexcept; + void shutdown(bool annotate) noexcept; + void start(bool annotate) noexcept; const actual_extrae_type state_type_{82000}; const std::string type_description_ = "Extrae::PartialTracer State";