This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libgomp, nvptx] Disable OMP_{DISPLAY_AFFINITY,AFFINITY_FORMAT} support
- From: Tom de Vries <tdevries at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 12 Dec 2018 11:48:13 +0100
- Subject: Re: [libgomp, nvptx] Disable OMP_{DISPLAY_AFFINITY,AFFINITY_FORMAT} support
- References: <20181108171827.GM11625@tucnak> <26b4617e-7452-3b67-c29d-2d9f0c39d3e8@suse.de> <20181212093617.GF12380@tucnak>
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.
Thanks,
- Tom
> Eventually we need to find a way how to transfer some ICVs and other data
> from the host to the offloading library, either process shared that aren't
> changing, which can include the hostname, getpid, or some others that would
> need to be passed for every target region.