public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: <gcc-patches@gcc.gnu.org>
Subject: Re: [committed] openmp: Fix handling of numa_domains(1)
Date: Thu, 11 Nov 2021 14:14:05 +0100	[thread overview]
Message-ID: <87o86qn8bm.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <20211018130308.GA304296@tucnak>

Hi!

On 2021-10-18T15:03:08+0200, Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> On Fri, Oct 15, 2021 at 12:26:34PM -0700, sunil.k.pandey wrote:
>> 4764049dd620affcd3e2658dc7f03a6616370a29 is the first bad commit
>> commit 4764049dd620affcd3e2658dc7f03a6616370a29
>> Author: Jakub Jelinek <jakub@redhat.com>
>> Date:   Fri Oct 15 16:25:25 2021 +0200
>>
>>     openmp: Fix up handling of OMP_PLACES=threads(1)
>>
>> caused
>>
>> FAIL: libgomp.c/places-10.c execution test
>
> Reproduced on gcc112 in CompileFarm (my ws isn't NUMA).
> If numa-domains is used with num-places count, sometimes the function
> could create more places than requested and crash.  This depended on the
> content of /sys/devices/system/node/online file, e.g. if the file
> contains
> 0-1,16-17
> and all NUMA nodes contain at least one CPU in the cpuset of the program,
> then numa_domains(2) or numa_domains(4) (or 5+) work fine while
> numa_domains(1) or numa_domains(3) misbehave.  I.e. the function was able
> to stop after reaching limit on the , separators (or trivially at the end),
> but not within in the ranges.
>
> Fixed thusly, tested on powerpc64le-linux, committed to trunk.

There appears to be yet another issue: there still are quite a number of
'FAIL: libgomp.c/places-10.c execution test' reports on
<gcc-testresults@gcc.gnu.org>.  Also in my testing testing, on a system
where '/sys/devices/system/node/online' contains '0-1', I get a FAIL:

    [...]
    OPENMP DISPLAY ENVIRONMENT BEGIN
      _OPENMP = '201511'
      OMP_DYNAMIC = 'FALSE'
      OMP_NESTED = 'FALSE'
      OMP_NUM_THREADS = '8'
      OMP_SCHEDULE = 'DYNAMIC'
      OMP_PROC_BIND = 'TRUE'
      OMP_PLACES = '{0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30},{FAIL: libgomp.c/places-10.c execution test


Grüße
 Thomas


> 2021-10-18  Jakub Jelinek  <jakub@redhat.com>
>
>       * config/linux/affinity.c (gomp_affinity_init_numa_domains): Add
>       && gomp_places_list_len < count after nfirst <= nlast loop condition.
>
> --- libgomp/config/linux/affinity.c.jj        2021-10-15 16:28:30.374460522 +0200
> +++ libgomp/config/linux/affinity.c   2021-10-18 14:44:51.559667127 +0200
> @@ -401,7 +401,7 @@ gomp_affinity_init_numa_domains (unsigne
>           break;
>         q = end;
>       }
> -      for (; nfirst <= nlast; nfirst++)
> +      for (; nfirst <= nlast && gomp_places_list_len < count; nfirst++)
>       {
>         sprintf (name + prefix_len, "node%lu/cpulist", nfirst);
>         f = fopen (name, "r");
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

  reply	other threads:[~2021-11-11 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15 19:26 [r12-4438 Regression] FAIL: libgomp.c/places-10.c execution test on Linux/x86_64 sunil.k.pandey
2021-10-18 13:03 ` [committed] openmp: Fix handling of numa_domains(1) Jakub Jelinek
2021-11-11 13:14   ` Thomas Schwinge [this message]
2022-03-17 16:16     ` [PATCH] openmp: Fix up gomp_affinity_init_numa_domains Jakub Jelinek
2022-03-18  7:21       ` Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o86qn8bm.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).