From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 014C2385274D for ; Thu, 9 Jun 2022 10:11:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 014C2385274D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.91,287,1647331200"; d="scan'208";a="76887144" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 09 Jun 2022 02:11:37 -0800 IronPort-SDR: OpQxPd1EO7zIugbrtG8Or4ylLLW3LzZqx/5RW9iixnw/9S52Qat1GIf4yLI2XOx8UQndYHIB+w aiwTToIF3GQ7VtBSMjXKCQEHC4tiFWkX5lkyEeUE3fBZOKRDUsEnjt9X+ifLzIs56NLMuN9RBl ViS1ZxzmZYtvO3fdmvZgwI5rXzdXxvv5vIbOJfTBkVtXLNDHYUmuPWkuMt9uSKoJ9zLGEtXaET Y5jDxW2kygeBvj3gF2dl+SX2/HGFDcfXdAbFUprA7dNtjor13JPYDNdK2hb1kiMo7N0j+bJeaU eIg= From: Thomas Schwinge To: Jakub Jelinek CC: Subject: Re: [committed] openmp: Add support for HBW or large capacity or interleaved memory through the libmemkind.so library In-Reply-To: References: User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Thu, 9 Jun 2022 12:11:28 +0200 Message-ID: <87a6am5epb.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-08.mgc.mentorg.com (139.181.222.8) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2022 10:11:40 -0000 Hi Jakub! On 2022-06-09T10:19:03+0200, Jakub Jelinek via Gcc-patches wrote: > This patch adds support for dlopening libmemkind.so Instead of 'dlopen'ing literally 'libmemkind.so': > --- libgomp/allocator.c.jj 2022-06-08 08:21:03.099446883 +0200 > +++ libgomp/allocator.c 2022-06-08 13:41:45.647133610 +0200 > + void *handle =3D dlopen ("libmemkind.so", RTLD_LAZY); ..., shouldn't this instead 'dlopen' 'libmemkind.so.0'? At least for Debian/Ubuntu, the latter ('libmemkind.so.0') is shipped in the "library" package: $ apt-file list libmemkind0 | grep -F libmemkind.so libmemkind0: /usr/lib/x86_64-linux-gnu/libmemkind.so.0 libmemkind0: /usr/lib/x86_64-linux-gnu/libmemkind.so.0.0.1 ..., but the former ('libmemkind.so') only in the "development" package: $ apt-file list libmemkind-dev | grep -F libmemkind.so libmemkind-dev: /usr/lib/x86_64-linux-gnu/libmemkind.so ..., which users of GCC/libgomp shouldn't have to care about. Any plans about test cases for this? (Not trivial, I suppose?) Or, at least some 'gomp_debug' logging, what's happening behind the scenes? > --- libgomp/config/linux/allocator.c.jj 2022-06-08 08:58:23.1970781= 91 +0200 > +++ libgomp/config/linux/allocator.c 2022-06-08 09:39:15.108410730 +0200 > @@ -0,0 +1,36 @@ > +#define _GNU_SOURCE > +#include "libgomp.h" > +#if defined(PLUGIN_SUPPORT) && defined(LIBGOMP_USE_PTHREADS) > +#define LIBGOMP_USE_MEMKIND > +#endif > + > +#include "../../../allocator.c" Given this use of 'PLUGIN_SUPPORT' (and thus 'dlopen' etc.) for something different than libgomp plugins (offloading), might move 'DL_LIBS', 'PLUGIN_SUPPORT' from 'libgomp/plugin/configfrag.ac' into 'libgomp/configure.ac', and 'libgomp_la_LIBADD +=3D $(DL_LIBS)' from 'libgomp/plugin/Makefrag.am' into 'libgomp/Makefile.am'. Gr=C3=BC=C3=9Fe Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955