public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>, Jakub Jelinek <jakub@redhat.com>
Subject: Re: [Patch] libgomp: Use libnuma for OpenMP's partition=nearest allocation trait
Date: Fri, 14 Jul 2023 09:27:15 +0200	[thread overview]
Message-ID: <8e3f9f96-2f1f-2630-74bd-75fa18ae841c@codesourcery.com> (raw)
In-Reply-To: <CAAgBjMnrSSUF-CFQ_XidxxiqbUwf0m7SdPyRtFAgsQ36o4pRhw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 860 bytes --]

Hi Prathamesh,

On 13.07.23 18:13, Prathamesh Kulkarni wrote:

> The newly added tests in above commit -- alloc-11.c and alloc-12.c
> seem to fail during execution on armv8l-unknown-linux-gnueabihf:

thanks for the report and sorry for the breakage. While being aware that
libnuma is potentially not available, the code actually did not properly
test for it. (That 200+ packages require libnuma on this system, did not
help with testing it without, though.)

I have committed the attached obvious patch as r14-2514-g407d68daed00e0,
which hopefully fixes all issues.

Tobias
-----------------
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

[-- Attachment #2: committed.diff --]
[-- Type: text/x-patch, Size: 1195 bytes --]

commit 407d68daed00e040a7d9545b2a18aa27bf93a106
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Fri Jul 14 09:14:37 2023 +0200

    libgomp: Fix allocator handling for Linux when libnuma is not available
    
    Follow up to r14-2462-g450b05ce54d3f0.  The case that libnuma was not
    available at runtime was not properly handled; now it falls back to
    the normal malloc.
    
    libgomp/
    
            * allocator.c (omp_init_allocator): Check whether symbol from
            dlopened libnuma is available before using libnuma for
            allocations.
---
 libgomp/allocator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libgomp/allocator.c b/libgomp/allocator.c
index b3187ab2911..90f2dcb60d6 100644
--- a/libgomp/allocator.c
+++ b/libgomp/allocator.c
@@ -377,8 +377,9 @@ omp_init_allocator (omp_memspace_handle_t memspace, int ntraits,
 #ifdef LIBGOMP_USE_LIBNUMA
   if (data.memkind == GOMP_MEMKIND_NONE && data.partition == omp_atv_nearest)
     {
-      data.memkind = GOMP_MEMKIND_LIBNUMA;
       libnuma_data = gomp_get_libnuma ();
+      if (libnuma_data->numa_alloc_local != NULL)
+	data.memkind = GOMP_MEMKIND_LIBNUMA;
     }
 #endif
 

      reply	other threads:[~2023-07-14  7:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 10:35 Tobias Burnus
2023-07-12 12:05 ` Tobias Burnus
2023-07-13 16:13   ` Prathamesh Kulkarni
2023-07-14  7:27     ` Tobias Burnus [this message]

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=8e3f9f96-2f1f-2630-74bd-75fa18ae841c@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=prathamesh.kulkarni@linaro.org \
    /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).