[libgomp, nvptx] Disable OMP_{DISPLAY_AFFINITY,AFFINITY_FORMAT} support

Tom de Vries tdevries@suse.de
Wed Dec 12 13:02:00 GMT 2018


On 12-12-18 11:48, Tom de Vries wrote:
> On 12-12-18 10:36, Jakub Jelinek wrote:
>> On Wed, Dec 12, 2018 at 09:29:36AM +0100, Tom de Vries wrote:
>>>> This is the libgomp/ except libgomp/testsuite/ part of the gomp-5_0-branch
>>>> merge to trunk I've just committed.
>>>>
>>>> 2018-11-08  Jakub Jelinek  <jakub@redhat.com>
>>>>
>>>> 	* affinity.c (gomp_display_affinity_place): New function.
>>>> 	* affinity-fmt.c: New file.
>>>
>>>> 	* fortran.c: Include stdio.h and string.h.
>>>> 	(omp_pause_resource, omp_pause_resource_all): Add ialias_redirect.
>>>> 	(omp_get_schedule_, omp_get_schedule_8_): Mask off GFS_MONOTONIC bit.
>>>> 	(omp_set_affinity_format_, omp_get_affinity_format_,
>>>> 	omp_display_affinity_, omp_capture_affinity_, omp_pause_resource_,
>>>> 	omp_pause_resource_all_): New functions.
>>>
>>> OK for trunk?
>>>
>>> Thanks,
>>> - Tom
>>
>>> [libgomp, nvptx] Disable OMP_{DISPLAY_AFFINITY,AFFINITY_FORMAT} support
>>>
>>> Disable compilation of support for OMP_DISPLAY_AFFINITY and OMP_AFFINITY_FORMAT
>>> for nvptx.
>>>
>>> This fixes some libgomp testsuite failures for x86_64 with nvptx accelerator.
>>>
>>> Build on x86_64 with nvptx accelerator, tested libgomp.
>>>
>>> 2018-12-12  Tom de Vries  <tdevries@suse.de>
>>>
>>> 	* affinity.c (gomp_display_affinity_place): Guard with
>>> 	#ifndef LIBGOMP_OFFLOADED_ONLY.
>>> 	* fortran.c (omp_set_affinity_format_, omp_get_affinity_format_)
>>> 	(omp_display_affinity_, omp_capture_affinity_): Same.
>>> 	* libgomp/config/nvptx/affinity-fmt.c: New, empty file overriding
>>> 	libgomp/affinity-fmt.c.
>>
>> The runtime APIs should still be available inside of OpenMP regions, your
>> patch makes them unavailable.
> 
> Ah, I see.
> 
>> What exactly doesn't work?
>> hostname handling, getpid, thread_id, affinity places?
> 
> The concrete error I'm getting is unresolved symbol getpid.  This is
> caused by the AC_COMPILE_IFELSE configure test for HAVE_GETPID passing
> for nvptx, while the master newlib for nvptx does not contain getpid.
> 
>> I'd prefer for now to just stub what doesn't work in the LIBGOMP_OFFLOADED_ONLY
>> case (print "node", 0 as pid, 0 as thread id, something for affinity
>> (0 or 0-N where N is the number of warps it can support or whatever).
>>
> 
> OK, I'll give that a try.
> 

This RFC patch implements that approach for getpid and gethostname (I
wonder though whether it's not possible to turn the corresponding
configure tests into link tests, which could also fix this for nvptx).

Another problem we're running into is missing istty, pulled in by
fwrite. The nvptx newlib port does support write, but I'm unsure in what
form I should handle this.  Add configure tests for fwrite and write? Or
special case the files in the config/nvptx dir? Any advice here?

Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-RFC-libgomp-nvptx-Fix-target-5.c-compilation.patch
Type: text/x-patch
Size: 2978 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20181212/8bdc1717/attachment.bin>


More information about the Gcc-patches mailing list