From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id QITNHbyZU2AXHgAA0tVLHw (envelope-from ) for ; Thu, 18 Mar 2021 18:19:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id iF6WGbyZU2DKVQAA1q6Kng (envelope-from ) for ; Thu, 18 Mar 2021 18:19:40 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0D9C5B0EE for ; Thu, 18 Mar 2021 19:19:39 +0100 (CET) Received: from localhost ([::1]:37726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMxFC-0003EF-Vs for larch@yhetil.org; Thu, 18 Mar 2021 14:19:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMua6-0000sY-La for guix-patches@gnu.org; Thu, 18 Mar 2021 11:29:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMua6-0006kT-EJ for guix-patches@gnu.org; Thu, 18 Mar 2021 11:29:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lMua6-0000zj-93 for guix-patches@gnu.org; Thu, 18 Mar 2021 11:29:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47237] [PATCH] gnu: metis: Use 64-bit floating pointer numbers on 64-bit architectures. Resent-From: Emmanuel Agullo Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 18 Mar 2021 15:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47237 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: ludovic.courtes@inria.fr, bavier@member.fsf.org, pgarlick@tourbillion-technology.com, 47237@debbugs.gnu.org X-Debbugs-Original-Cc: Ludovic Courtes , Eric Bavier , Paul Garlick , guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16160812993771 (code B ref -1); Thu, 18 Mar 2021 15:29:02 +0000 Received: (at submit) by debbugs.gnu.org; 18 Mar 2021 15:28:19 +0000 Received: from localhost ([127.0.0.1]:47753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMuZH-0000ye-Ae for submit@debbugs.gnu.org; Thu, 18 Mar 2021 11:28:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:42866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMuZF-0000yV-Ec for submit@debbugs.gnu.org; Thu, 18 Mar 2021 11:28:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMuZF-0000om-8c for guix-patches@gnu.org; Thu, 18 Mar 2021 11:28:09 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:53623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMuZC-00061K-Qn; Thu, 18 Mar 2021 11:28:09 -0400 IronPort-HdrOrdr: A9a23:RWhvLqOg33UIUsBcT5n155DYdL4zR+YMi2QD/UoZc3BoW+afkN2jm+le6AT9jywfVGpltdeLPqSBRn20z+8R3aA6O7C+UA76/Fa5NY0K1/qB/xTMEzDzn9Q36Y5OaK57YeebMXFbioLA7BC8A5IcxrC8npyAocf74zNTQRpxa6dmhj0JaTqzNkFtXgFJCd4YOfOnifZvnDardXQJYsnTPBBsY8H5q9LGj57gaxIdbiRH1CC1kTiq5LTmeiL54j4iUihCybpn0W/Jnx2R3NTbj9iHywTR32KW0pJOmNGJ8KokOOWwjKEuRwnEu0KNbIRlV6bqhkFTnMifrHAwkNfNpB88P8N8r1PpF1vFxSfQ5w== X-IronPort-AV: E=Sophos;i="5.81,259,1610406000"; d="scan'208";a="498716606" X-MGA-submission: MDENWvSUVN/9OUpG2PBGncXb516Iv/bjvrLj5Bj2wCpBW5/fDAWWOP1NYVyuvE8r7mQV+8rlxy99uAOsQihmAOV4RMEfL2wq7FATGbNHj7rLrIjtF6bYWO/Vj0iGrZVmumyU0YZs3Tcm79saX6s3L6Oj77j/E3jllYab3emTBN0pug== Received: from zcs-store4.inria.fr ([128.93.142.31]) by mail2-relais-roc.national.inria.fr with ESMTP; 18 Mar 2021 16:27:22 +0100 Date: Thu, 18 Mar 2021 16:27:22 +0100 (CET) From: Emmanuel Agullo Message-ID: <79577287.1930022.1616081242591.JavaMail.zimbra@inria.fr> In-Reply-To: <20210318150246.7220-1-ludo@gnu.org> References: <20210318150246.7220-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [5.49.130.168] X-Mailer: Zimbra 8.8.15_GA_3996 (ZimbraWebClient - FF84 (Linux)/8.8.15_GA_4007) Thread-Topic: metis: Use 64-bit floating pointer numbers on 64-bit architectures. Thread-Index: MxmO6tHuo/RN2LmBdwEKDA94pVt22Q== Received-SPF: pass client-ip=192.134.164.83; envelope-from=emmanuel.agullo@inria.fr; helo=mail2-relais-roc.national.inria.fr X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Thu, 18 Mar 2021 14:10:03 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616091580; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=KOBf8ArFaVuBURTs6qy/c1JoQMr3/cx8vi8vmEna4jw=; b=GEddK+ZwNlhqLxSf1GMrvJf9eGWAsm16ZJ9Ik2QhLOHvQRY73xaVL72fTAxCElanEBdWdA Ph40/z89i3ZhZvoNN6hywydiXJfRYLe3OqKRLuWCMvfsuowGEPPrYh/wlpkght4tyxQdZi +/D7hScPm2+W8NZG5yVrlvtIdnvX/b8L665cUr+OGNO2PlIrxKhy+Wd5u0H8iXRVhob2fZ gy+7tqwhOGL1+3/xeZVDKj+iX4mitwmLGPTH/8ZY8RSILP3OTyI7USq/7BZQD32e1NOH8Z Gf2W6hxVWPWMY79mG1tmySoSifrABHFBpNepg8IWVaatvv4eu4AN13JhR1R3SA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616091580; a=rsa-sha256; cv=none; b=blBZcFMAloELJHK1dOnIteOVnuP288oq1/P0rcLhoJXySldP4FbarNvo6JdrCSYjo9Ohe1 ewBJ+V+497WtryPwSc79Yb/yOdPhEPBkC74t6obrLMP63O1rHHGoCuXHDYErCfv3WRZbEz McEKaB8iU0cBtmORrO/MQSW90Hmwjq+OceWaPSlYfTyuikKVqbqk55Ov3wcPyWJfsMv6jn VYssbPLPbobfT4NTj72kIhYa/0L6UyZNu7lCtlZ0PVwnaRTZdEa2PUaJvyGob/fR3LkInG Tqa8ZUvx52TIutIVUgcal6bs+0l6B1QzRi+SLxm6TVd2Uvb9KC5wsh0nn8ZkhA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.41 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 0D9C5B0EE X-Spam-Score: -2.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: Pv7Cb8kGz5ph Hello Ludo, hello everybody, Thank you very much for this patch and discussion. In numerical linear algebra in particular and hpc in general, the trend is more and more to use reduced=20 floating point arithmetic whenever possible (for memory=20 footprint, communication volume and possibly computational=20 time). I have no experience with using floating point=20 numbers in partitioners such as metis. But I strongly=20 suspect that a flexible usage will be requested (the=20 same way it is often requested for integers). All in all,=20 I would say that the number of bits for the architecture,=20 the floating point numbers and the integers shall not=20 (a priori) be related. In particular, I would say, in general,=20 if a (high-quality) library (such as metis) exposes multiple=20 choices, there are chances that users may want to choose between them (for good reasons). In the long run, it would be nice to have a naming convention all over guix to make clear (and explicit) for libraries that expose it which floating point and integer arithmetic is being used. There can hardly be a general rule (as some codes may even decide to expose, say, part of the integers in 32 bits and another part in 64 bits), but it would already be a great step to have a convention for the "main" integer choice and "main" floating-point choice. Something like mypackage_i32_r64 (if there is a general convention (beyond guix) to follow, even better). [It may even be great to use two versions of the same package to facilitate mixed arithmetic,=20 but we can certainly pospone that discussion as it would certainly open two many issues for now]. In the short run, if there can be only one, I let metis users playing with floating point numbers comment on which one shall it be. Hope this helps. Thank you again. Best regards, Manu ----- Mail original ----- > De: "Ludovic Court=C3=A8s" > =C3=80: guix-patches@gnu.org > Cc: "Eric Bavier" , "Emmanuel Agullo" , "Paul Garlick" > , "Ludovic Courtes" > Envoy=C3=A9: Jeudi 18 Mars 2021 16:02:46 > Objet: [PATCH] gnu: metis: Use 64-bit floating pointer numbers on 64-bit = architectures. > From: Ludovic Court=C3=A8s >=20 > * gnu/packages/maths.scm (metis)[arguments]: Add #:modules and #:phases. > --- > gnu/packages/maths.scm | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) >=20 > Hi! >=20 > Metis defaults to 32-bit floating point numbers. However, on 64-bit > platforms, users probably expect 64-bit floating point numbers, hence > this patch. >=20 > We could make it configurable through different variants or via package > parameters when they=E2=80=99re available, but I wonder about the usefuln= ess of > a variant that uses 32-bit floats on 64-bit architectures. Can we keep > just this one variant? >=20 > Thanks, > Ludo=E2=80=99. >=20 > diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm > index 565f109f47..4cd9112be9 100644 > --- a/gnu/packages/maths.scm > +++ b/gnu/packages/maths.scm > @@ -12,7 +12,7 @@ > ;;; Copyright =C2=A9 2015 Fabian Harfert > ;;; Copyright =C2=A9 2016 Roel Janssen > ;;; Copyright =C2=A9 2016, 2018, 2020 Kei Kebreau > -;;; Copyright =C2=A9 2016, 2017, 2018, 2019, 2020 Ludovic Court=C3=A8s <= ludo@gnu.org> > +;;; Copyright =C2=A9 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Court=C3= =A8s > > ;;; Copyright =C2=A9 2016 Leo Famulari > ;;; Copyright =C2=A9 2016, 2017 Thomas Danckaert > ;;; Copyright =C2=A9 2017, 2018, 2019, 2020 Paul Garlick > > @@ -3312,7 +3312,26 @@ YACC =3D bison -pscotchyy -y -b y > `(#:tests? #f ;no tests > #:configure-flags `("-DSHARED=3DON" > ,(string-append "-DGKLIB_PATH=3D" (getcwd) > - "/metis-" ,version "/GKlib"))= )) > + "/metis-" ,version "/GKlib")) > + > + #:modules ((system base target) > + (guix build cmake-build-system) > + (guix build utils)) > + #:phases (modify-phases %standard-phases > + (add-after 'unpack 'set-real-type-width > + (lambda* (#:key build target #:allow-other-keys) > + ;; Enable 64-bit floating point numbers on 64-bit > + ;; architectures. Leave the default 32-bit width = on > + ;; other architectures. > + (let ((word-size > + (with-target (or target build %host-type) > + (lambda () > + (target-word-size))))) > + (when (=3D 8 word-size) > + (display "setting REALTYPEWIDTH to 64...\n") > + (substitute* "include/metis.h" > + (("define REALTYPEWIDTH.*$") > + "define REALTYPEWIDTH 64\n"))))))))) > (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview") > (synopsis "Graph partitioning and fill-reducing matrix ordering libra= ry") > (description > -- > 2.30.2