Hawkeye
Tool Overview
There is a large number of repeated instrumentation during precision tuning. Hawkeye can improve the analysis efficiency. Hawkeye is developed based on the debugging function of the GNU Debugger (GDB). It can automatically instrument functions, call traversal recursion function, and automatically record functions with calculation differences. Download URL: https://gitee.com/openeuler/hpcrunner/tree/master/software/utils/hawkeye.

Constraints
This tool uses the GDB debugging function and depends on the symbol table in the binary file. Change the optimization level of the compilation option to -O0 and add the -g option to the application to be analyzed.
This tool supports only single-thread debugging and does not support OpenMP.
Usage Guide
The following uses WRF 3.4.1 as an example.
- Change the optimization level to -O0 and modify compilation options by adding -g and deleting -fopenmp and -qopenmp.
- Link the WRF application to the print_md5.o static library. The static library can read and write input values and calculate output MD5. You are advised to place the static library and wrf.exe in the same directory. You can also specify a directory.
Modify the main/Makefile file.
Before modification: $(LD) -o wrf.exe $(LDFLAGS) -fopenmp wrf.o ../main/module_wrf_top.o $(LIBWRFLIB) $(LIB)
After modification: $(LD) -o wrf.exe $(LDFLAGS) -lcrypto print_md5.o wrf.o ../main/module_wrf_top.o $ (LIBWRFLIB) $(LIB)
- Place the WRF binary computing test case and Hawkeye in the same directory. Specify the application name and main function file path to run Hawkeye.
./hawkeye.sh wrf.exe wrf-3.4.1/dyn_em/solve_em.f90
Figure 2 Hawkeye analysis result
