summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomain GARBAGE <romain.garbage@inria.fr>2025-11-03 14:46:06 +0100
committerRomain GARBAGE <romain.garbage@inria.fr>2025-11-04 14:47:22 +0100
commit8b2bf44e0fd7c9719817582de515947d5dcb21c8 (patch)
treee0db30b5bce270db5db135afe88bc43e06e72442
parent0b4f904ce9e1bde18bc73f66b317b60931c521da (diff)
benchmark: Add netlib-hpl.
* guix-science/packages/benchmark.scm (netlib-hpl): New variable.
-rw-r--r--guix-science/packages/benchmark.scm51
-rw-r--r--patches/netlib-hpl-use-default-hpl-dat.patch20
2 files changed, 71 insertions, 0 deletions
diff --git a/guix-science/packages/benchmark.scm b/guix-science/packages/benchmark.scm
index f0d7f26..4242c8e 100644
--- a/guix-science/packages/benchmark.scm
+++ b/guix-science/packages/benchmark.scm
@@ -7,7 +7,9 @@
7 #:use-module ((guix licenses) 7 #:use-module ((guix licenses)
8 #:prefix license:) 8 #:prefix license:)
9 #:use-module (guix build-system gnu) 9 #:use-module (guix build-system gnu)
10 #:use-module (gnu packages)
10 #:use-module (gnu packages gcc) 11 #:use-module (gnu packages gcc)
12 #:use-module (gnu packages maths)
11 #:use-module (gnu packages mpi) 13 #:use-module (gnu packages mpi)
12 #:use-module (gnu packages perl) 14 #:use-module (gnu packages perl)
13 #:use-module (ice-9 match)) 15 #:use-module (ice-9 match))
@@ -208,3 +210,52 @@ indicated as different classes.")
208 "NPB" #$(version-major+minor (package-version this-package)) 210 "NPB" #$(version-major+minor (package-version this-package))
209 "-MPI")))))))) 211 "-MPI"))))))))
210 (synopsis "NAS Parallel Benchmarks (NPB), MPI variant"))) 212 (synopsis "NAS Parallel Benchmarks (NPB), MPI variant")))
213
214(define-public netlib-hpl
215 (package
216 (name "netlib-hpl")
217 (version "2.3")
218 (source
219 (origin
220 (method url-fetch)
221 (uri (string-append "https://netlib.org/benchmark/hpl/hpl-" version
222 ".tar.gz"))
223 (sha256
224 (base32 "0c18c7fzlqxifz1bf3izil0bczv3a7nsv0dn6winy3ik49yw3i9j"))
225 (patches (search-patches
226 "patches/netlib-hpl-use-default-hpl-dat.patch"))))
227 (build-system gnu-build-system)
228 (inputs (list openblas openmpi))
229 (arguments
230 (list
231 #:configure-flags
232 #~(list "CFLAGS=-DHPL_DETAILED_TIMING -DHPL_CALL_CBLAS")
233 #:phases
234 #~(modify-phases %standard-phases
235 (add-after 'unpack 'set-hpl-dat-path
236 (lambda _
237 (substitute* "testing/ptest/HPL_pdinfo.c"
238 (("@@GUIX_HPL_DAT@@")
239 (string-append #$output
240 "/share/"
241 #$(package-name this-package)
242 "-"
243 #$(package-version this-package)
244 "/examples")))))
245 (add-after 'install 'install-hpl-dat
246 (lambda _
247 (install-file "testing/ptest/HPL.dat"
248 (string-append #$output
249 "/share/"
250 #$(package-name this-package)
251 "-"
252 #$(package-version this-package)
253 "/examples")))))))
254 (home-page "https://netlib.org/benchmark/hpl/")
255 (synopsis "High-Performance Linpack Benchmark for Distributed-Memory Computers")
256 (description "HPL is a software package that solves a (random) dense linear system
257in double precision (64 bits) arithmetic on distributed-memory
258computers. It can thus be regarded as a portable as well as freely
259available implementation of the High Performance Computing Linpack
260Benchmark.")
261 (license (license:non-copyleft "https://netlib.org/benchmark/hpl/copyright.html"))))
diff --git a/patches/netlib-hpl-use-default-hpl-dat.patch b/patches/netlib-hpl-use-default-hpl-dat.patch
new file mode 100644
index 0000000..716eca3
--- /dev/null
+++ b/patches/netlib-hpl-use-default-hpl-dat.patch
@@ -0,0 +1,20 @@
1# Use example file for benchmark.
2--- hpl-2.3/testing/ptest/HPL_pdinfo.c 2024-12-20 14:26:45.296458712 +0100
3+++ hpl-2.3/testing/ptest/HPL_pdinfo.c 2024-12-20 14:41:54.994292754 +0100
4@@ -297,8 +297,13 @@
5 if( ( infp = fopen( "HPL.dat", "r" ) ) == NULL )
6 {
7- HPL_pwarn( stderr, __LINE__, "HPL_pdinfo",
8- "cannot open file HPL.dat" );
9- error = 1; goto label_error;
10+ fprintf( stderr, "no file HPL.dat in current working directory\n"
11+ "using @@GUIX_HPL_DAT@@/HPL.dat\n\n");
12+ if( ( infp = fopen( "@@GUIX_HPL_DAT@@/HPL.dat", "r" ) ) == NULL )
13+ {
14+ HPL_pwarn( stderr, __LINE__, "HPL_pdinfo",
15+ "cannot open file @@GUIX_HPL_DAT@@/HPL.dat");
16+ error = 1; goto label_error;
17+ }
18 }
19
20 (void) fgets( line, HPL_LINE_MAX - 2, infp );