Skip to content

Unify APEX tracing backend under hpx::tracing API#7293

Open
v4xsh wants to merge 15 commits into
TheHPXProject:masterfrom
v4xsh:tracing-apex-unification
Open

Unify APEX tracing backend under hpx::tracing API#7293
v4xsh wants to merge 15 commits into
TheHPXProject:masterfrom
v4xsh:tracing-apex-unification

Conversation

@v4xsh
Copy link
Copy Markdown
Contributor

@v4xsh v4xsh commented May 23, 2026

Proposed Changes

  • Integrate the APEX tracing backend into the unified hpx::tracing layer, replacing scattered HPX_HAVE_APEX handling across runtime call sites.
  • Wire the tracing module into the core futures and runtime_local targets, and clean up the Tracy setup path so tracing target usage stays consistent.
  • Break the tracing / threading_base dependency cycle by keeping the APEX-specific timer implementation safely within external_timer.cpp.
  • Migrate key execution paths to the unified tracing API, including thread scheduling, task execution, runtime startup/finalization, parcel send/receive handling, distributed action posting, and performance counter sampling.
  • Replace older APEX annotation plumbing with task_timer_data and 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::tracing interface. Before this, APEX-specific hooks and HPX_HAVE_APEX conditionals were heavily spread across threading, 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_base external 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.

  • I have added a new feature and have added tests to go along with it.
  • I have fixed a bug and have added a regression test.
  • I have added a test using random numbers; I have made sure it uses a seed, and that random numbers generated are valid inputs for the tests.

v4xsh added 9 commits May 24, 2026 01:11
Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
@v4xsh v4xsh requested a review from hkaiser as a code owner May 23, 2026 20:00
Copilot AI review requested due to automatic review settings May 23, 2026 20:00
@StellarBot
Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 23, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
@v4xsh v4xsh force-pushed the tracing-apex-unification branch from 48d0980 to 3d3cc5f Compare May 23, 2026 20:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@hkaiser
Copy link
Copy Markdown
Contributor

hkaiser commented May 23, 2026

@v4xsh inspect reports:

/libs/core/threading_base/src/external_timer.cpp: *I* missing #include (string) for symbol std::string on line 155

#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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make these functions 100% no-ops if APEX is disabled?

@@ -10,6 +10,21 @@
#include <hpx/config.hpp>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're at the point where we can separate the code for the various backends into separate header files.

v4xsh added 4 commits May 24, 2026 06:41
…of APEX guard

Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
…r unconditional no-ops

Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
…separate headers

Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
… backends from global module generation

Signed-off-by: v4xsh <vanshdobhal11@gmail.com>
@v4xsh v4xsh force-pushed the tracing-apex-unification branch from e495f6a to c5d8084 Compare May 24, 2026 01:23
@v4xsh
Copy link
Copy Markdown
Contributor Author

v4xsh commented May 24, 2026

@hkaiser Kindly have a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants