benchmark.scm 18 KB

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