DBI Xuanwu
Tool Overview
DBI Xuanwu is a dynamic precision analysis tool, which can perform instrumentation at the assembly instruction layer for application running to automatically locate HPC precision problems. The key features are as follows:
- The BiSheng compiler can generate a function parameter list, based on which a final function parameter list can be obtained after manual modifications.
- The DBI tool automatically reads the function parameter list and performs automatic instrumentation on the entry and exit of the function when the application is running. In this way, the cause of precision differences can be located without recompilation.
Constraints
The source code can be compiled and run successfully on the x86 and Kunpeng platforms.
Usage Guide
- Use the compiler to generate a function parameter list, or manually compile a function parameter list.
- Manually modify the function parameter list:
- Delete function parameters (such as random numbers and time) to be excluded.
- Manually specify the pointer length of the mapping relationship which cannot be established by some compilers.
- Use DBI Xuanwu to run the application on the x86 and Arm platforms to obtain the outputs.
- Compare the outputs of the two platforms and locate abnormal functions.
- Modify the function parameter list and only retain the abnormal functions, and set the wrap attribute of the abnormal function parameters to false.
- Print the original values of all parameters of the abnormal function for faulty value locating.
Keywords in the Configuration File
Keyword |
Description |
Mandatory or Optional |
Default Value |
|---|---|---|---|
arg_idx |
Parameter index |
Mandatory |
None |
arg_name |
Parameter name |
Optional |
arg#arg_idx by default |
ele_size |
Element size (bits) |
Optional |
8 bits by default, that is, only 1 byte is checked. |
is_ptr |
Enables or disables pointer |
Optional |
true by default |
ele_nums |
Number of elements |
Optional |
1 by default, that is, only one element is checked. |
has_ret |
Indicates whether there is a return value. |
Optional |
false by default, that is, the return value is not checked. |
ptr_level |
Pointer level |
Optional |
1 by default, that is, only level-1 memory access is performed. |
md5_level |
Parameter output format |
Optional |
0: All parameters output original values. 1: Each parameter generates an MD5 value and outputs it. 2: All parameters of each function generate an MD5 value and output it. false by default, that is, the value is not printed and is only used to generate MD5. |
is_struct |
Indicates whether it is a structure. |
Optional |
false by default, that is, it is not a structure. |
struct_type |
Structure type |
Optional |
"" by default |
check_at_ret |
Indicates whether to check the parameter (must be a pointer) when the function returns. |
Optional |
true by default, that is, this parameter is checked when the function returns. |
- For level-1 pointers, you only need to check the data and not to check the data addresses. For high-level pointers, you only need to check the final data and not to check the data addresses at different levels.
- In Fortran, all function parameters are transferred through addresses. Therefore, is_ptr must be set to true.
- If you need to ignore a function, use either of the following methods:
- Do not set the parameter.
- Set ele_size of the parameter to 0.
- Parameter that is a structure will be supported in the next version.
- Even if all parameters of a function do not need to be checked due to some factors, you are advised to still retain the function name as it can help build a complete function invocation stack to locate precision differences.