Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caliper support for builtin Kokkos Tools #397

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DavidPoliakoff
Copy link
Contributor

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 calls cali::kokkosp_begin_parallel_for.

Meanwhile in the bundled situation, that bundle calls cali::get_event_set (and apollo::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 like

auto tools_handle = BigOlKokkosToolsBundle::gimme_all_your_tools();
Kokkos::Tools::here_are_some_tools(tools_handle);
Kokkos::Tools::activate_tool("caliper", "spot2(profile.kokkos)");
Kokkos::initialize(argc, argv);

And 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant