Rate This Document
Findability
Accuracy
Completeness
Readability

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.

Figure 1 Hawkeye workflow

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.

  1. Change the optimization level to -O0 and modify compilation options by adding -g and deleting -fopenmp and -qopenmp.
  2. 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)

  3. 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
The analysis result displays the functions with different calculation results on the Kunpeng and x86 platforms and their paths. To facilitate function locating, their call stacks are also displayed. Figure 3 shows the files for storing MD5 values of the functions. As displayed, developers can view the specific MD5 value file to further analyze the cause of the difference.
Figure 3 Hawkeye displaying the files for storing MD5 values of the functions