benchmark.scm 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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–2021 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, 2021 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, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  12. ;;; Copyright © 2020 Greg Hogan <code@greghogan.com>
  13. ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
  14. ;;;
  15. ;;; This file is part of GNU Guix.
  16. ;;;
  17. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  18. ;;; under the terms of the GNU General Public License as published by
  19. ;;; the Free Software Foundation; either version 3 of the License, or (at
  20. ;;; your option) any later version.
  21. ;;;
  22. ;;; GNU Guix is distributed in the hope that it will be useful, but
  23. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  24. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. ;;; GNU General Public License for more details.
  26. ;;;
  27. ;;; You should have received a copy of the GNU General Public License
  28. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  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 opencl)
  44. #:use-module (gnu packages perl)
  45. #:use-module (gnu packages python)
  46. #:use-module (gnu packages python-science)
  47. #:use-module (gnu packages python-web)
  48. #:use-module (gnu packages python-xyz)
  49. #:use-module (gnu packages storage)
  50. #:use-module (ice-9 match))
  51. (define-public fio
  52. (package
  53. (name "fio")
  54. (version "3.28")
  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. "0ba9cnjrnm3nwcfbhh5x2sycr54j3yn1rqn76kjdyz40f3pdg3qm"))))
  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 (search-input-file inputs "/bin/gnuplot")))
  72. (substitute* "tools/plot/fio2gnuplot"
  73. (("/usr/share/fio") (string-append out "/share/fio"))
  74. ;; FIXME (upstream): The 'gnuplot' executable is used inline
  75. ;; in various os.system() calls mixed with *.gnuplot filenames.
  76. (("; do gnuplot") (string-append "; do " gnuplot))
  77. (("gnuplot mymath") (string-append gnuplot " mymath"))
  78. (("gnuplot mygraph") (string-append gnuplot " mygraph"))))))
  79. (replace 'configure
  80. (lambda* (#:key outputs #:allow-other-keys)
  81. ;; The configure script doesn't understand some of the
  82. ;; GNU options, so we can't use #:configure-flags.
  83. (let ((out (assoc-ref outputs "out")))
  84. (invoke "./configure"
  85. (string-append "--prefix=" out)))))
  86. ;; The main `fio` executable is fairly small and self contained.
  87. ;; Moving the auxiliary python and gnuplot scripts to a separate
  88. ;; output saves almost 400 MiB on the closure.
  89. (add-after 'install 'move-outputs
  90. (lambda* (#:key outputs #:allow-other-keys)
  91. (let ((oldbin (string-append (assoc-ref outputs "out") "/bin"))
  92. (newbin (string-append (assoc-ref outputs "utils") "/bin")))
  93. (mkdir-p newbin)
  94. (for-each (lambda (file)
  95. (let ((src (string-append oldbin "/" file))
  96. (dst (string-append newbin "/" file)))
  97. (link src dst)
  98. (delete-file src)))
  99. '("fio2gnuplot" "fiologparser_hist.py"
  100. "fiologparser.py"))
  101. ;; Make sure numpy et.al is found.
  102. (wrap-program (string-append newbin "/fiologparser_hist.py")
  103. `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))))))))
  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. (define-public intel-mpi-benchmarks/openmpi
  124. (package
  125. (name "intel-mpi-benchmarks")
  126. (version "2019.6")
  127. (source (origin
  128. (method git-fetch)
  129. (uri (git-reference
  130. (url "https://github.com/intel/mpi-benchmarks")
  131. (commit (string-append "IMB-v" version))))
  132. (file-name (git-file-name name version))
  133. (sha256
  134. (base32
  135. "02hxbk9g9nl59bk5qcfl3djj7b58vsqys340m1xdbyqwcrbnahh9"))
  136. (modules '((guix build utils)))
  137. (snippet
  138. '(begin
  139. ;; Some source configuration files in the original tarball
  140. ;; have inappropriate execute permissions, which interferes
  141. ;; with the install phase below.
  142. (for-each (lambda (file) (chmod file #o444))
  143. (find-files "WINDOWS" "."))
  144. #t))))
  145. (build-system gnu-build-system)
  146. (inputs
  147. `(("openmpi" ,openmpi)))
  148. (arguments
  149. `(#:phases
  150. (modify-phases %standard-phases
  151. (delete 'configure)
  152. (delete 'check)
  153. (replace 'install
  154. (lambda* (#:key outputs #:allow-other-keys)
  155. (define (benchmark? file stat)
  156. (and (string-prefix? "IMB-" (basename file))
  157. (executable-file? file)))
  158. (let* ((out (assoc-ref outputs "out"))
  159. (bin (string-append out "/bin")))
  160. (for-each (lambda (file)
  161. (install-file file bin))
  162. (find-files "." benchmark?))
  163. #t))))
  164. ;; The makefile doesn't express all the dependencies, it seems.
  165. #:parallel-build? #t
  166. #:make-flags '("CC=mpicc" "CXX=mpicxx")))
  167. (home-page "https://software.intel.com/en-us/articles/intel-mpi-benchmarks")
  168. (synopsis "Benchmarks for the Message Passing Interface (MPI)")
  169. (description
  170. "This package provides benchmarks for implementations of the @dfn{Message
  171. Passing Interface} (MPI). It contains MPI performance measurements for
  172. point-to-point and global communication, and file, operations for a range of
  173. message sizes. The generated benchmark data fully characterize:
  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. (define-public imb-openmpi
  183. (deprecated-package "imb-openmpi" intel-mpi-benchmarks/openmpi))
  184. (define-public multitime
  185. (package
  186. (name "multitime")
  187. (version "1.4")
  188. (source (origin
  189. (method url-fetch)
  190. (uri (string-append "https://tratt.net/laurie/src/"
  191. "multitime/releases/"
  192. "multitime-" version ".tar.gz"))
  193. (sha256
  194. (base32
  195. "0iyfsdrbyqa7a4ifrh19l9a48hgv7ld6m0d8yf9bkl12q0qw91fx"))))
  196. (build-system gnu-build-system)
  197. (arguments '(#:tests? #f)) ; there are no tests
  198. (home-page "https://tratt.net/laurie/src/multitime/")
  199. (synopsis "Time command execution over multiple executions")
  200. (description
  201. "The @code{time} utility is a simple and often effective way of measuring
  202. how long a command takes to run (wall time). Unfortunately, running a command
  203. once can give misleading timings. @code{multitime} is, in essence, a simple
  204. extension to @code{time} which runs a command multiple times and prints the
  205. timing means, standard deviations, mins, medians, and maxes having done so.
  206. This can give a much better understanding of the command's performance.")
  207. (license license:expat)))
  208. (define-public benchmark
  209. (package
  210. (name "benchmark")
  211. (version "1.5.6")
  212. (source (origin
  213. (method git-fetch)
  214. (uri (git-reference
  215. (url "https://github.com/google/benchmark")
  216. (commit (string-append "v" version))))
  217. (file-name (git-file-name name version))
  218. (sha256
  219. (base32
  220. "030g4d8vpn2442dsap0qw86lsw7xfl36k0x0x9bn0vvm11qvjn8c"))))
  221. (build-system cmake-build-system)
  222. (native-inputs
  223. `(("googletest-source" ,(package-source googletest))
  224. ("googletest" ,googletest)))
  225. (arguments
  226. `(#:phases
  227. (modify-phases %standard-phases
  228. (add-after 'unpack 'unpack-googletest
  229. (lambda* (#:key inputs #:allow-other-keys)
  230. (copy-recursively (assoc-ref inputs "googletest-source")
  231. "googletest"))))))
  232. (home-page "https://github.com/google/benchmark")
  233. (synopsis "Microbenchmark support library")
  234. (description
  235. "Benchmark is a library to benchmark code snippets, similar to unit
  236. tests.")
  237. (license license:asl2.0)))
  238. (define-public bonnie++
  239. (package
  240. (name "bonnie++")
  241. (version "1.98")
  242. (source (origin
  243. (method url-fetch)
  244. (uri (string-append "https://www.coker.com.au/bonnie++/bonnie++-"
  245. version ".tgz"))
  246. (sha256
  247. (base32
  248. "010bmlmi0nrlp3aq7p624sfaj5a65lswnyyxk3cnz1bqig0cn2vf"))))
  249. (build-system gnu-build-system)
  250. (native-inputs
  251. `(("perl" ,perl)))
  252. (arguments '(#:tests? #f)) ; there are no tests
  253. (home-page "https://doc.coker.com.au/projects/bonnie/")
  254. (synopsis "Hard drive and file system benchmark suite")
  255. (description
  256. "Bonnie++ is a benchmark suite that is aimed at performing a number of
  257. simple tests of hard drive and file system performance. Bonnie++ allows you to
  258. benchmark how your file systems perform with respect to data read and write
  259. speed, the number of seeks that can be performed per second, and the number of
  260. file metadata operations that can be performed per second.")
  261. (license license:gpl2))) ;GPL 2 only, see copyright.txt
  262. (define-public python-locust
  263. (package
  264. (name "python-locust")
  265. (version "1.4.3")
  266. (source
  267. (origin
  268. (method url-fetch)
  269. (uri (pypi-uri "locust" version))
  270. (sha256
  271. (base32
  272. "0vmw151xcaznd2j85n96iyv9fniss0bkk91xn4maw2gwzym424xk"))))
  273. (build-system python-build-system)
  274. (arguments
  275. `(#:phases
  276. (modify-phases %standard-phases
  277. (add-before 'check 'extend-PATH
  278. ;; Add the 'locust' script to PATH, which is used in the test
  279. ;; suite.
  280. (lambda* (#:key outputs #:allow-other-keys)
  281. (let ((out (assoc-ref outputs "out")))
  282. (setenv "PATH" (string-append out "/bin:"
  283. (getenv "PATH"))))))
  284. (replace 'check
  285. (lambda _
  286. (invoke "python" "-m" "pytest"
  287. "-k" (string-join
  288. (list
  289. ;; These tests return "non-zero exit status 1".
  290. "not test_default_headless_spawn_options"
  291. "not test_default_headless_spawn_options_with_shape"
  292. "not test_headless_spawn_options_wo_run_time"
  293. ;; These tests depend on networking.
  294. "not test_html_report_option"
  295. "not test_web_options"
  296. ;; This test fails because of the warning "System open
  297. ;; file limit '1024' is below minimum setting '10000'".
  298. "not test_skip_logging"
  299. ;; On some (slow?) machines, the following tests
  300. ;; fail, with the processes returning exit code
  301. ;; -15 instead of the expected 42 and 0,
  302. ;; respectively (see:
  303. ;; https://github.com/locustio/locust/issues/1708).
  304. "not test_custom_exit_code"
  305. "not test_webserver") " and ")))))))
  306. (propagated-inputs
  307. `(("python-configargparse" ,python-configargparse)
  308. ("python-flask" ,python-flask)
  309. ("python-flask-basicauth" ,python-flask-basicauth)
  310. ("python-gevent" ,python-gevent)
  311. ("python-geventhttpclient" ,python-geventhttpclient)
  312. ("python-msgpack" ,python-msgpack)
  313. ("python-psutil" ,python-psutil)
  314. ("python-pyzmq" ,python-pyzmq)
  315. ("python-requests" ,python-requests)
  316. ("python-werkzeug" ,python-werkzeug)))
  317. (native-inputs
  318. `(("python-mock" ,python-mock)
  319. ("python-pyquery" ,python-pyquery)
  320. ("python-pytest" ,python-pytest))) ;for more easily skipping tests
  321. (home-page "https://locust.io/")
  322. (synopsis "Distributed load testing framework")
  323. (description "Locust is a performance testing tool that aims to be easy to
  324. use, scriptable and scalable. The test scenarios are described in plain
  325. Python. It provides a web-based user interface to visualize the results in
  326. real-time, but can also be run non-interactively. Locust is primarily geared
  327. toward testing HTTP-based applications or services, but it can be customized to
  328. test any system or protocol.
  329. Note: Locust will complain if the available open file descriptors limit for
  330. the user is too low. To raise such limit on a Guix System, refer to
  331. @samp{info guix --index-search=pam-limits-service}.")
  332. (license license:expat)))
  333. (define-public interbench
  334. (package
  335. (name "interbench")
  336. (version "0.31")
  337. (source
  338. (origin
  339. (method git-fetch)
  340. (uri (git-reference
  341. (url "https://github.com/ckolivas/interbench")
  342. (commit (string-append "v" version))))
  343. (file-name (git-file-name name version))
  344. (sha256
  345. (base32
  346. "0ifnw8vnkcgrksx7g5d9ii4kjppqnk32lvrybdybmibyvag6zfdc"))))
  347. (build-system gnu-build-system)
  348. (arguments
  349. `(#:tests? #f ; no tests
  350. #:phases
  351. (modify-phases %standard-phases
  352. (add-after 'unpack 'fix-broken-makefile
  353. (lambda _
  354. ;; Remove erroneous "-lm" target
  355. (substitute* "Makefile"
  356. (("hackbench.o -lm") "hackbench.o"))))
  357. (delete 'configure)
  358. (replace 'install
  359. (lambda* (#:key outputs #:allow-other-keys)
  360. (let ((out (assoc-ref outputs "out")))
  361. (install-file "interbench" (string-append out "/bin"))
  362. (install-file "interbench.8" (string-append out "/share/man/man8"))))))))
  363. (home-page "http://users.on.net/~ckolivas/interbench/")
  364. (synopsis "Interactivity benchmark")
  365. (description "interbench is designed to benchmark interactivity on Linux.
  366. It is designed to measure the effect of changes in Linux kernel design or
  367. system configuration changes such as CPU, I/O scheduler and filesystem changes
  368. and options. With careful benchmarking, different hardware can be compared.")
  369. (license license:gpl2+)))
  370. (define-public clpeak
  371. ;; Release 1.1.0 is too old for our opencl-clhpp. This commit supports
  372. ;; cl2.hpp.
  373. (let ((commit "6d59cb64997a53c35207b77a63d2e9f0e84de5fd"))
  374. (package
  375. (name "clpeak")
  376. (version (git-version "1.1.0" "0" commit))
  377. (source (origin
  378. (method git-fetch)
  379. (uri (git-reference
  380. (url "https://github.com/krrishnarraj/clpeak.git")
  381. (commit commit)))
  382. (file-name (git-file-name name version))
  383. (sha256
  384. (base32
  385. "0qmhdjyhwl7gfgyqxsddqn6zpp3b57503m16h7jv6illy3lfvji1"))))
  386. (build-system cmake-build-system)
  387. (home-page "https://github.com/krrishnarraj/clpeak")
  388. (inputs
  389. `(("opencl-clhpp" ,opencl-clhpp)
  390. ("opencl-icd-loader" ,opencl-icd-loader)))
  391. (synopsis "OpenCL benchmark tool")
  392. (description
  393. "A synthetic benchmarking tool to measure peak capabilities of OpenCL
  394. devices. It only measures the peak metrics that can be achieved using
  395. vector operations and does not represent a real-world use case.")
  396. (license license:unlicense))))