GNU bug report logs - #47237
[PATCH] gnu: metis: Use 64-bit floating pointer numbers on 64-bit architectures.

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Thu, 18 Mar 2021 15:04:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#47237: closed ([PATCH] gnu: metis: Use 64-bit floating
 pointer numbers on 64-bit architectures.)
Date: Thu, 25 Mar 2021 17:43:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 25 Mar 2021 18:42:39 +0100
with message-id <87sg4j5dv4.fsf_-_ <at> gnu.org>
and subject line Re: bug#47237: [PATCH] gnu: metis: Use 64-bit floating pointer numbers on 64-bit architectures.
has caused the debbugs.gnu.org bug report #47237,
regarding [PATCH] gnu: metis: Use 64-bit floating pointer numbers on 64-bit architectures.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
47237: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=47237
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Emmanuel Agullo <emmanuel.agullo <at> inria.fr>,
 Ludovic Courtès <ludovic.courtes <at> inria.fr>,
 Eric Bavier <bavier <at> member.fsf.org>,
 Paul Garlick <pgarlick <at> tourbillion-technology.com>
Subject: [PATCH] gnu: metis: Use 64-bit floating pointer numbers on 64-bit
 architectures.
Date: Thu, 18 Mar 2021 16:02:46 +0100
From: Ludovic Courtès <ludovic.courtes <at> inria.fr>

* 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 <fhmgufs <at> web.de>
 ;;; Copyright © 2016 Roel Janssen <roel <at> gnu.org>
 ;;; Copyright © 2016, 2018, 2020 Kei Kebreau <kkebreau <at> posteo.net>
-;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2016 Leo Famulari <leo <at> famulari.name>
 ;;; Copyright © 2016, 2017 Thomas Danckaert <post <at> thomasdanckaert.be>
 ;;; Copyright © 2017, 2018, 2019, 2020 Paul Garlick <pgarlick <at> tourbillion-technology.com>
@@ -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
-- 
2.30.2



[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Paul Garlick <pgarlick <at> tourbillion-technology.com>
Cc: emmanuel.agullo <at> inria.fr, bavier <at> member.fsf.org, 47237-done <at> debbugs.gnu.org
Subject: Re: bug#47237: [PATCH] gnu: metis: Use 64-bit floating pointer
 numbers on 64-bit architectures.
Date: Thu, 25 Mar 2021 18:42:39 +0100
Hi again,

For now I’ve added a ‘metis-r64’ package with 64-bit reals to the
‘guix-hpc’ channel:

  https://gitlab.inria.fr/guix-hpc/guix-hpc/-/commit/f4a77fe95f0286bd63b07af6b9fbef25f3262682

Let’s see later if we can come up with a more generic solution in Guix
proper.

Ludo’.


This bug report was last modified 4 years and 150 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.