Oracle® Solaris Studio 12.4:使用 dbx 调试程序

退出打印视图

更新时间: 2015 年 1 月
 
 

输出区域和线程信息

使用 omp_pr 命令可输出当前并行区域或指定并行区域的描述,其中包括父区域、并行区域 ID、组大小(线程数)以及程序位置(程序计数器地址)。例如:

(dbx) omp_pr
parallel region 127283434369843201
    team size = 4
    source location = test.c:103
    parent = 127283430568755201

您还可以输出所有并行区域的描述以及从当前并行区域或指定并行区域到其根目录的路径。例如:

(dbx) omp_pr -ancestors
parallel region 127283434369843201
    team size = 4
    source location = test.c:103
    parent = 127283430568755201

    parallel region 127283430568755201
        team size = 4
        source location = test.c:95
        parent = <no parent>

它也可以输出整个并行区域树。例如:

(dbx) omp_pr -tree
parallel region 127283430568755201
    team size = 4
    source location = test.c:95
    parent = <no parent>

    parallel region 127283434369843201
        team size = 4
        source location = test.c:103
        parent = 127283430568755201

有关更多信息,请参见omp_pr 命令

使用 omp_tr 命令可输出当前任务区域或指定任务区域的描述,其中包括任务区域 ID、状态(spawnedexecutingwaiting)、正在执行的线程、程序位置(程序计数器地址)、未完成子项以及父项。例如:

(dbx) omp_tr
task region 65540
    type = implicit
    state = executing
    executing thread = t@4
    source location == test.c:46
    unfinished children = 0
    parent = <no parent>

您还可以输出所有任务区域的描述以及从当前任务区域或指定任务区域到其根目录的路径。

(dbx) omp_tr -ancestors
task region 196611
    type = implicit
    state = executing
    executing thread = t@3
    source location - test.c:103
    unfinished children = 0
    parent = 131075

    task region 131075
        type = implicit
        state = executing
        executing thread = t@3
        unfinished children = 0
        parent = <no parent>

您也可以输出整个任务区域树。例如:

(dbx) omp_tr -tree
task region 10
    type = implicit
    state = executing
    executing thread = t@10
    source location = test.c:103
    unfinished children = 0
    parent = <no parent>
task region 7
    type = implicit
    state = executing
    executing thread = t@7
    source location = test.c:103
    unfinished children = 0
    parent = <no parent>
task region 6
    type implicit
    state = executing
    executing thread = t@6
    source location = test.c:103
    unfinished children = 0
    parent = <o parent>
task region 196609
    type = implicit
    state = executing
    executing thread = t@1
    source location = test.c:95
    unfinished children = 0
    parent = <no parent>

    task region 262145
        type = implicit
        state = executing
        executing thread = t@1
        source location = test.c:103
        unfinished children - 0
        parent = 196609
 

有关更多信息,请参见omp_tr 命令

使用 omp_loop 命令可输出当前循环的描述,其中包括调度类型(静态、动态、指导、自动或运行时)、有序性、界限、步幅或跨距以及迭代数。例如:

(dbx) omp_loop
    ordered loop: no
    lower bound: 0
    upper bound: 3
    step: 1
    chunk: 1
    schedule type: static
    source location: test.c:49

有关更多信息,请参见omp_loop 命令

使用 omp_team 命令可输出当前组或指定并行区域组上的所有线程。例如:

(dbx) omp_team
team members:
    0: t@1 state = in implicit barrier, task region = 262145
    1: t@6 state = in implicit barrier, task region = 6
    2: t@7 state = working, task region = 7
    3: t@10 state = in implicit barrier, task region = 10

有关更多信息,请参见omp_team 命令

调试 OpenMP 代码时,除了关于当前或指定线程的有用信息之外,thread –info 还将输出 OpenMP 线程 ID、并行区域 ID、任务区域 ID 及 OpenMP 线程状态。有关更多信息,请参见thread 命令