我要评分
获取效率
正确性
完整性
易理解

Calculation Precision Analysis Functions

The calculation precision analysis tool locates the precision differences of the Fortran, C, and C++ languages caused by x86 and Kunpeng instructions.

Command Function

Locates the precision differences of the Fortran, C, and C++ languages caused by x86 and Kunpeng instructions.

Syntax

Compilation and instrumentation:

1
devkit advisor precision [-h | --help] {-instrument | --instrument} {-c COMMAND COMMANDS | --commands COMMANDS} {-p PROJECT | --project PROJECT} {-e ENTRY | --entry ENTRY} [-v VARIABLE | --variable VARIABLE] [-d DEPTH | --depth DEPTH] [-L | --loops] [-D DATABASE| --database DATABASE] [-b BLACK_LIST | --black-list BLACK_LIST] [-l {0,1,2,3} | --log-level {0,1,2,3}] [--set-timeout TIMEOUT]

Log difference analysis:

1
devkit advisor precision [-h | --help] {-analysis | --analysis} {-i INPUT_LOG | --input INPUT_LOG} [-o OUTPUT_PATH | --output OUTPUT_PATH] [-l {0,1,2,3} | --log-level {0,1,2,3}] [--set-timeout TIMEOUT]

To use the calculation precision analysis tool, you need to perform compilation and instrumentation on the different platforms (Kunpeng and x86). After the instrumentation is complete, analyze log differences.

Parameter Description

Table 1 Compilation and instrumentation parameters

Parameter

Option

Description

-h/--help

-

Obtains help information. This parameter is optional.

-instrument/--instrument

-

Compilation and instrumentation mode. This parameter is mandatory.

-c/--commands

COMMANDS

Builds source code. If there are multiple build commands, separate them with semicolons (;) and enclose them with single quotation marks (') or double quotation marks ("). If a command contains spaces, enclose it with single or double quotation marks. This parameter is mandatory.

Example: "make all" or "cd /home/test;make"

NOTE:
  • Do not run the cmake command directly. You need to run the command in advance.
  • The source code build command in the command line tool does not support variable setting and environment variable export.

    Example: "CFLAGS='-O0 -g';make" or "export CFLAGS='-O0 -g';make"

-p/--project

PROJECT

Absolute path to the project source code. This parameter is mandatory.

Example: /home/test/project1/ or /home/project2/

-e/--entry

ENTRY

Instrumentation entry file and the corresponding function. This parameter is mandatory and can be entered multiple times. Use colons (:) to separate each file and the corresponding function. Use commas (,) to separate multiple functions. Enter the relative path (specified by -p/--project) to the entry file in the project path. The file is used for compilation and cannot be the source file before preprocessing. The function is Mainprogram, Function, or Subroutine that exists in the specified Fortran file.

Example: -e demo.f90:main -e demo2.f90:func

-d/--depth

DEPTH

Depth of continuous instrumentation from the entry function. The default value is 0. The value ranges from 0 to 99. This parameter is optional.

-b/--black-list

BLACK_LIST

Files excluded from instrumentation. The files cannot contain any files specified by the -e parameter. This parameter is optional.

Example: "/home/test/demo1.f90;/home/test/demo2.f90"

-L/--loops

-

Instrumentation inside loops. This parameter is optional. When this option is selected, the precision log file generated by running the executable file after instrumentation becomes larger. Properly arrange the instrumentation entry (entry file and function) and depth.

-D/--database

DATABASE

Path to the compilation database. After you specify the path, incremental compilation will be performed. This parameter is optional. The compilation database file dev_compile_commands.json is generated by instrumentation using the calculation precision analysis tool for the first time.

NOTE:

Fortran is supported.

-v/--variable

VARIABLE

Parameter instrumentation mode, which is used to specify a certain variable. This parameter is optional. When this parameter is specified, the instrumentation depth is forcibly set to 0.

NOTE:

Fortran is supported.

-l/--log-level

0/1/2/3

Log level, which defaults to 1. This parameter is optional.

  • 0: DEBUG
  • 1: INFO
  • 2: WARNING
  • 3: ERROR

--set-timeout

-

Timeout interval of a task, in minutes. If the execution duration exceeds the timeout interval, the task exits. This parameter is optional. By default, there is no timeout interval. The task will be executed until it is complete.

Table 2 Parameters of log difference analysis modes

Parameter

Option

Description

-h/--help

-

Obtains help information. This parameter is optional.

-analysis/--analysis

-

Log difference analysis mode. This parameter is mandatory.

-i/--input

INPUT_LOG

Path to the specified log files or log file directories. The input sequence is Kunpeng logs first and then x86 logs. This parameter is mandatory.

Example: "/home/kunpeng.log;/home/x86.log" or "/home/kunpeng/;/home/x86/"

-o/--output

OUTPUT_PATH

Directory for storing analysis result files. The default directory is the current directory. This parameter is optional.

-l/--log-level

0/1/2/3

Log level, which defaults to 1. This parameter is optional.

  • 0: DEBUG
  • 1: INFO
  • 2: WARNING
  • 3: ERROR

--set-timeout

-

Timeout interval of a task, in minutes. If the execution duration exceeds the timeout interval, the task exits. This parameter is optional. By default, there is no timeout interval. The task will be executed until it is complete.