This repo provides a convenience wrapper for instrumenting source code using SALT-FM and Perfstubs. SALT-FM inserts Perfstubs timer hooks into every function, which can be detected by TAU at runtime.
First, install SALT-FM on top of the salt-dev Docker environment. (Unfortunately this is a large image. ):
./build-docker-dev-with-salt.sh
To instrument the code, use
./salt-instrument.sh <source directory>
This will create a recursive copy of the source directory with name ${source_directory}_inst and replace code files with instrumented versions.
To build the instrumented code, install perfstubs either manually or via spack.
To your include paths, add -I/path/to/installof/perfstubs/include -I/path/to/this/repo (the latter is needed for the timer_wrap_gpu.h header which works around compilation issues with GPU kernels and enables the perfstubs timers).
To your link line, add -L/path/to/installof/perfstubs/lib -lperfstubs
The resulting compiled executables should now be instrumented and ready for tau_exec.