Skip to content

Commit a4c6b31

Browse files
committed
Revised the structural overview disagram.
Introduced the notion of generating and scheduling parents. Incremented version to 2.001.
1 parent 29a9098 commit a4c6b31

7 files changed

+63
-20
lines changed

figures/ompd-structural-overview.docx

100644100755
309 Bytes
Binary file not shown.

figures/ompd-structural-overview.pdf

100644100755
610 Bytes
Binary file not shown.

ompd-tr.pdf

1.48 KB
Binary file not shown.

sec_handle_mgmt.tex

+49-7
Original file line numberDiff line numberDiff line change
@@ -411,21 +411,63 @@ \subsection{Task Handles}
411411
\refdef{\texttt{ompd\_release\_task\_handle}}{release-task-handle:def}.
412412

413413
\paragraph{Retrieve the handle for an enclosing task.}
414-
The debugger uses \verb|ompd_get_ancestor_task_region| to obtain
415-
a pointer to the task handle for the task region enclosing the
416-
task region specified by \verb|task_handle|.
414+
The OMPD API includes operations to obtain the handle of the
415+
parent of a task represented by a given task handle.
416+
There are two notions of parenthood.
417+
The \emph{scheduling} parent task is the task that was active
418+
when the child task was scheduled to run.
419+
The \emph{generating} is the task that encountered the OpenMP
420+
that caused the child task to be created.
421+
422+
The generating and scheduling parents need not be the same.
423+
This might happen if the thread executing a task encounters
424+
an OpenMP construct.
425+
When this happens, the thread will enter the runtime.
426+
The runtime will set up the tasks to implement the OpenMP program
427+
construct, and then call its schedular to choose a task to
428+
execute.
429+
If the scheduler chooses a task other than one of these newly
430+
created tasks to run, the scheduling parent of the selected task
431+
will not be the same as its generating parent.
432+
The former is the task that the thread was executing most recently,
433+
and from which it entered the runtime.
434+
The later is the task which encountered the OpenMP construct
435+
it is executing.
436+
437+
The debugger uses \verb|ompd_get_generating_ancestor_task_region| to obtain
438+
a pointer to the task handle for the task that encountered the OpenMP
439+
construct which caused the task represented by \verb|task_handle|
440+
to be created.
417441
This call is meaningful only if the thread executing the task specified by
418442
\verb|task_handle| is stopped.
419443
\begin{quote}
420444
\begin{lstlisting}
421-
ompd_rc_t ompd_get_ancestor_task_region (
445+
ompd_rc_t ompd_get_generating_ancestor_task_region (
422446
ompd_task_handle_t *task_handle, /* IN */
423447
ompd_task_handle_t **parent_task_handle /* OUT */
424448
);
425449
\end{lstlisting}
426450
\end{quote}
427-
\labeldef{get-ancestor-task-region:def}
428-
The task handle must be released by calling
451+
\labeldef{get-generating-ancestor-task-region:def}
452+
453+
The \verb|ompd_get_scheduling_ancestor_task_region| returns the
454+
scheduling parent of the task represented \verb|task_handle|.
455+
The scheduling parent task is the OpenMP task that was active when
456+
the child task was scheduled.
457+
458+
This call is meaningful only if the thread executing the task specified by
459+
\verb|task_handle| is stopped.
460+
\begin{quote}
461+
\begin{lstlisting}
462+
ompd_rc_t ompd_get_scheduling_ancestor_task_region (
463+
ompd_task_handle_t *task_handle, /* IN */
464+
ompd_task_handle_t **parent_task_handle /* OUT */
465+
);
466+
\end{lstlisting}
467+
\end{quote}
468+
\labeldef{get-scheduling-ancestor-task-region:def}
469+
470+
The parent task handle must be released by calling
429471
\refdef{\texttt{ompd\_release\_task\_handle}}{release-task-handle:def}.
430472

431473
\paragraph{Retrieve implicit task handle for a parallel region.}
@@ -538,4 +580,4 @@ \subsection{Task Handles}
538580
The contents of the strings returned for task handles
539581
which compare as equal with
540582
\refdef{\texttt{ompd\_task\_handle\_compare}}{task-handle-compare:def}
541-
must be the same.
583+
must be the same.

sec_par_region_inquiries.tex

+2-4
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ \subsection{Parallel Region Settings}
4242
\end{quote}
4343
\labeldef{get-active-level:def}
4444

45-
\subsection{OMPT Parallel Region Inquiry Analogues}
46-
47-
\paragraph{Parallel Function Entry Point}
45+
\subsection{Parallel Function Entry Point}
4846

4947
The \texttt{ompd\_get\_parallel\_function} returns the
5048
entry point of the code that corresponds to the body of
@@ -58,4 +56,4 @@ \subsection{OMPT Parallel Region Inquiry Analogues}
5856
);
5957
\end{lstlisting}
6058
\end{quote}
61-
\labeldef{get-parallel-function:def}
59+
\labeldef{get-parallel-function:def}

sec_task_inquiries.tex

+11-8
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ \subsection{Stack Unwinding}
269269
semantics of the \verb|reenter_runtime_addr| field.)
270270
\end{notes}
271271
%
272-
The debugger can unwind a thread's logical stack by getting the
272+
The debugger can unwind a thread's stack by getting the
273273
thread's current task using
274274
\refdef{\texttt{ompd\_get\_top\_task\_region}}{get-top-task-region:def}.
275275
\begin{notes}
@@ -280,12 +280,10 @@ \subsection{Stack Unwinding}
280280
Using the task handle, the debugger can find the thread's exit and
281281
reentry stack frame addresses using \texttt{ompd\_get\_task\_frame}.
282282
%
283-
It can then use
284-
\refdef{\texttt{ompd\_get\_ancestor\_task\_region}}{get-ancestor-task-region:def}
285-
to find the task's parent region, and then call \verb|ompd_get_task_frame|
286-
for the parent task.
283+
It can then use \refdef{\texttt{ompd\_get\_scheduling\_ancestor\_task\_region}}{get-scheduling-ancestor-task-region:def} to find the next task in the
284+
thread's stack, and then call \verb|ompd_get_task_frame| for the parent task.
287285
%
288-
The frames between the parent task's reenter address and the top
286+
The frames between the scheduling parent task's reenter address and the top
289287
task's exit address are frames in which the thread is executing OpenMP
290288
runtime code.
291289
\begin{notes}
@@ -298,6 +296,11 @@ \subsection{Stack Unwinding}
298296
This process can be repeated to allow all frames in the thread's
299297
backtrace that correspond to execution in the OpenMP runtime to be
300298
identified.
301-
%
299+
300+
Using the generating ancestor operation \refdef{\texttt{ompd\_get\_generating\_ancestor\_task\_region}}{get-generating-ancestor-task-region:def},
301+
the same process can be used to determine the chain logical ancestors.
302+
Note that in this case the logical backtrace may traverse
303+
across the stacks of different threads.
304+
302305
The position within the stack frame where the runtime addresses point
303-
is implementation defined.
306+
is implementation defined.

version.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.000
1+
2.001

0 commit comments

Comments
 (0)