Skip to content

OpenMP OMPD Inspector

github-actions[bot] edited this page Nov 30, 2026 · 1 revision

OpenMP Logical Region, Task, and Barrier Inspector (OMPD)

When debugging hybrid MPI + OpenMP scientific applications, raw OS thread IDs (LWP numbers) rarely match OpenMP's logical omp_get_thread_num() execution hierarchy, and internal OpenMP runtime functions (GOMP_*, __kmp_*) bury user code deep inside call stacks. GridLock's OpenMP Inspector reveals logical parallel regions, teams, barrier waits, and originating omp task creation backtraces, backed automatically by libompd.so when present on your system and degrading cleanly to GDB/LLDB symbol analysis when libompd is unavailable.

OpenMP Logical Region, Team, Task, and Barrier Inspector paired with collapsed OpenMP runtime frames in Call Stack


Inspect OpenMP Parallel Regions, Threads, and Barrier Waits

Why use it: Map OS threads cleanly onto logical OpenMP team workers and spot which thread is stuck at an implicit barrier, explicit barrier, reduction, or taskwait.

  1. Launch or attach to a hybrid OpenMP target compiled with debug symbols (-g -O0 -fopenmp for GCC/GFortran or -g -O0 -qopenmp for Intel ifx/icpx) and pause execution inside a parallel region (F6 or a breakpoint).
  2. Click the MPI icon on the bottom tool rail (Alt+4) -> MPI Diagnostics, then click OPENMP INSPECTOR in the header bar (or open Search Everywhere with Ctrl+Shift+P and choose OpenMP Logical Region & Barrier Inspector).
  3. Check the status indicator next to the title:
    • OMPD: libompd indicates the OpenMP 5.0 OMPD debug shared library (libompd.so) loaded dynamically.
    • OMPD: GDB Fallback indicates GridLock reconstructed the OpenMP hierarchy cleanly from debugger thread and symbol metadata because libompd.so is not installed on the host.
  4. Expand the left Parallel Region / Team / Thread tree:
    • Each parallel region groups its active OpenMP Team #k and nested Parallel Level.
    • Each worker row shows its logical OpenMP ID (OMP 0, OMP 1, ..., [master] marker), OS TID, debugger thread index, active user function, and synchronization state badge (BARRIER, IMP BARRIER, REDUCTION, TASKWAIT, or ACTIVE).
  5. Click Focus Team Thread (or double-click any thread row) to switch Call Stack, Variables, Source Editor, and Disassembly directly to that OpenMP thread.

Trace Originating omp task Creation Backtraces and Synchronize Teams

Why use it: Find out where a suspended or deferred OpenMP task was spawned and avoid deadlocking sibling threads when single-stepping with scheduler-locking.

  1. Inspect the right-hand OpenMP Task / Originating Creation Backtrace tree inside OPENMP INSPECTOR:
    • Each task row displays its task ID, optional parent task ID, execution state (executing or suspended), and assigned OpenMP thread.
    • Expand any task to inspect the source frames leading up to the #pragma omp task / !$omp task creation site.
  2. Click any frame under a task's creation backtrace to open that source file and disassembly address immediately.
  3. After single-stepping a single worker thread with set scheduler-locking on in GDB Console, click Sync Team Threads before resuming past an !$omp barrier or reduction so sibling team threads can advance together cleanly.

Collapse Internal OpenMP Runtime Frames in Call Stack

Why use it: Keep your Call Stack focused on your own functions (main, MAIN__, stencil_omp._omp_fn.0) without scrolling past runtime dispatch wrappers.

  1. Look at the Call Stack dock header bar on the right side of the workstation.
  2. Check Hide OMP next to Single / Merged Tree.
  3. Contiguous runs of internal OpenMP runtime frames (GOMP_*, __kmp_*, __kmpc_*, ompc_*, do_wait) collapse into compact labeled summary rows (for example, [2 OpenMP runtime frames collapsed: GOMP_parallel, __kmp_fork_call]), while compiler-outlined user regions (stencil_omp._omp_fn.0) remain visible.
  4. Uncheck Hide OMP at any time to restore the full raw unwound backtrace non-destructively.

Reference

Feature Details
Runtime Loader Dynamic dlopen probe of libompd.so (ompd_initialize, ompd_get_api_version) with automatic GDB/LLDB thread fallback
Barrier States Classified ACTIVE, IMP BARRIER (implicit team barrier), BARRIER (explicit #pragma omp barrier), REDUCTION, TASKWAIT
Collapsed Runtime Symbols GOMP_*, gomp_*, __kmp_*, __kmpc_*, kmp_*, ompc_*, __omp_*, omp_in_barrier, omp_fulfill_event, do_wait
Hands-On Walkthrough See Hybrid MPI + OpenMP Fortran Tutorial

Clone this wiki locally