Unify APEX tracing backend under hpx::tracing API#7293
Conversation
Signed-off-by: v4xsh <[email protected]>
Signed-off-by: v4xsh <[email protected]>
Signed-off-by: v4xsh <[email protected]>
Signed-off-by: v4xsh <[email protected]>
Signed-off-by: v4xsh <[email protected]>
Signed-off-by: v4xsh <[email protected]>
Signed-off-by: v4xsh <[email protected]>
Signed-off-by: v4xsh <[email protected]>
Signed-off-by: v4xsh <[email protected]>
|
Can one of the admins verify this patch? |
Up to standards ✅🟢 Issues
|
Signed-off-by: v4xsh <[email protected]>
48d0980 to
3d3cc5f
Compare
|
@v4xsh inspect reports: |
| #if defined(HPX_HAVE_APEX) | ||
| std::shared_ptr<util::external_timer::task_wrapper> get_timer_data() | ||
| const noexcept | ||
| hpx::tracing::task_timer_data get_timer_data() const noexcept |
There was a problem hiding this comment.
Can we make these functions 100% no-ops if APEX is disabled?
…of APEX guard Signed-off-by: v4xsh <[email protected]>
…r unconditional no-ops Signed-off-by: v4xsh <[email protected]>
…separate headers Signed-off-by: v4xsh <[email protected]>
e495f6a to
c5d8084
Compare
|
@hkaiser Kindly have a look! |
b67c64f to
f962b7b
Compare
|
Kindly let me know if any further changes are required! |
…ess specifier Signed-off-by: v4xsh <[email protected]>
77be55f to
9f4918c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (2)
libs/full/performance_counters/src/query_counters.cpp:1
- The counter short name is recomputed on every sample via
remove_counter_prefix, even for backends that ignoreshort_name(e.g., ITTNotify here ignores the second parameter). This adds avoidable per-sample string work on a potentially hot path; consider cachingfull_name -> short_nameonce (e.g., atcreate_countertime) or moving the mapping insidehpx::tracingsosample_counteronly needs(full_name, value)for all backends.
libs/full/performance_counters/src/query_counters.cpp:1 - The previous suppression of console output when ITTNotify/Tracy backends were active was removed (the
destination_is_coutchecks). This changes runtime behavior by potentially producing duplicated output (console + tracing backend) or console noise in profiling runs; if the old behavior is still desired, reintroduce a backend-awareno_outputadjustment (ideally via a singlehpx::tracingquery rather than backend-specific#ifs).
f37c2f3 to
dd2409c
Compare
…tprint overhead Signed-off-by: v4xsh <[email protected]>
1ea1c38 to
4ee7137
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
libs/full/performance_counters/src/query_counters.cpp:1
- This PR removes the prior behavior that suppressed console output when ITTNotify or Tracy backends were active (previously
no_outputwas forced forcoutdestinations). With the newhpx::tracingrouting, users may now get unexpected/duplicate output while also emitting tracing counter samples. If the suppression is still desired, reintroduce it behind the relevant compile-time backend macros or provide ahpx::tracingquery (e.g. 'is_counter_backend_external') to keep the behavior consistent.
|
@v4xsh things start to look reasonable. Could you please have a look at the Copilot comments to see if those are applicable/sensible? |
…nk semantics Signed-off-by: v4xsh <[email protected]>
Signed-off-by: v4xsh <[email protected]>
4ba3699 to
2449051
Compare
Done! |
Signed-off-by: v4xsh <[email protected]>
5a028a5 to
a0e25eb
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
libs/full/performance_counters/src/query_counters.cpp:1
- The PR removes the previous behavior that suppressed console output (
destination_is_cout) when using ITTNotify/Tracy counter backends. This is an observable behavior change: runs that previously only reported counters via the tracing backend may now also print periodically to stdout, which can be noisy and affect jobs that parse stdout. If the suppression is still desired with the unified tracing API, consider adding ahpx::tracingquery (e.g., 'is_counter_backend_active' / 'wants_console_output_suppressed') and restoring the conditional suppression here.
…nment Signed-off-by: v4xsh <[email protected]>
643f8f4 to
92994cd
Compare
Signed-off-by: v4xsh <[email protected]>
f26cb88 to
466326f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
libs/full/performance_counters/src/query_counters.cpp:1
remove_counter_prefixis now executed unconditionally for all tracing backends, even though some backends (e.g., ITTNotify and APEX in this PR) ignoreshort_nameinsample_counter. This introduces avoidable string processing on every sample. Consider caching theshort_nameatcreate_countertime inside the tracing backend (keyed byfull_name), or only computingreal_namewhen the selected backend requires it.
| HPX_CXX_CORE_EXPORT HPX_CORE_EXPORT task_timer_data create_task_timer( | ||
| threads::thread_description const& description, | ||
| std::uint32_t parent_locality_id, | ||
| threads::thread_id const& parent_task); |
| itt_counters_.insert(std::make_pair(full_name, | ||
| util::itt::counter(short_name.c_str(), | ||
| hpx::detail::thread_name().c_str(), | ||
| __itt_metadata_double))); |
Signed-off-by: v4xsh <[email protected]>
c83153a to
d108ffa
Compare
Proposed Changes
hpx::tracinglayer, replacing scatteredHPX_HAVE_APEXhandling across runtime call sites.futuresandruntime_localtargets, and clean up the Tracy setup path so tracing target usage stays consistent.tracing/threading_basedependency cycle by keeping the APEX-specific timer implementation safely withinexternal_timer.cpp.task_timer_dataand no-op fallback paths so tracing stays strictly lightweight when the backend is disabled.Any background context you want to provide?
This PR completes the APEX side of the tracing unification by moving APEX runtime instrumentation behind the common
hpx::tracinginterface. Before this, APEX-specific hooks andHPX_HAVE_APEXconditionals were heavily spread acrossthreading,parcelset,actions,counters, and runtime initialization code.With this change, those call sites use the shared tracing API instead, while the APEX-specific implementation is kept delegated to the
threading_baseexternal timer implementation. This makes the instrumentation significantly easier to maintain, reduces direct coupling between modules, and keeps disabled tracing paths as lightweight zero-overhead fallbacks.Checklist
Not all points below apply to all pull requests.