@@ -411,21 +411,63 @@ \subsection{Task Handles}
411
411
\refdef {\texttt {ompd\_ release\_ task\_ handle }}{release-task-handle:def}.
412
412
413
413
\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.
417
441
This call is meaningful only if the thread executing the task specified by
418
442
\verb |task_handle | is stopped.
419
443
\begin {quote }
420
444
\ begin{lstlisting}
421
- ompd_rc_t ompd_get_ancestor_task_region (
445
+ ompd_rc_t ompd_get_generating_ancestor_task_region (
422
446
ompd_task_handle_t *task_handle, /* IN */
423
447
ompd_task_handle_t **parent_task_handle /* OUT */
424
448
);
425
449
\end {lstlisting }
426
450
\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
429
471
\refdef {\texttt {ompd\_ release\_ task\_ handle }}{release-task-handle:def}.
430
472
431
473
\paragraph {Retrieve implicit task handle for a parallel region. }
@@ -538,4 +580,4 @@ \subsection{Task Handles}
538
580
The contents of the strings returned for task handles
539
581
which compare as equal with
540
582
\refdef {\texttt {ompd\_ task\_ handle\_ compare }}{task-handle-compare:def}
541
- must be the same.
583
+ must be the same.
0 commit comments