Rate This Document
Findability
Accuracy
Completeness
Readability

HPC Debugger Functions

High-performance computing (HPC) is a computing method and technology that uses large-scale, high-speed, and parallel computer systems to solve complex scientific, engineering, and business problems. HPC aims to accelerate problem solving and improve computation precision by using a substantial number of computing resources and parallel processing capabilities.

The HPC Debugger supports parallel debugging on multiple nodes in HPC scenarios. MPI and MPI+OpenMP applications must be debugged in launch or attach mode.

Command Function

Debugs MPI and MPI+OpenMP applications in Launch mode. It must be run using the mpirun command.

Debugs MPI and MPI+OpenMP applications in Attach mode. It must use the srun method of the Slurm scheduler.

In Launch mode, the debugger is directly started to manage the entire lifecycle of the program. This mode applies to full-cycle debugging in local development. In Attach mode, the debugger is attached to the running process in real time. This mode applies to debugging scenarios where the debugger cannot be directly started or dynamic intervention is required.

This tool supports C, C++, and Fortran.

Syntax

Launch mode:

1
debugger launch [-h | --help] {-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]

Attach mode:

1
debugger attach [-h | --help] {-w APP_WORKLOAD | --workload APP_WORKLOAD} {-s SOURCE_PATH | --source SOURCE_PATH}{-r RUN_MODE | --run-mode RUN_MODE}{-j JOB_ID | --job JOB_ID} {-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]

Parameter Description

Table 1 Launch mode parameters

Parameter

Option

Description

-h/--help

-

Obtains help information. This parameter is optional.

-w/--workload

-

Path to the executable file of the application to be debugged. This parameter is mandatory.

Example: /home/test/mpi_demo

-s/--source

-

Source file directory of the application to be debugged. This parameter is mandatory.

Example: /home/test

-m/--mpicmd

-

mpirun command to be executed. This parameter is mandatory and must be enclosed in double quotation marks.

Example: mpirun --allow-run-as-root -np 4

-p/--port

-

Port for running the agent server to report startup information. This parameter is mandatory.

-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

-e/--env

-

Environment variable. Use double quotation marks to enclose the environment variable. This parameter is optional. The options are:

  • export PATH=$PATH:/path/to/mpi
  • source /configure/mpi/path/file
  • module load /mpi/modulefiles

Example: export PATH=$PATH:/path/to/mpi

-a/--args

-

Running argument of the application to be debugged. If there are multiple arguments, separate them with spaces. This parameter is optional.

-n/--threads

-

Number of OpenMP threads, which ranges from 1 to 1024. This parameter is optional.

Table 2 Attach mode parameters

Parameter

Option

Description

-h/--help

-

Obtains help information. This parameter is optional.

-w/--workload

-

Path to the executable file of the application to be debugged. This parameter is mandatory.

Example: /home/test/mpi_demo

-s/--source

-

Source file directory of the application to be debugged. This parameter is mandatory.

Example: /home/test

-r/--run-mode

-

Application running mode, which must be the Slurm scheduler. This parameter is mandatory.

  • slurm

-j/--job

-

Job ID. This parameter is mandatory.

-p/--port

-

Port for running the agent server to report startup information. This parameter is mandatory.

-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

-e/--env

-

Environment variable. Use double quotation marks to enclose the environment variable. This parameter is optional. The options are:

  • export PATH=$PATH:/path/to/mpi
  • source /configure/mpi/path/file
  • module load /mpi/modulefiles

Example: export PATH=$PATH:/path/to/mpi

Example

Display the information about the functions supported by the HPC Debugger:

1
devkit debugger -h

Command output:

1
2
3
4
 The most commonly used debugger sub commands are:
   launch              Starts and debugs a program directly from the development environment.
   attach              Connects the debugger to an already running process for real-time debugging.
 See 'COMMAND -h/--help' for more information on a specific command.