diff --git a/src/backends/extrae_partial_tracer/extrae_partial_tracer.cpp b/src/backends/extrae_partial_tracer/extrae_partial_tracer.cpp index d2efb16fbaef79de742c29a37d67ebe7f388bcde..79f069190af1a281c41d9d10e419a81b2774b1c8 100644 --- a/src/backends/extrae_partial_tracer/extrae_partial_tracer.cpp +++ b/src/backends/extrae_partial_tracer/extrae_partial_tracer.cpp @@ -79,6 +79,12 @@ void ExtraePartialTracer::Init() noexcept { << job.stop_at << "}" << std::endl; } } + if (mpi_helper_.IsRankNumber(0) && + write_all_regions_.getValue().value_or(false)) { + std::cout << "neSmiK Extrae::PartialTracer: Tracing neSmiK regions events " + "even though tracing might be off for that region." + << std::endl; + } } void ExtraePartialTracer::RegionStart( @@ -99,7 +105,7 @@ void ExtraePartialTracer::RegionStart( if (matching_jobs.size() > 1) { std::cout << "neSmiK Extrae::PartialTracer: Found multiple matching jobs, please " - "dont duplicate region names with the same start iteration" + "don't duplicate region names with the same start iteration" << std::endl; Terminator::exit(); } @@ -127,17 +133,29 @@ void ExtraePartialTracer::RegionStart( // if were running call extrae backend if (!is_shutdown_) { type_stack_strategy_->RegionStart(region); - } + } 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(); + type_stack_strategy_->RegionStart(region); + shutdown(); + } } void ExtraePartialTracer::RegionStopLast( const ProperlyNestedRegionInformation ®ion) noexcept { const std::string region_name = std::string(region.name); + // We add because were not shutdown if (!is_shutdown_) { - std::cout << "Region stop last " << region.name << std::endl; type_stack_strategy_->RegionStopLast(region); - } + } else + // If were shutdown we still add it if the env is set + if (write_all_regions_.getValue().value_or(false)) { + start(); + type_stack_strategy_->RegionStopLast(region); + shutdown(); + } std::vector matching_jobs; for (const auto &job : jobs_) { diff --git a/src/backends/extrae_partial_tracer/extrae_partial_tracer.hpp b/src/backends/extrae_partial_tracer/extrae_partial_tracer.hpp index b4cbe5ad2a4979457d711c36582657fe8ee01111..d613fd75c4b5de5010c5ea79a7419b03e5495f4e 100644 --- a/src/backends/extrae_partial_tracer/extrae_partial_tracer.hpp +++ b/src/backends/extrae_partial_tracer/extrae_partial_tracer.hpp @@ -42,6 +42,12 @@ class ExtraePartialTracer : public ProperlyNestedAnnotationStrategy { "EXTRAE_WRITE_CONFIG_FILE", "Write corresponding Paraver .cfg file if set to True", false); + EnvironmentVariable write_all_regions_ = + EnvironmentVariable("PARTIAL_TRACER_ADD_ALL_REGIONS", + "Write all regions into the trace, even though " + "extrae might not be tracing for all of them", + false); + MPIHelper mpi_helper_; std::unordered_map region_counter_starts_; std::unordered_map region_counter_stops_;