1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
3 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
4 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2019 Eric Bavier <bavier@member.fsf.org>
7 ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
8 ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages benchmark)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module (guix build-system cmake)
31 #:use-module (guix build-system gnu)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages check)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages linux)
36 #:use-module (gnu packages maths)
37 #:use-module (gnu packages mpi)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages python-science)
40 #:use-module (gnu packages python-xyz)
41 #:use-module (gnu packages storage)
42 #:use-module (ice-9 match))
50 (uri (string-append "https://brick.kernel.dk/snaps/"
51 "fio-" version ".tar.bz2"))
54 "1hvh8syjz6l0q9bm5p7rf0yrmpkfcx5zj5d47mf6335w1i0h5gqf"))))
55 (build-system gnu-build-system)
57 '(#:test-target "test"
59 (modify-phases %standard-phases
62 (lambda* (#:key inputs outputs #:allow-other-keys)
63 (let ((out (assoc-ref outputs "out"))
64 (gnuplot (string-append (assoc-ref inputs "gnuplot")
66 (substitute* "tools/plot/fio2gnuplot"
67 (("/usr/share/fio") (string-append out "/share/fio"))
68 ;; FIXME (upstream): The 'gnuplot' executable is used inline
69 ;; in various os.system() calls mixed with *.gnuplot filenames.
70 (("; do gnuplot") (string-append "; do " gnuplot))
71 (("gnuplot mymath") (string-append gnuplot " mymath"))
72 (("gnuplot mygraph") (string-append gnuplot " mygraph")))
75 (lambda* (#:key outputs #:allow-other-keys)
76 ;; The configure script doesn't understand some of the
77 ;; GNU options, so we can't use #:configure-flags.
78 (let ((out (assoc-ref outputs "out")))
80 (string-append "--prefix=" out))
82 ;; The main `fio` executable is fairly small and self contained.
83 ;; Moving the auxiliary python and gnuplot scripts to a separate
84 ;; output saves almost 400 MiB on the closure.
85 (add-after 'install 'move-outputs
86 (lambda* (#:key outputs #:allow-other-keys)
87 (let ((oldbin (string-append (assoc-ref outputs "out") "/bin"))
88 (newbin (string-append (assoc-ref outputs "utils") "/bin")))
90 (for-each (lambda (file)
91 (let ((src (string-append oldbin "/" file))
92 (dst (string-append newbin "/" file)))
95 '("fio2gnuplot" "fiologparser_hist.py"
97 ;; Make sure numpy et.al is found.
98 (wrap-program (string-append newbin "/fiologparser_hist.py")
99 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))
101 (outputs '("out" "utils"))
103 `(("ceph" ,ceph "lib")
107 ("python-numpy" ,python2-numpy)
108 ("python-pandas" ,python2-pandas)
109 ("python" ,python-2)))
110 (home-page "https://github.com/axboe/fio")
111 (synopsis "Flexible I/O tester")
113 "fio is a tool that will spawn a number of threads or processes doing a
114 particular type of I/O action as specified by the user. The typical use of fio
115 is to write a job file matching the I/O load one wants to simulate.")
116 ;; The software is distributed under the GPL2, but a handful of components
117 ;; are covered by other licenses.
118 (license (list license:gpl2 license:gpl2+ license:bsd-2
119 license:public-domain))))
121 ;; Parameterized in anticipation of m(va)pich support
122 (define (intel-mpi-benchmarks mpi)
124 (name (string-append "intel-mpi-benchmarks"
125 (if (string=? (package-name mpi) "openmpi")
127 (string-append "-" (package-name mpi)))))
132 (url "https://github.com/intel/mpi-benchmarks.git")
133 (commit (string-append "IMB-v" version))))
134 (file-name (git-file-name name version))
137 "0si5xi6ilhd3w0gbsg124589pvp094hvf366rvjjb9pi7pdk5p4i"))))
138 (build-system gnu-build-system)
143 (modify-phases %standard-phases
147 (lambda* (#:key outputs #:allow-other-keys)
148 (define (benchmark? file stat)
149 (and (string-prefix? "IMB-" (basename file))
150 (executable-file? file)))
152 (let* ((out (assoc-ref outputs "out"))
153 (bin (string-append out "/bin")))
154 (for-each (lambda (file)
155 (install-file file bin))
156 (find-files "." benchmark?))
159 ;; The makefile doesn't express all the dependencies, it seems.
162 #:make-flags '("CC=mpicc" "CXX=mpicxx")))
163 (home-page "https://software.intel.com/en-us/articles/intel-mpi-benchmarks")
164 (synopsis "Benchmarks for the Message Passing Interface (MPI)")
166 "This package provides benchmarks for implementations of the @dfn{Message
167 Passing Interface} (MPI). It contains MPI performance measurements for
168 point-to-point and global communication, and file, operations for a range of
169 message sizes. The generated benchmark data fully characterize:
173 Performance of a cluster system, including node performance, network latency,
176 Efficiency of the MPI implementation.
178 (license license:cpl1.0)))
180 (define-public intel-mpi-benchmarks/openmpi
181 (intel-mpi-benchmarks openmpi))
183 (define-public imb-openmpi
184 (deprecated-package "imb-openmpi" intel-mpi-benchmarks/openmpi))
186 (define-public multitime
192 (uri (string-append "https://tratt.net/laurie/src/"
193 "multitime/releases/"
194 "multitime-" version ".tar.gz"))
197 "0iyfsdrbyqa7a4ifrh19l9a48hgv7ld6m0d8yf9bkl12q0qw91fx"))))
198 (build-system gnu-build-system)
199 (arguments '(#:tests? #f)) ; there are no tests
200 (home-page "https://tratt.net/laurie/src/multitime/")
201 (synopsis "Time command execution over multiple executions")
203 "The @code{time} utility is a simple and often effective way of measuring
204 how long a command takes to run (wall time). Unfortunately, running a command
205 once can give misleading timings. @code{multitime} is, in essence, a simple
206 extension to @code{time} which runs a command multiple times and prints the
207 timing means, standard deviations, mins, medians, and maxes having done so.
208 This can give a much better understanding of the command's performance.")
209 (license license:expat)))
211 (define-public benchmark
218 (url "https://github.com/google/benchmark.git")
219 (commit (string-append "v" version))))
220 (file-name (git-file-name name version))
223 "0r9dbg4cbk47gwmayys31a83m3y67k0kh1f6pl8i869rbd609ndh"))
224 (patches (search-patches "benchmark-unbundle-googletest.patch"))))
225 (build-system cmake-build-system)
227 `(("googletest" ,googletest)))
228 (home-page "https://github.com/google/benchmark")
229 (synopsis "Microbenchmark support library")
231 "Benchmark is a library to benchmark code snippets,
232 similar to unit tests.")
233 (license license:asl2.0)))