Singleton tree managing all timer nodes per MPI rank. More...
#include <timer.hpp>
Public Member Functions | |
| void | clear () |
| void | enter_scope (const std::string &name) |
| Enter a new timing scope. | |
| void | exit_scope (double elapsed) |
| Exit the current timing scope and record elapsed time. | |
| std::string | json () |
| Per-rank json tree. | |
| std::string | json_aggregate () |
| MPI-reduced / aggregate json. | |
| void | aggregate_mpi () |
| Aggregate timings across all MPI ranks. | |
Static Public Member Functions | |
| static TimerTree & | instance () |
| Access the singleton instance. | |
Singleton tree managing all timer nodes per MPI rank.
Timer class for the actually starting and stopping timers. Internally Timer objects will access a TimerTree singleton. So you can easily add timer calls without changing the API of your code.Can be exported via json.
Example:
Example output for json(). Note that the root node will always be there carrying no timings.
|
inline |
Aggregate timings across all MPI ranks.
Must be called collectively.
|
inline |
|
inline |
Enter a new timing scope.
|
inline |
Exit the current timing scope and record elapsed time.
|
inlinestatic |
Access the singleton instance.
|
inline |
Per-rank json tree.
Returns a definitely non-reduced timer tree in json format. This means that this returns the process-local timings depending on the process that calls this method.
|
inline |
MPI-reduced / aggregate json.
Returns the timings after reduction over all processes. You need to call aggregate_mpi() before this for reasonable results.
This method does not need to be called collectively.