axom icon indicating copy to clipboard operation
axom copied to clipboard

Adds annotations API and macros to axom

Open kennyweiss opened this issue 10 months ago • 0 comments

Summary

  • This PR is a feature
  • It adds an annotations API to support profiling in Axom
  • It relies on caliper for performance profiling and adiak for capturing metadata
  • It replaces the old performance profiling macros (AXOM_PERF_MARK_{SECTION,FUNCTION}) with new ones
    • AXOM_ANNOTATE_BEGIN(name) -- begins an annotation region
    • AXOM_ANNOTATE_END(name) -- ends an annotation region
    • AXOM_ANNOTATE_SCOPE(name) -- begins an annotation region that will automatically end at the end of the current scope
    • AXOM_ANNOTATE_METADATA(key,value,category) -- adds a key/value pair of metadata to the run
    • Note: Due to how AXOM_PERF_MARK_SECTION was implemented, this adds a bunch of whitespace changes. I'd suggest reviewing with GitHub's "Hide Whitespace"
  • It incorporates annotations into a few quest examples -- quest_containment, shaping and quest_marching_cubes
    • We can add these to more of axom in follow-up PRs.
  • Also adds simple RAII wrapper classes for intializing/finalizing MPI (axom::utilities::raii::MPIWrapper) and the annotations (axom::utilities::raii::AnnotationsWrapper) and incorporates them into a few examples.
    • We can add these to more of axom in follow-up PRs.
  • Resolves #142

TODO:

  • [ ] Check if core still needs an explicit dependency on nvToolsExt, of if this dependency now comes from caliper (when available)
  • [ ] Add examples of annotations output
    • [ ] ... with report service,
    • [ ] ... with the counts service
    • [ ] ... with the nvtx service
  • [ ] I got this running with the roctx service, but had trouble viewing the results (w/ chrome's profiler and with perfetto). We should probably resolve this in a follow up PR. I added a [email protected] host-config on rzvernal to see if a newer version would help, but it did not.

I will add a follow-up documentation PR after these changes have been reviewed/accepted.

kennyweiss avatar Apr 07 '24 22:04 kennyweiss