Library to instrument a code with timers and report the results in a tree view. Works with multiple threads (incl. OpenMP).
- Build with
CMake
. - Contains tests based on
google test
, which is downloaded automatically during CMake generation time. Test targets and google test framework are only built ifVT_TIMERS_ENABLE_TESTS
is switchedON
. - Requires a C++11 compiler. Tested with Visual Studio 2015 and GCC under linux. Compiles with MinGW, but crashes, see below.
- There is a bug in C++11
thread_local
storage with the MinGW compiler, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83562 and ChaiScript/ChaiScript#402. Confirmed with 32 and 64 bit variants of MinGW 8.1.0.
- add Fortran interface
- reconsider the use of
std::map
(e.g. isstd::unordered_map
better? should we build our own data structure based on indices instead of key-value pairs based on strings?) - include cpu time (user, other)
- add a scoped timer, to ensure exception safety
- aggregate timers from different threads
- does it work with other compilers, e.g. Clang?
- does it work with pthreads?
- add option to disable all timer function calls (e.g. via a preprocessor define that may or may not include
#if 0
) - add option to disable all error checking code (e.g. via a preprocessor define)
- ensure correct workings with shared libraries (in view of
static
andstatic thread_local
usage) - use python to visualize a timing report
- suggestion: if we encouter problems, it may be useful to consider omp threadlocal variables.
This code was inspired and partially based on the Fortran code TimeKeeper
developed at VORtech (Delft).
This software is licensed under the MIT license, see LICENSE.MIT.