gnu: fio: Update to 3.24.
[jackhill/guix/guix.git] / gnu / packages / benchmark.scm
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, 2020 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>
9 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
10 ;;; Copyright © 2020 malte Frank Gerdes <malte.f.gerdes@gmail.com>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages benchmark)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module (guix build-system cmake)
33 #:use-module (guix build-system gnu)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages check)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages linux)
38 #:use-module (gnu packages maths)
39 #:use-module (gnu packages mpi)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages python-science)
43 #:use-module (gnu packages python-xyz)
44 #:use-module (gnu packages storage)
45 #:use-module (ice-9 match))
46
47 (define-public fio
48 (package
49 (name "fio")
50 (version "3.24")
51 (source (origin
52 (method url-fetch)
53 (uri (string-append "https://brick.kernel.dk/snaps/"
54 "fio-" version ".tar.bz2"))
55 (sha256
56 (base32
57 "0qshbyqpvm01hmpkmk0v0jhjz23sngqhy291kiz38z04s2df4vxn"))))
58 (build-system gnu-build-system)
59 (arguments
60 '(#:test-target "test"
61 #:phases
62 (modify-phases %standard-phases
63 (add-after
64 'unpack 'patch-paths
65 (lambda* (#:key inputs outputs #:allow-other-keys)
66 (let ((out (assoc-ref outputs "out"))
67 (gnuplot (string-append (assoc-ref inputs "gnuplot")
68 "/bin/gnuplot")))
69 (substitute* "tools/plot/fio2gnuplot"
70 (("/usr/share/fio") (string-append out "/share/fio"))
71 ;; FIXME (upstream): The 'gnuplot' executable is used inline
72 ;; in various os.system() calls mixed with *.gnuplot filenames.
73 (("; do gnuplot") (string-append "; do " gnuplot))
74 (("gnuplot mymath") (string-append gnuplot " mymath"))
75 (("gnuplot mygraph") (string-append gnuplot " mygraph")))
76 #t)))
77 (replace 'configure
78 (lambda* (#:key outputs #:allow-other-keys)
79 ;; The configure script doesn't understand some of the
80 ;; GNU options, so we can't use #:configure-flags.
81 (let ((out (assoc-ref outputs "out")))
82 (invoke "./configure"
83 (string-append "--prefix=" out))
84 #t)))
85 ;; The main `fio` executable is fairly small and self contained.
86 ;; Moving the auxiliary python and gnuplot scripts to a separate
87 ;; output saves almost 400 MiB on the closure.
88 (add-after 'install 'move-outputs
89 (lambda* (#:key outputs #:allow-other-keys)
90 (let ((oldbin (string-append (assoc-ref outputs "out") "/bin"))
91 (newbin (string-append (assoc-ref outputs "utils") "/bin")))
92 (mkdir-p newbin)
93 (for-each (lambda (file)
94 (let ((src (string-append oldbin "/" file))
95 (dst (string-append newbin "/" file)))
96 (link src dst)
97 (delete-file src)))
98 '("fio2gnuplot" "fiologparser_hist.py"
99 "fiologparser.py"))
100 ;; Make sure numpy et.al is found.
101 (wrap-program (string-append newbin "/fiologparser_hist.py")
102 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))
103 #t))))))
104 (outputs '("out" "utils"))
105 (inputs
106 `(("ceph" ,ceph "lib")
107 ("libaio" ,libaio)
108 ("gnuplot" ,gnuplot)
109 ("zlib" ,zlib)
110 ("python-numpy" ,python2-numpy)
111 ("python-pandas" ,python2-pandas)
112 ("python" ,python-2)))
113 (home-page "https://github.com/axboe/fio")
114 (synopsis "Flexible I/O tester")
115 (description
116 "fio is a tool that will spawn a number of threads or processes doing a
117 particular type of I/O action as specified by the user. The typical use of fio
118 is to write a job file matching the I/O load one wants to simulate.")
119 ;; The software is distributed under the GPL2, but a handful of components
120 ;; are covered by other licenses.
121 (license (list license:gpl2 license:gpl2+ license:bsd-2
122 license:public-domain))))
123
124 ;; Parameterized in anticipation of m(va)pich support
125 (define (intel-mpi-benchmarks mpi)
126 (package
127 (name (string-append "intel-mpi-benchmarks"
128 (if (string=? (package-name mpi) "openmpi")
129 ""
130 (string-append "-" (package-name mpi)))))
131 (version "2019.3")
132 (source (origin
133 (method git-fetch)
134 (uri (git-reference
135 (url "https://github.com/intel/mpi-benchmarks")
136 (commit (string-append "IMB-v" version))))
137 (file-name (git-file-name name version))
138 (sha256
139 (base32
140 "0si5xi6ilhd3w0gbsg124589pvp094hvf366rvjjb9pi7pdk5p4i"))))
141 (build-system gnu-build-system)
142 (inputs
143 `(("mpi" ,mpi)))
144 (arguments
145 `(#:phases
146 (modify-phases %standard-phases
147 (delete 'configure)
148 (delete 'check)
149 (replace 'install
150 (lambda* (#:key outputs #:allow-other-keys)
151 (define (benchmark? file stat)
152 (and (string-prefix? "IMB-" (basename file))
153 (executable-file? file)))
154
155 (let* ((out (assoc-ref outputs "out"))
156 (bin (string-append out "/bin")))
157 (for-each (lambda (file)
158 (install-file file bin))
159 (find-files "." benchmark?))
160 #t))))
161
162 ;; The makefile doesn't express all the dependencies, it seems.
163 #:parallel-build? #t
164
165 #:make-flags '("CC=mpicc" "CXX=mpicxx")))
166 (home-page "https://software.intel.com/en-us/articles/intel-mpi-benchmarks")
167 (synopsis "Benchmarks for the Message Passing Interface (MPI)")
168 (description
169 "This package provides benchmarks for implementations of the @dfn{Message
170 Passing Interface} (MPI). It contains MPI performance measurements for
171 point-to-point and global communication, and file, operations for a range of
172 message sizes. The generated benchmark data fully characterize:
173
174 @itemize
175 @item
176 Performance of a cluster system, including node performance, network latency,
177 and throughput;
178 @item
179 Efficiency of the MPI implementation.
180 @end itemize")
181 (license license:cpl1.0)))
182
183 (define-public intel-mpi-benchmarks/openmpi
184 (intel-mpi-benchmarks openmpi))
185
186 (define-public imb-openmpi
187 (deprecated-package "imb-openmpi" intel-mpi-benchmarks/openmpi))
188
189 (define-public multitime
190 (package
191 (name "multitime")
192 (version "1.4")
193 (source (origin
194 (method url-fetch)
195 (uri (string-append "https://tratt.net/laurie/src/"
196 "multitime/releases/"
197 "multitime-" version ".tar.gz"))
198 (sha256
199 (base32
200 "0iyfsdrbyqa7a4ifrh19l9a48hgv7ld6m0d8yf9bkl12q0qw91fx"))))
201 (build-system gnu-build-system)
202 (arguments '(#:tests? #f)) ; there are no tests
203 (home-page "https://tratt.net/laurie/src/multitime/")
204 (synopsis "Time command execution over multiple executions")
205 (description
206 "The @code{time} utility is a simple and often effective way of measuring
207 how long a command takes to run (wall time). Unfortunately, running a command
208 once can give misleading timings. @code{multitime} is, in essence, a simple
209 extension to @code{time} which runs a command multiple times and prints the
210 timing means, standard deviations, mins, medians, and maxes having done so.
211 This can give a much better understanding of the command's performance.")
212 (license license:expat)))
213
214 (define-public benchmark
215 (package
216 (name "benchmark")
217 (version "1.5.2")
218 (source (origin
219 (method git-fetch)
220 (uri (git-reference
221 (url "https://github.com/google/benchmark")
222 (commit (string-append "v" version))))
223 (file-name (git-file-name name version))
224 (sha256
225 (base32
226 "13rxagpzw6bal6ajlmrxlh9kgfvcixn6j734b2bvfqz7lch8n0pa"))))
227 (build-system cmake-build-system)
228 (native-inputs
229 `(("googletest-source" ,(package-source googletest))
230 ("googletest" ,googletest)))
231 (arguments
232 `(#:phases
233 (modify-phases %standard-phases
234 (add-after 'unpack 'unpack-googletest
235 (lambda* (#:key inputs #:allow-other-keys)
236 (copy-recursively (assoc-ref inputs "googletest-source")
237 "googletest")
238 #t)))))
239 (home-page "https://github.com/google/benchmark")
240 (synopsis "Microbenchmark support library")
241 (description
242 "Benchmark is a library to benchmark code snippets, similar to unit
243 tests.")
244 (license license:asl2.0)))
245
246 (define-public bonnie++
247 (package
248 (name "bonnie++")
249 (version "1.98")
250 (source (origin
251 (method url-fetch)
252 (uri (string-append "https://www.coker.com.au/bonnie++/bonnie++-"
253 version ".tgz"))
254 (sha256
255 (base32
256 "010bmlmi0nrlp3aq7p624sfaj5a65lswnyyxk3cnz1bqig0cn2vf"))))
257 (build-system gnu-build-system)
258 (native-inputs
259 `(("perl" ,perl)))
260 (arguments '(#:tests? #f)) ; there are no tests
261 (home-page "https://doc.coker.com.au/projects/bonnie/")
262 (synopsis "Hard drive and file system benchmark suite")
263 (description
264 "Bonnie++ is a benchmark suite that is aimed at performing a number of
265 simple tests of hard drive and file system performance. Bonnie++ allows you to
266 benchmark how your file systems perform with respect to data read and write
267 speed, the number of seeks that can be performed per second, and the number of
268 file metadata operations that can be performed per second.")
269 (license license:gpl2))) ;GPL 2 only, see copyright.txt