On 3/1/24 08:23, Tobias Burnus wrote:
Not very often, but do I keep running into issues (fails, segfaults)
related to testing programs compiled with a GCC without offload
configured and then using the system libraries. - That's equivalent
to having the system compiler (or any offload compiler) and
compiling with -foffload=disable.
The problem is that while the program only contains host code,
the run-time library still initializes devices when an API
routine - such as omp_get_num_devices - is invoked. This can
lead to odd bugs as target regions, obviously, will use host
fallback (for any device number) but the API routines will
happily operate on the actual devices, which can lead to odd
errors.
(Likewise issue when compiling for one offload target type
and running on a system which has devices of an other type.)
I assume that that's not a very common problem, but it can be
rather confusing when hitting this issue.
Maybe the proposed wording will help others to avoid this pitfall.
(Or is this superfluous as -foffload= is not much used and, even if,
no one then remembers or finds this none?)
Thoughts?
Well, I spent a long time looking at this, and my only conclusion is
that I don't really understand what the problem you're trying to solve
is. If it's problematical to have the runtime know about offload
devices the compiled code isn't using, don't users also need to know how
to restrict the runtime to a particular set of devices the same way
-foffload= lets you do, and not just how to disable offloading in the
runtime entirely?
It's pretty clearly documented already how -foffload affects the
compiler's behavior, and the library's behavior is already documented in
its own manual. Maybe what we don't have is a tutorial on how to
build/link/run programs using a specific offload device, or on the host?
Anyway, I don't really object to the text you want to add, but it makes
me more confused instead of less so. :-S
* * *
It was not clear to me how to refer to libgomp.texi
- Should it be 'libgomp' as in 'info libgomp' or the URL
https://gcc.gnu.org/onlinedocs/libgomp/ (or filename of the PDF)
implies?
- Or as 'GNU Offloading and Multi Processing Runtime Library Manual'
as named linked to at https://gcc.gnu.org/onlinedocs or on the title
page
of the the PDF - but that name is not repeated in the info file or
the HTML
file.
- Or even 'GNU libgomp' to mirror a substring in the <title> of the HTML
file.
I now ended up only implicitly referring that document.
The Texinfo input file has "@settitle GNU libgomp".
Aside: Shouldn't all the HTML documents start with a <h1> and <title>
before
the table of content? Currently, it has:
<title>Top (GNU libgomp)</title>
and the body starts with
<h2>Short Table of Contents</h2>
I think this is a bug in the version of texinfo used to produce the HTML
content for the GCC web site. Looking at a recent build of my own using
Texinfo 6.7, I do see
<body lang="en">
<h1 class="settitle" align="center">GNU libgomp</h1>
The manual on the web site says it was produced by "GNU Texinfo 7.0dev".
-Sandra