AMReX-Codes / amrex

AMReX: Software Framework for Block Structured AMR
https://amrex-codes.github.io/amrex
Other
506 stars 337 forks source link

TinyProfiler: output in JSON format #3904

Open BenWibking opened 2 months ago

BenWibking commented 2 months ago

The built-in profiler provides very useful data, but it is difficult to perform in-depth analysis with Python scripts.

It would be very useful if the profiler could also output its results in Caliper's JSON (https://software.llnl.gov/Caliper/OutputFormats.html#json-split) or JSON-split (https://software.llnl.gov/Caliper/OutputFormats.html#json-split) format.

These are formats that Hatchet (https://github.com/LLNL/hatchet) could read and turn into Pandas DataFrames.

BenWibking commented 2 months ago

If this is a feature that would be considered merge-able, I could prototype this given a few pointers on where to start in the profiler code.

WeiqunZhang commented 2 months ago

Yes, that would be great. For TinyProfiler, the output is done in TinyProfiler::PrintStats. You can modify it to additionally output the results in a separate file.

BenWibking commented 2 months ago

I've moved the BLProfiler trace output to a separate issue: https://github.com/AMReX-Codes/amrex/issues/3916.