Sandra Loosemore wrote:
On 7/17/26 04:22, Tobias Burnus wrote:
gcc/ChangeLog:
* doc/invoke.texi (-fopenmp-openmp, -fopenmp-openmp-detailed):
Improve
Uh, those option names look like think-os....
... (no words)
+@code{taskloop} or worksharing construct. With that option, also the
+@code{distribute} and worksharing loop constructs with static
scheduling can
+dispatch the callback. Implies @option{-fopenmp-ompt} and requires
@option{-fopenmp}.
I don't know what "that option" is supposed to refer to (maybe you
mean "this option", namely -fopenmp-ompt-detailed, or what "dispatch
the callback" means.
I changed this to:
The additional calls are generated with static scheduling
for the @code{distribute} and worksharing loop constructs.
which avoids all the word dance.
And committed it as r17-2499-gcfb1d8314830af
* * *
Dispatch means: When the event occurs and the tool has registered
the callback in the OpenMP runtime, that callback is invoked.
Confusingly, that callback is named 'dispatch'.
But if the tool didn't register that callback, obviously, it will
never be called.
In the words of the spec (here for workshare loops):
"A thread dispatches a registered 'dispatch' callback for each
occurrence of a ws-loop-iteration-begin or ws-loop-chunk-begin
event in that thread."
* * *
FWIW, though, my preference would be to replace these two options with
a single option that takes an argument, like -fopenmp-ompt=none,
-fopenmp-ompt=basic, and -fopenmp-ompt=details, and -fopenmp-ompt
being a synonym for -fopenmp-ompt=basic, and -fno-openmp-ompt for
-fopenmp-ompt=none -- especially if more kinds of tracing or
finer-grained control are anticipated in the future.
I don't think that we will see finer control. The idea is:
-fopenmp
add no additional runtime calls but have a decent OMPT support
-fopenmp -fopenmp-ompt
Additional calls that have a low overhead but a larger benefit
Namely: instead of telling the tool only when something begins,
also tell it when it ends.
-fopenmp -fopenmp-ompt-detailed
Add more expensive calls, usually not needed but if one really
wants to drill down and does not fear a higher overhead
And I have a hard time imagine an additional option here.
Otherwise, I think combining the two and supporting
(-fno-openmp-ompt )
-fopenmp-ompt
-fopenmp-ompt=detailed
would look better in the documentation than having two
separate options.
However, the -fopenmp-ompt=basic and -fopenmp-ompt=none
are a bit odd:
-fopenmp-ompt=none in particular but also -fno-openmp-ompt
are a bit strange as - despite 'none' / 'no' - OMPT is still
mostly handled, just some additional details aren't reported
to the tool.
Likewise, -fopenmp=basic is not the minimal support, even if
'basic' implies this but already provides something extra,
albeit less than with 'detailed'.
* * *
I am fine with combing the two options into one - but I am not
planing to implement it.
(On the bike-shedding side: basic, extended, detailed
would also work, albeit basic == -fno-openmp-ompt looks odd.
And extended vs. detailed has no clear ordering regarding
which provides more data and whether one includes the other or
not.)
Tobias
commit cfb1d8314830af6a4121159dc59fbf03ff00c525
Author: Tobias Burnus <[email protected]>
Date: Fri Jul 17 17:19:46 2026 +0200
OpenMP: docs - improve -fopenmp-ompt(-detailed) description + update impl. status
invoke.texi: Improve the wording for -fopenmp-ompt(-detailed) that was
added in r17-2288-gab0dd7d5e16fcd.
libgomp.texi: Mark OpenMP 5.1's 'device_type(...)' for variables on
'declare target' as partially implemented as parsing support was added for
C/C++ in r10-2342-g77eb117f588686 and for Fortran in r11-2858-gd58e7173ef964d.
(device_type: It actually seems to work fine, even though there is almost no
code to handle 'host' differently; still host/nohost handling should be
improved for vars and funcs; hence, marked as only partial not as fully
supported.)
gcc/ChangeLog:
* doc/invoke.texi (-fopenmp-ompt, -fopenmp-ompt-detailed): Improve
wording.
libgomp/ChangeLog:
* libgomp.texi (OpenMP 5.1 Impl Status): Mark device_type on vars
in declare target as 'P'.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 739fc77c282..2c2ed1a003f 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -5623,19 +5623,25 @@ to the current task region, independent of the specified @code{bind} clause.
@opindex fno-openmp-ompt
@cindex OpenMP OMPT
@item -fopenmp-ompt
-Emit additional calls into libgomp, enabling OMPT callbacks around some OpenMP
-worksharing constructs (namely statically scheduled @code{for} and
-@code{distribute}, @code{single}, @code{masked} and @code{master}), so that an
-OMPT tool can observe their start and end. Requires @option{-fopenmp}.
+For some OpenMP constructs, generate calls into the OpenMP runtime before and
+after the region instead of only on region entry. For those constructs, the
+additional calls are only needed to provide better tracing results in tools
+using the OMPT interface and have a small overhead. The extra calls are
+generated for the @code{single}, @code{masked}, and @code{master} constructs
+and with static scheduling for the @code{distribute} and worksharing loop
+constructs. Requires @option{-fopenmp}.
@opindex fopenmp-ompt-detailed
@opindex fno-openmp-ompt-detailed
@cindex OpenMP OMPT
@item -fopenmp-ompt-detailed
-Like @option{-fopenmp-ompt}, and additionally emit calls into libgomp, enabling
-OMPT dispatch callbacks that get called at the beginning of each workshare chunk
-for statically scheduled @code{for} and @code{distribute}. Requires
-@option{-fopenmp}.
+Add additional calls into the OpenMP runtime for more detailed tracing via OMPT,
+which might have a measurable effect on the performance. The option enables
+additional constructs to issue events for the @code{dispatch} callback, which
+is invoked when begining to execute a section or a collapsed iteration in a
+@code{taskloop} or worksharing construct. The additional calls are generated
+with static scheduling for the @code{distribute} and worksharing loop
+constructs. Implies @option{-fopenmp-ompt} and requires @option{-fopenmp}.
@opindex fopenmp-target-simd-clone
@opindex fno-openmp-target-simd-clone
diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi
index 1e6bb80e0ce..291f1fbd1a4 100644
--- a/libgomp/libgomp.texi
+++ b/libgomp/libgomp.texi
@@ -363,7 +363,8 @@ to address of matching mapped list item per 5.1, Sect. 2.21.7.2 @tab N @tab
@code{IMPORT}, and @code{IMPLICIT} as invalid @tab N @tab
@item Optional comma between directive and clause in the @code{#pragma} form @tab Y @tab
@item @code{indirect} clause in @code{declare target} @tab Y @tab
-@item @code{device_type(nohost)}/@code{device_type(host)} for variables @tab N @tab
+@item @code{device_type(nohost)}/@code{device_type(host)} for variables @tab P @tab
+ Initial support
@item @code{present} modifier to the @code{map}, @code{to} and @code{from}
clauses @tab Y @tab
@item Changed interaction between @code{declare target} and OpenMP context