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