From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2Mo9C1OfU2DIWwAA0tVLHw (envelope-from ) for ; Thu, 18 Mar 2021 18:43:31 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id sIswB1OfU2CmZwAA1q6Kng (envelope-from ) for ; Thu, 18 Mar 2021 18:43:31 +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 7F0C9C2B7 for ; Thu, 18 Mar 2021 19:43:30 +0100 (CET) Received: from localhost ([::1]:41792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMxcH-0001Is-Kq for larch@yhetil.org; Thu, 18 Mar 2021 14:43:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMxbq-0001GZ-6b for guix-patches@gnu.org; Thu, 18 Mar 2021 14:43:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36508) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMxbp-00054a-VC for guix-patches@gnu.org; Thu, 18 Mar 2021 14:43:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lMxbp-0001vo-Qr for guix-patches@gnu.org; Thu, 18 Mar 2021 14:43:01 -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: Paul Garlick Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 18 Mar 2021 18:43:01 +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: ludo@gnu.org, 47237@debbugs.gnu.org Cc: Emmanuel Agullo , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Eric Bavier X-Debbugs-Original-To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16160929367341 (code B ref -1); Thu, 18 Mar 2021 18:43:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Mar 2021 18:42:16 +0000 Received: from localhost ([127.0.0.1]:48048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMxb0-0001u3-5T for submit@debbugs.gnu.org; Thu, 18 Mar 2021 14:42:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:42240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMxay-0001tp-9J for submit@debbugs.gnu.org; Thu, 18 Mar 2021 14:42:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMxay-0000mC-0Z for guix-patches@gnu.org; Thu, 18 Mar 2021 14:42:08 -0400 Received: from smtp.hosts.co.uk ([85.233.160.19]:14741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMxav-0004pz-5X; Thu, 18 Mar 2021 14:42:07 -0400 Received: from maikeh336.claranet.co.uk ([79.123.23.187] helo=pancake.local) by smtp.hosts.co.uk with esmtpsa (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim) (envelope-from ) id 1lMxal-0009tq-D6; Thu, 18 Mar 2021 18:41:55 +0000 Message-ID: <48a8a7c4dbe90415468d8db64cdfd82be52aeb4e.camel@tourbillion-technology.com> From: Paul Garlick Date: Thu, 18 Mar 2021 18:41:53 +0000 In-Reply-To: <20210318150246.7220-1-ludo@gnu.org> References: <20210318150246.7220-1-ludo@gnu.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=85.233.160.19; envelope-from=pgarlick@tourbillion-technology.com; helo=smtp.hosts.co.uk X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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=1616093010; 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=9v12/aUajOi3H7451W+Cdh13IWzylnjZPW+r3IO5Sdw=; b=pD7ArPwVQ0Ie2kxh6Q/da/tvu+3Hhdk9s6OOrsA52Lth6qyUoYPKnnZZ+o2jxGT+GgaWuo i5k4HY+P9cCVTcvdqb6qxEIAY0P1j82qjZGLhqmPgjqtibYqq+aPM8uyy7jkHH1Eoz/uIz c8M25i5q/Mod6V6mwQIRFLcxbaebZZrhsrDjVwiINE3nIZh6lQyxn6+XjzAPYnVOBr1BeC 70eHoOEQ5XjKsVW2f9ozIMj2I9kiQVull6TQv9XodkgZJYmxenthylte50nWb5WW2XG6fZ CNrMLhYE7KI7u0x3fLY0YHsKt/e34xyIb/kDiuWT1RAqJ8AW+tWKMX4vdupJ+g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616093010; a=rsa-sha256; cv=none; b=a+MFlAJiVOC3ciLcdGc0X6slP4mAvww5DFhUhMCdBUSLYTACdo076vNTSxuCiHHFUMU2l6 cFb4t/JnMNOHDiO04eSOzwGHgGaA6/LMpJRAq7AoXb+Ji6H//JKawLSWk5eybNL6x4Uqrx 7aAkZjnGpS+c457P4B97FFBIazRj/huwNxfyyg43jQUd4+7SgtUQAHW4cXcDUhQhRSDdYN Z+7eOzZnT8ilCqDISRyQ+6BpsL4e3yvQ5ZaBpH3ytDdl1hVQpFBcpxHH0XkprWkV/CGTV6 KxOj2Z8DeLJ9RPY9fyKwgdFFfVcZD4YcEuVw2OT2E6mG9l6Q/E72KOVmUIslcw== 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: -1.91 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: 7F0C9C2B7 X-Spam-Score: -1.91 X-Migadu-Scanner: scn0.migadu.com X-TUID: yMrVrodDV0lC Hi Ludo, I think it is a good idea to allow for different variants, even on 64- bit architectures. In one direction there is a performance advantage using 32-bit floats. In the other direction accuracy improves using the 64-bit data type. There is a similar situation with the scotch library. The scotch32 package variant is preferable, even on 64-bit systems, except for the case of very large models. Best regards, Paul. On Thu, 2021-03-18 at 16:02 +0100, Ludovic Courtès wrote: > From: Ludovic Courtès > > * gnu/packages/maths.scm (metis)[arguments]: Add #:modules and #:phases. > --- > gnu/packages/maths.scm | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) > > Hi! > > Metis defaults to 32-bit floating point numbers. However, on 64-bit > platforms, users probably expect 64-bit floating point numbers, hence > this patch. > > We could make it configurable through different variants or via package > parameters when they’re available, but I wonder about the usefulness of > a variant that uses 32-bit floats on 64-bit architectures. Can we keep > just this one variant? > > Thanks, > Ludo’. > > 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 © 2015 Fabian Harfert > ;;; Copyright © 2016 Roel Janssen > ;;; Copyright © 2016, 2018, 2020 Kei Kebreau > -;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès > +;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès > ;;; Copyright © 2016 Leo Famulari > ;;; Copyright © 2016, 2017 Thomas Danckaert > ;;; Copyright © 2017, 2018, 2019, 2020 Paul Garlick > @@ -3312,7 +3312,26 @@ YACC = bison -pscotchyy -y -b y > `(#:tests? #f ;no tests > #:configure-flags `("-DSHARED=ON" > ,(string-append "-DGKLIB_PATH=" (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 (= 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 library") > (description >