amrex
amrex copied to clipboard
added timing stats for I/O operations
Summary
Added timing output for HDF5Benchmark, for example, it will output:
AMReX (22.03-16-gdfb0e098df46-dirty) initialized Writing plot file [plt00000.h5] ... done max 5.305e-03s avg 5.303e-03s min 5.300e-03s dev 2.679e-06s Writing plot file [plt00001.h5] ... done max 2.166e-03s avg 2.164e-03s min 2.162e-03s dev 1.866e-06s Init particles ... done Writing particle file [plt00000/particle0.h5] ... done max 3.722e-03s avg 3.717e-03s min 3.712e-03s dev 4.875e-06s AMReX (22.03-16-gdfb0e098df46-dirty) finalized
Additional background
Checklist
The proposed changes:
- [ ] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX users
- [ ] include documentation in the code and/or rst files, if appropriate
I think you could use the light-weight tiny profiler for this: https://amrex-codes.github.io/amrex/docs_html/AMReX_Profiling_Tools_Chapter.html
It's easy to add, see for example: https://github.com/ECP-WarpX/impactx/pull/155
I agree with Axel. I'd use the TinyProfiler, which uses a high-precision timer, only stores the data when triggered, and does reductions in Finalize, for test codes in the AMReX repo.
That way, we don't confuse users and potentially lead them down a different road if they take a look at the test or use it as a copy-and-paste starting blueprint.
Agreed, TinyProfiler looks promising. I'll re-work the PR to use it instead. Thanks.