Skip to content

SimpleKernelTimer enhancement #277

Description

@dutkalex

Hi folks!
The SimpleKernelTimer is very handy for quick profilings, but I find the output hard to read when profiling regions are nested. Consider the following code example:

Kokkos::Profiling::pushRegion("MyKokkosApp");

  Kokkos::Profiling::pushRegion("Initialization");
  // ...
  Kokkos::Profiling::popRegion();

  Kokkos::Profiling::pushRegion("Solve");
  // ...
    Kokkos::Profiling::pushRegion("Foo");
    // ...
    Kokkos::Profiling::popRegion();
  // ...
    Kokkos::Profiling::pushRegion("Bar");
    // ...
    for (int i=0; i < N; ++i){
      Kokkos::Profiling::pushRegion("BarLoop");
      // ...
      Kokkos::Profiling::popRegion();
    }
    // ...
    Kokkos::Profiling::popRegion();  
  // ...
  Kokkos::Profiling::popRegion();
  
Kokkos::Profiling::popRegion();

The output show currently shows all the regions as one big flat list, which is hard to analyze. It be much clearer if the formatting took into account the hierarchical structure of the regions. The output could look something like the following:

 (Type)   Total Time, Call Count, Avg. Time per Call, %Total Time in Kernels, %Total Program Time
-------------------------------------------------------------------------

Regions:

+ MyKokkosApp
|  (REGION)                       ...
|    + Solve
|    |  (REGION)                  ...
|    |    + Bar
|    |    |  (REGION)             ...
|    |    |    - BarLoop
|    |    |       (REGION)        ...
|    |    |    - Other
|    |    |       (REGION)        ...
|    |  - Foo
|    |     (REGION)               ...
|    |  - Other
|    |     (REGION)               ...
|    - Initialization
|       (REGION)                  ...
|    - Other
|       (REGION)                  ...

What do you think of this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions