Caliper support for builtin Kokkos Tools #397
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So far this is just a proposal, but we're looking to support a more ubiquitous tools model at Sandia. This is partially inspired by @ibaned , so I'll ping him here
In order to support that, we're going to essentially build a huge tools bundle, users can include Caliper, Apollo, APEX, TAU, whatever they want. A problem with this is that it means we might have multiple tools linked into the same library, all defining
kokkosp_begin_parallel_for
. Oops. Easy answer, just declare the symbol weak! Except now Caliper's kokkosp_begin_parallel_for gets replaced with Score-P's, which is, you know, suboptimal.The solution I've come up with, is that there will be a weak, unnamespaced, kokkosp_begin_parallel_for, which just calls the namespaced cali::kokkosp_begin_parallel_for (we can negotiate on the namespace name). There's also a function to return a Kokkos EventSet (note: this does not incur a dependency on a built Kokkos), which calls the correct
cali::kokkosp_begin_parallel_for
.Now, for our existing users, nothing really changes, they dlopen Caliper, it's the only
kokkosp_begin_parallel_for
in the app, they call it, which callscali::kokkosp_begin_parallel_for
.Meanwhile in the bundled situation, that bundle calls
cali::get_event_set
(andapollo::get_event_set
, once it exists, and TAU, and, and, and...), and registers all of these tools with Kokkos. Then they can pick out a tool by name. On a user's side, they can write something likeAnd then get the functionality they want. I'm putting this up so you can tell me if the code is just too atrocious for words, but I wouldn't merge it until you get a comment from @crtrott saying "yeah, this is the design we want," which might be after I leave. But let me know if you'd like code fixes