| 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 | ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
| 12 | ;;; Copyright © 2020 Greg Hogan <code@greghogan.com> |
| 13 | ;;; |
| 14 | ;;; This file is part of GNU Guix. |
| 15 | ;;; |
| 16 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 17 | ;;; under the terms of the GNU General Public License as published by |
| 18 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 19 | ;;; your option) any later version. |
| 20 | ;;; |
| 21 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 22 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 24 | ;;; GNU General Public License for more details. |
| 25 | ;;; |
| 26 | ;;; You should have received a copy of the GNU General Public License |
| 27 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 28 | |
| 29 | (define-module (gnu packages benchmark) |
| 30 | #:use-module ((guix licenses) #:prefix license:) |
| 31 | #:use-module (guix packages) |
| 32 | #:use-module (guix download) |
| 33 | #:use-module (guix git-download) |
| 34 | #:use-module (guix build-system cmake) |
| 35 | #:use-module (guix build-system gnu) |
| 36 | #:use-module (guix build-system python) |
| 37 | #:use-module (gnu packages) |
| 38 | #:use-module (gnu packages check) |
| 39 | #:use-module (gnu packages compression) |
| 40 | #:use-module (gnu packages linux) |
| 41 | #:use-module (gnu packages maths) |
| 42 | #:use-module (gnu packages mpi) |
| 43 | #:use-module (gnu packages perl) |
| 44 | #:use-module (gnu packages python) |
| 45 | #:use-module (gnu packages python-science) |
| 46 | #:use-module (gnu packages python-web) |
| 47 | #:use-module (gnu packages python-xyz) |
| 48 | #:use-module (gnu packages storage) |
| 49 | #:use-module (ice-9 match)) |
| 50 | |
| 51 | (define-public fio |
| 52 | (package |
| 53 | (name "fio") |
| 54 | (version "3.25") |
| 55 | (source (origin |
| 56 | (method url-fetch) |
| 57 | (uri (string-append "https://brick.kernel.dk/snaps/" |
| 58 | "fio-" version ".tar.bz2")) |
| 59 | (sha256 |
| 60 | (base32 |
| 61 | "16r734an459cz1ax3jyhxc269i3syzdkll4qbv18wqaxpm5y34v6")))) |
| 62 | (build-system gnu-build-system) |
| 63 | (arguments |
| 64 | '(#:test-target "test" |
| 65 | #:phases |
| 66 | (modify-phases %standard-phases |
| 67 | (add-after |
| 68 | 'unpack 'patch-paths |
| 69 | (lambda* (#:key inputs outputs #:allow-other-keys) |
| 70 | (let ((out (assoc-ref outputs "out")) |
| 71 | (gnuplot (string-append (assoc-ref inputs "gnuplot") |
| 72 | "/bin/gnuplot"))) |
| 73 | (substitute* "tools/plot/fio2gnuplot" |
| 74 | (("/usr/share/fio") (string-append out "/share/fio")) |
| 75 | ;; FIXME (upstream): The 'gnuplot' executable is used inline |
| 76 | ;; in various os.system() calls mixed with *.gnuplot filenames. |
| 77 | (("; do gnuplot") (string-append "; do " gnuplot)) |
| 78 | (("gnuplot mymath") (string-append gnuplot " mymath")) |
| 79 | (("gnuplot mygraph") (string-append gnuplot " mygraph"))) |
| 80 | #t))) |
| 81 | (replace 'configure |
| 82 | (lambda* (#:key outputs #:allow-other-keys) |
| 83 | ;; The configure script doesn't understand some of the |
| 84 | ;; GNU options, so we can't use #:configure-flags. |
| 85 | (let ((out (assoc-ref outputs "out"))) |
| 86 | (invoke "./configure" |
| 87 | (string-append "--prefix=" out)) |
| 88 | #t))) |
| 89 | ;; The main `fio` executable is fairly small and self contained. |
| 90 | ;; Moving the auxiliary python and gnuplot scripts to a separate |
| 91 | ;; output saves almost 400 MiB on the closure. |
| 92 | (add-after 'install 'move-outputs |
| 93 | (lambda* (#:key outputs #:allow-other-keys) |
| 94 | (let ((oldbin (string-append (assoc-ref outputs "out") "/bin")) |
| 95 | (newbin (string-append (assoc-ref outputs "utils") "/bin"))) |
| 96 | (mkdir-p newbin) |
| 97 | (for-each (lambda (file) |
| 98 | (let ((src (string-append oldbin "/" file)) |
| 99 | (dst (string-append newbin "/" file))) |
| 100 | (link src dst) |
| 101 | (delete-file src))) |
| 102 | '("fio2gnuplot" "fiologparser_hist.py" |
| 103 | "fiologparser.py")) |
| 104 | ;; Make sure numpy et.al is found. |
| 105 | (wrap-program (string-append newbin "/fiologparser_hist.py") |
| 106 | `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))) |
| 107 | #t)))))) |
| 108 | (outputs '("out" "utils")) |
| 109 | (inputs |
| 110 | `(("ceph" ,ceph "lib") |
| 111 | ("libaio" ,libaio) |
| 112 | ("gnuplot" ,gnuplot) |
| 113 | ("zlib" ,zlib) |
| 114 | ("python-numpy" ,python2-numpy) |
| 115 | ("python-pandas" ,python2-pandas) |
| 116 | ("python" ,python-2))) |
| 117 | (home-page "https://github.com/axboe/fio") |
| 118 | (synopsis "Flexible I/O tester") |
| 119 | (description |
| 120 | "fio is a tool that will spawn a number of threads or processes doing a |
| 121 | particular type of I/O action as specified by the user. The typical use of fio |
| 122 | is to write a job file matching the I/O load one wants to simulate.") |
| 123 | ;; The software is distributed under the GPL2, but a handful of components |
| 124 | ;; are covered by other licenses. |
| 125 | (license (list license:gpl2 license:gpl2+ license:bsd-2 |
| 126 | license:public-domain)))) |
| 127 | |
| 128 | ;; Parameterized in anticipation of m(va)pich support |
| 129 | (define (intel-mpi-benchmarks mpi) |
| 130 | (package |
| 131 | (name (string-append "intel-mpi-benchmarks" |
| 132 | (if (string=? (package-name mpi) "openmpi") |
| 133 | "" |
| 134 | (string-append "-" (package-name mpi))))) |
| 135 | (version "2019.6") |
| 136 | (source (origin |
| 137 | (method git-fetch) |
| 138 | (uri (git-reference |
| 139 | (url "https://github.com/intel/mpi-benchmarks") |
| 140 | (commit (string-append "IMB-v" version)))) |
| 141 | (file-name (git-file-name name version)) |
| 142 | (sha256 |
| 143 | (base32 |
| 144 | "02hxbk9g9nl59bk5qcfl3djj7b58vsqys340m1xdbyqwcrbnahh9")) |
| 145 | (modules '((guix build utils))) |
| 146 | (snippet |
| 147 | '(begin |
| 148 | ;; Some source configuration files in the original tarball |
| 149 | ;; have inappropriate execute permissions, which interferes |
| 150 | ;; with the install phase below. |
| 151 | (for-each (lambda (file) (chmod file #o444)) |
| 152 | (find-files "WINDOWS" ".")) |
| 153 | #t)))) |
| 154 | (build-system gnu-build-system) |
| 155 | (inputs |
| 156 | `(("mpi" ,mpi))) |
| 157 | (arguments |
| 158 | `(#:phases |
| 159 | (modify-phases %standard-phases |
| 160 | (delete 'configure) |
| 161 | (delete 'check) |
| 162 | (replace 'install |
| 163 | (lambda* (#:key outputs #:allow-other-keys) |
| 164 | (define (benchmark? file stat) |
| 165 | (and (string-prefix? "IMB-" (basename file)) |
| 166 | (executable-file? file))) |
| 167 | |
| 168 | (let* ((out (assoc-ref outputs "out")) |
| 169 | (bin (string-append out "/bin"))) |
| 170 | (for-each (lambda (file) |
| 171 | (install-file file bin)) |
| 172 | (find-files "." benchmark?)) |
| 173 | #t)))) |
| 174 | |
| 175 | ;; The makefile doesn't express all the dependencies, it seems. |
| 176 | #:parallel-build? #t |
| 177 | |
| 178 | #:make-flags '("CC=mpicc" "CXX=mpicxx"))) |
| 179 | (home-page "https://software.intel.com/en-us/articles/intel-mpi-benchmarks") |
| 180 | (synopsis "Benchmarks for the Message Passing Interface (MPI)") |
| 181 | (description |
| 182 | "This package provides benchmarks for implementations of the @dfn{Message |
| 183 | Passing Interface} (MPI). It contains MPI performance measurements for |
| 184 | point-to-point and global communication, and file, operations for a range of |
| 185 | message sizes. The generated benchmark data fully characterize: |
| 186 | |
| 187 | @itemize |
| 188 | @item |
| 189 | Performance of a cluster system, including node performance, network latency, |
| 190 | and throughput; |
| 191 | @item |
| 192 | Efficiency of the MPI implementation. |
| 193 | @end itemize") |
| 194 | (license license:cpl1.0))) |
| 195 | |
| 196 | (define-public intel-mpi-benchmarks/openmpi |
| 197 | (intel-mpi-benchmarks openmpi)) |
| 198 | |
| 199 | (define-public imb-openmpi |
| 200 | (deprecated-package "imb-openmpi" intel-mpi-benchmarks/openmpi)) |
| 201 | |
| 202 | (define-public multitime |
| 203 | (package |
| 204 | (name "multitime") |
| 205 | (version "1.4") |
| 206 | (source (origin |
| 207 | (method url-fetch) |
| 208 | (uri (string-append "https://tratt.net/laurie/src/" |
| 209 | "multitime/releases/" |
| 210 | "multitime-" version ".tar.gz")) |
| 211 | (sha256 |
| 212 | (base32 |
| 213 | "0iyfsdrbyqa7a4ifrh19l9a48hgv7ld6m0d8yf9bkl12q0qw91fx")))) |
| 214 | (build-system gnu-build-system) |
| 215 | (arguments '(#:tests? #f)) ; there are no tests |
| 216 | (home-page "https://tratt.net/laurie/src/multitime/") |
| 217 | (synopsis "Time command execution over multiple executions") |
| 218 | (description |
| 219 | "The @code{time} utility is a simple and often effective way of measuring |
| 220 | how long a command takes to run (wall time). Unfortunately, running a command |
| 221 | once can give misleading timings. @code{multitime} is, in essence, a simple |
| 222 | extension to @code{time} which runs a command multiple times and prints the |
| 223 | timing means, standard deviations, mins, medians, and maxes having done so. |
| 224 | This can give a much better understanding of the command's performance.") |
| 225 | (license license:expat))) |
| 226 | |
| 227 | (define-public benchmark |
| 228 | (package |
| 229 | (name "benchmark") |
| 230 | (version "1.5.2") |
| 231 | (source (origin |
| 232 | (method git-fetch) |
| 233 | (uri (git-reference |
| 234 | (url "https://github.com/google/benchmark") |
| 235 | (commit (string-append "v" version)))) |
| 236 | (file-name (git-file-name name version)) |
| 237 | (sha256 |
| 238 | (base32 |
| 239 | "13rxagpzw6bal6ajlmrxlh9kgfvcixn6j734b2bvfqz7lch8n0pa")))) |
| 240 | (build-system cmake-build-system) |
| 241 | (native-inputs |
| 242 | `(("googletest-source" ,(package-source googletest)) |
| 243 | ("googletest" ,googletest))) |
| 244 | (arguments |
| 245 | `(#:phases |
| 246 | (modify-phases %standard-phases |
| 247 | (add-after 'unpack 'unpack-googletest |
| 248 | (lambda* (#:key inputs #:allow-other-keys) |
| 249 | (copy-recursively (assoc-ref inputs "googletest-source") |
| 250 | "googletest") |
| 251 | #t))))) |
| 252 | (home-page "https://github.com/google/benchmark") |
| 253 | (synopsis "Microbenchmark support library") |
| 254 | (description |
| 255 | "Benchmark is a library to benchmark code snippets, similar to unit |
| 256 | tests.") |
| 257 | (license license:asl2.0))) |
| 258 | |
| 259 | (define-public bonnie++ |
| 260 | (package |
| 261 | (name "bonnie++") |
| 262 | (version "1.98") |
| 263 | (source (origin |
| 264 | (method url-fetch) |
| 265 | (uri (string-append "https://www.coker.com.au/bonnie++/bonnie++-" |
| 266 | version ".tgz")) |
| 267 | (sha256 |
| 268 | (base32 |
| 269 | "010bmlmi0nrlp3aq7p624sfaj5a65lswnyyxk3cnz1bqig0cn2vf")))) |
| 270 | (build-system gnu-build-system) |
| 271 | (native-inputs |
| 272 | `(("perl" ,perl))) |
| 273 | (arguments '(#:tests? #f)) ; there are no tests |
| 274 | (home-page "https://doc.coker.com.au/projects/bonnie/") |
| 275 | (synopsis "Hard drive and file system benchmark suite") |
| 276 | (description |
| 277 | "Bonnie++ is a benchmark suite that is aimed at performing a number of |
| 278 | simple tests of hard drive and file system performance. Bonnie++ allows you to |
| 279 | benchmark how your file systems perform with respect to data read and write |
| 280 | speed, the number of seeks that can be performed per second, and the number of |
| 281 | file metadata operations that can be performed per second.") |
| 282 | (license license:gpl2))) ;GPL 2 only, see copyright.txt |
| 283 | |
| 284 | (define-public python-locust |
| 285 | (package |
| 286 | (name "python-locust") |
| 287 | (version "1.4.1") |
| 288 | (source |
| 289 | (origin |
| 290 | (method url-fetch) |
| 291 | (uri (pypi-uri "locust" version)) |
| 292 | (sha256 |
| 293 | (base32 |
| 294 | "1q2nza37fwsqf8qdmisfz6bmjpss90shi1bajrclf6gkbslhryxl")))) |
| 295 | (build-system python-build-system) |
| 296 | (arguments |
| 297 | `(#:phases |
| 298 | (modify-phases %standard-phases |
| 299 | (add-before 'check 'extend-PATH |
| 300 | ;; Add the 'locust' script to PATH, which is used in the test |
| 301 | ;; suite. |
| 302 | (lambda* (#:key outputs #:allow-other-keys) |
| 303 | (let ((out (assoc-ref outputs "out"))) |
| 304 | (setenv "PATH" (string-append out "/bin:" |
| 305 | (getenv "PATH")))) |
| 306 | #t)) |
| 307 | (replace 'check |
| 308 | (lambda _ |
| 309 | (invoke "python" "-m" "pytest" |
| 310 | "-k" (string-join |
| 311 | (list |
| 312 | ;; These tests return "non-zero exit status 1". |
| 313 | "not test_default_headless_spawn_options" |
| 314 | "not test_default_headless_spawn_options_with_shape" |
| 315 | "not test_headless_spawn_options_wo_run_time" |
| 316 | ;; This test depends on networking. |
| 317 | "not test_web_options" |
| 318 | ;; This test fails because of the warning "System open |
| 319 | ;; file limit '1024' is below minimum setting '10000'". |
| 320 | "not test_skip_logging") " and ")) |
| 321 | #t))))) |
| 322 | (propagated-inputs |
| 323 | `(("python-configargparse" ,python-configargparse) |
| 324 | ("python-flask" ,python-flask) |
| 325 | ("python-flask-basicauth" ,python-flask-basicauth) |
| 326 | ("python-gevent" ,python-gevent) |
| 327 | ("python-geventhttpclient" ,python-geventhttpclient) |
| 328 | ("python-msgpack" ,python-msgpack) |
| 329 | ("python-psutil" ,python-psutil) |
| 330 | ("python-pyzmq" ,python-pyzmq) |
| 331 | ("python-requests" ,python-requests) |
| 332 | ("python-werkzeug" ,python-werkzeug))) |
| 333 | (native-inputs |
| 334 | `(("python-mock" ,python-mock) |
| 335 | ("python-pyquery" ,python-pyquery) |
| 336 | ("python-pytest" ,python-pytest))) ;for more easily skipping tests |
| 337 | (home-page "https://locust.io/") |
| 338 | (synopsis "Distributed load testing framework") |
| 339 | (description "Locust is a performance testing tool that aims to be easy to |
| 340 | use, scriptable and scalable. The test scenarios are described in plain |
| 341 | Python. It provides a web-based user interface to visualize the results in |
| 342 | real-time, but can also be run non-interactively. Locust is primarily geared |
| 343 | toward testing HTTP-based applications or services, but it can be customized to |
| 344 | test any system or protocol.") |
| 345 | (license license:expat))) |