Caliper icon indicating copy to clipboard operation
Caliper copied to clipboard

Caliper support for builtin Kokkos Tools (continued)

Open mzuzek opened this issue 2 years ago • 5 comments

@ibaned @crtrott This is continuation/extension of https://github.com/LLNL/Caliper/pull/397 by @DavidPoliakoff

Status

  • Done:
    • [x] Support for configuration string in cali::get_event_set()
    • [x] Minor fixes
  • Done by @DavidPoliakoff in https://github.com/LLNL/Caliper/pull/397:
    • [x] Expose Kokkos EventSet via cali::get_event_set() for flexible KokkosTools integration.

Example

See full example that connects Caliper to Kokkos via KokkosTools - using proposed EventSet-based approach:

int main(int argc, char *argv[]) {
  auto eventSet = KokkosTools::get_event_set("caliper",
                                             "runtime-report(profile.kokkos)");
  Kokkos::Tools::Experimental::set_callbacks(eventSet);

  Kokkos::initialize(argc, argv);
  // ... run app ... //
  Kokkos::finalize();
  return 0;
}

mzuzek avatar Dec 02 '21 12:12 mzuzek

Should cali::get_event_set() be exposed in a Caliper header ? If so, which one would be the best for that ?

mzuzek avatar Dec 03 '21 09:12 mzuzek

Hi @MikolajZuzek , thanks for working on this.

Should cali::get_event_set() be exposed in a Caliper header ? If so, which one would be the best for that ?

If it only ever needs to be called from the Kokkos library we can probably just extern it. If it needs to be in a header it's probably best of in its own, like cali_kokkos.h.

For the functions themselves: I think it would be better to name them cali::get_kokkos_event_set and cali::set_kokkos_cali_config() to make it more explicit that they're for Kokkos.

daboehme avatar Dec 07 '21 00:12 daboehme

Hi @daboehme!
Thank you for your answer and suggestions. My apologies for the delay on this reply.

I renamed the functions to what you've suggested, rebased this PR on current master and added some fixes for MSVC.

Let me convert this PR to draft for now: I guess it'll only make sense to merge it together or after https://github.com/kokkos/kokkos-tools/pull/131.

mzuzek avatar Feb 22 '22 23:02 mzuzek

Let me convert this PR to draft for now: I guess it'll only make sense to merge it together or after kokkos/kokkos-tools#131.

Ok, sounds good. Let me know when this is ready to go in.

daboehme avatar Feb 24 '22 03:02 daboehme