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

Runtime report as json #403

Closed
PhilipDeegan opened this issue Dec 8, 2021 · 7 comments
Closed

Runtime report as json #403

PhilipDeegan opened this issue Dec 8, 2021 · 7 comments

Comments

@PhilipDeegan
Copy link

Hi,

We'd like to have the capacity to parse our reports, is there a way to get them in json or yaml or something?

I mean via "CALI_CONFIG="runtime-report"

I can't seem to get any output with other env var options

@daboehme
Copy link
Member

daboehme commented Dec 8, 2021

Hi @PhilipDeegan , you can try the hatchet-region-profile config to get machine-readable region profile output. By default it writes a custom JSON format that can be readily analyzed with the Hatchet Python library. Alternatively, the output.format=json option writes a more simple JSON format that should be easy to parse with custom scripts:

CALI_CONFIG="hatchet-region-profile,output.format=json"

@PhilipDeegan
Copy link
Author

thanks for the reply, I'll give that a shot,

@PhilipDeegan
Copy link
Author

sorry to necropost this @daboehme

but could you tell me if there's a way to get a json line per call, so that the output does not aggregate

I'm trying to see how the functions run over time, so I need a per call time

thanks

I can make a new issue if needed

@daboehme
Copy link
Member

Hi @PhilipDeegan, looks like you want a trace. This https://software.llnl.gov/Caliper/EventTracing.html shows how to record a trace with the event-trace config, which you can convert into a Perfetto/ChromeTracing file. You can also run cali-query -j -o out.json <file.cali> on the generated .cali trace file to get a simple json format with one record for each region begin/end.

If you want to generate the json file directly without the intermediate .cali file you can try

CALI_SERVICES_ENABLE=event,trace,timer,report
CALI_REPORT_CONFIG="format json"
CALI_REPORT_FILENAME=trace.json

@PhilipDeegan
Copy link
Author

Thanks @daboehme

Trying out the bottom config, it's not clear to me why event.begin#region has a time, as the scope hasn't executed?
and second, I don't have view of which mpi_rank makes this call as in the hatchet region profile

@daboehme
Copy link
Member

daboehme commented Apr 11, 2024

The time for event.begin#region events is the time since the previous event (or, for the first region, the time since Caliper was initialized). Note that these are exclusive times, if you need inclusive times (i.e. the total time in a each region including its children) add CALI_TIMER_INCLUSIVE_DURATION=true. For the MPI rank add mpi to the CALI_SERVICES_ENABLE list. If there are multiple MPI ranks you may want to do something like CALI_REPORT_FILENAME=trace_%mpi.rank%.json to generate a separate file per process.

@PhilipDeegan
Copy link
Author

thanks @daboehme !

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

No branches or pull requests

2 participants