HPC调试器功能说明
HPC详细内容请参见https://support.huawei.com/enterprise/zh/doc/EDOC1100454741/8484b898?idPath=23710424|251364417|251364851|252309137|262039693。
HPC调试器提供HPC场景多节点并行调试能力,仅支持以Launch模式调试MPI、MPI+OpenMP应用。
命令功能
支持对MPI及MPI+OpenMP程序进行Launch调试,仅支持mpirun命令运行方式。
 支持的编程语言包括C、C++和Fortran。
命令格式
devkit debugger [-h | --help] {-t LAUNCH_TYPE | --type LAUNCH_TYPE} {-w APP_WORKLOAD | --workload APP_WORKLOAD} {-s SOURCE_PATH | --source SOURCE_PATH} {-m MPIRUN_CMD | --mpicmd MPIRUN_CMD} {-p RPC_SERVER_PORT | --port RPC_SERVER_PORT} [-l {0,1,2,3} | --log-level {0,1,2,3}] [-e ENVIRONMENT_VARIABLES | --env ENVIRONMENT_VARIABLES] [-a APP_ARGS | --args APP_ARGS] [-n THREAD_NUM | --threads THREAD_NUM]
参数说明
参数  | 
参数选项  | 
参数说明  | 
|---|---|---|
-h/--help  | 
-  | 
可选参数,获取帮助信息。  | 
-t/--type  | 
LAUNCH_TYPE  | 
必选参数,调试的启动方式,仅支持以Launch方式调试程序。  | 
-w/--workload  | 
APP_WORKLOAD  | 
必选参数,待调试程序可执行文件路径。 例如:/home/test/mpi_demo  | 
-s/--source  | 
SOURCE_PATH  | 
必选参数,待调试程序源码文件目录。 例如:/home/test  | 
-m/--mpicmd  | 
MPIRUN_CMD  | 
必选参数,需执行的mpirun命令,需使用英文双引号引起来。 例如:“mpirun --allow-run-as-root -np 4”  | 
-p/--port  | 
RPC_SERVER_PORT  | 
必选参数,Agent Server运行端口号,设置后用于上报启动信息。  | 
-l/--log-level  | 
0/1/2/3  | 
可选参数,设置日志级别,默认为1。 
  | 
-e/--env  | 
ENVIRONMENT_VARIABLES  | 
可选参数,设置环境变量,设置时需使用英文双引号引起来。有以下3种方式可选,可根据实际情况进行修改。 
 例如:“export PATH=$PATH:/path/to/mpi”  | 
-a/--args  | 
APP_ARGS  | 
可选参数,设置待调试程序运行参数,若存在多个参数需使用空格隔开。  | 
-n/--threads  | 
THREAD_NUM  | 
可选参数,输入的OpenMP应用thread数量,取值范围1~1024。  | 
使用示例
执行以下命令,查看HPC调试器支持的功能信息:
1 | devkit debugger -h  | 
返回信息如下:
OVERVIEW
    Run this command to start a debugging task.
USAGE
    devkit debugger
    [-h | --help]
    {-t LAUNCH_TYPE | --type LAUNCH_TYPE}
    {-w APP_WORKLOAD | --workload APP_WORKLOAD}
    {-s SOURCE_PATH | --source SOURCE_PATH}
    {-m MPIRUN_CMD | --mpicmd MPIRUN_CMD}
    {-p RPC_SERVER_PORT | --port RPC_SERVER_PORT}
    [-l {0,1,2,3} | --log-level {0,1,2,3}]
    [-e ENVIRONMENT_VARIABLES | --env ENVIRONMENT_VARIABLES]
    [-a APP_ARGS | --args APP_ARGS]
    [-n THREAD_NUM | --threads THREAD_NUM]
OPTIONS
    -h, --help
    Get help information and exit.
    -t, --type
    [Mandatory option] Specifies the method of starting a debugging task. Choices=['launch'].
    -w, --workload APP_WORKLOAD
    [Mandatory option] Specifies the path to the executable file of the application to be debugged.
    -s, --source SOURCE_PATH
    [Mandatory option] Specifies the directory of the source code of the application to be debugged.
    -m, --mpicmd MPIRUN_CMD
    [Mandatory option] Specifies the mpirun command.
    -p, --port RPC_SERVER_PORT
    [Mandatory option] Specifies the port for starting the agent RPC server.
    -l, --log-level {0,1,2,3}
    Specifies the log level of the current task, 0(DEBUG) | 1(INFO) | 2(WARNING) | 3(ERROR). The default value is 1(INFO).
    -e, --env ENVIRONMENT_VARIABLES
    Specifies environment variables. You can configure the environment variables required for running a parallel HPC application in the following ways:
    Method1: export PATH=$PATH:/path/to/mpi.
    Method2: source /configure/mpi/path/file.
    Method3: module load /mpi/modulefiles.
    -a, --args APP_ARGS
    Specifies the running parameters of the application to be debugged.
    -n, --threads THREAD_NUM
    Specifies the number of OPENMP application threads.
EXAMPLE
    # Starts a task of debugging an MPI application with four ranks.
    devkit debugger -t launch -w /home/test/mpi_demo -s /home/test/ -m 'mpirun --allow-run-as-root -np 4' -p 9981