Rate This Document
Findability
Accuracy
Completeness
Readability

Calculation Precision Analysis

After instrumenting application functions using the precision analysis tool, run the functions on the x86 platform and Kunpeng platform. Then the precision analysis tool compares the output results to analyze the calculation precision differences between the platforms.

This function is unavailable currently and will be removed in later versions. To you still need to use this function, see Calculation Precision Analysis and use the CLI mode instead.

Prerequisites

  • You have logged in to the Kunpeng DevKit.
  • The application can run on the x86 and Kunpeng platforms.
  • Tool compatibility:

    CPU: Kunpeng 920; OS: Kylin Linux Advanced Server V10 (Sword); glibc version: glibc.aarch64-2.28-49.p02.ky10

    CPU: Kunpeng 920; OS: openEuler 20.03 (LTS-SP3); glibc version: glibc.aarch64-2.28-84.oe1

Procedure

  1. In the left pane of the page, choose Affinity Analyzer > Calculation Precision Analysis Tool.
  2. Obtain the precision analysis tool Cruiser and configuration file config_template.ini for the Kunpeng and x86 platforms.
  3. Use Cruiser to instrument the source code in MAIN mode on the Kunpeng platform.
    1. Upload the tool, configuration file, and source code to the remote server.
    2. Edit lines 3, 11, and 27 in the configuration file as prompted.
    3. In the directory hosting the tool and configuration file on the remote server, run the following command to perform automatic instrumentation on the source code:
      1
      ./cruiser --config ./config.ini
      
  4. Link the dynamic library libcruiser.so. Then compile and run the instrumented source code on the x86 and Kunpeng platforms. Intermediate log files are generated. If the source code is written in C/C++, add the header file cruiser.h to the source code.
    • Obtain the libcruiser.so and cruiser.h files by decompressing libcruiser-2.2.0-xxx.tar.gz from the tool repository based on the Kunpeng or x86 platform.
    • Link libcruiser.so when compiling the application.
    • Add the -L${DUMP_HOOK_PATH} -lcruiser -lcrypto option during the linkage.
    • Specify -lm if the compiler is GNU and the version is earlier than 4.5.
    • If the source code is written in C/C++, add the header file address -I/path/to/cruiser/include.
  5. Use Cruiser to instrument the source code in LOG mode on the Kunpeng platform.
    1. Upload the two log files to the instrumented remote server.
    2. Edit lines 3, 5, 7, and 27 in the configuration file as prompted.
    3. In the directory hosting the tool and configuration file on the remote server, run the following command to perform automatic instrumentation on the source code:
      1
      ./cruiser --config ./config.ini
      
  6. Link the dynamic library libcruiser.so. Then compile and run the instrumented source code on the x86 and Kunpeng platforms. Precision analysis result files are generated. If the source code is written in C/C++, add the header file cruiser.h to the source code.
    • Obtain the libcruiser.so and cruiser.h files by decompressing libcruiser-2.2.0-xxx.tar.gz from the tool repository based on the Kunpeng or x86 platform.
    • Link libcruiser.so when compiling the application.
    • Add the -L${DUMP_HOOK_PATH} -lcruiser -lcrypto option during the linkage.
    • Specify -lm if the compiler is GNU and the version is earlier than 4.5.
    • If the source code is written in C/C++, add the header file address -I/path/to/cruiser/include.
  7. Compare the precision analysis results.
    Figure 1 Precision comparison report