benchmark.scm 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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 Tobias Geerinckx-Rice <me@tobias.gr>
  5. ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
  6. ;;; Copyright © 2019 Eric Bavier <bavier@member.fsf.org>
  7. ;;;
  8. ;;; This file is part of GNU Guix.
  9. ;;;
  10. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  11. ;;; under the terms of the GNU General Public License as published by
  12. ;;; the Free Software Foundation; either version 3 of the License, or (at
  13. ;;; your option) any later version.
  14. ;;;
  15. ;;; GNU Guix is distributed in the hope that it will be useful, but
  16. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. ;;; GNU General Public License for more details.
  19. ;;;
  20. ;;; You should have received a copy of the GNU General Public License
  21. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  22. (define-module (gnu packages benchmark)
  23. #:use-module ((guix licenses) #:prefix license:)
  24. #:use-module (guix packages)
  25. #:use-module (guix download)
  26. #:use-module (guix git-download)
  27. #:use-module (guix build-system gnu)
  28. #:use-module (gnu packages compression)
  29. #:use-module (gnu packages linux)
  30. #:use-module (gnu packages maths)
  31. #:use-module (gnu packages mpi)
  32. #:use-module (gnu packages python)
  33. #:use-module (gnu packages python-xyz)
  34. #:use-module (gnu packages storage)
  35. #:use-module (ice-9 match))
  36. (define-public fio
  37. (package
  38. (name "fio")
  39. (version "3.11")
  40. (source (origin
  41. (method url-fetch)
  42. (uri (string-append "http://brick.kernel.dk/snaps/"
  43. "fio-" version ".tar.bz2"))
  44. (sha256
  45. (base32
  46. "0s8m0wcz5j6sa1hblj80wk3syy5b4shg7y3gabvm9xa3wj0lzasa"))))
  47. (build-system gnu-build-system)
  48. (arguments
  49. '(#:test-target "test"
  50. #:phases
  51. (modify-phases %standard-phases
  52. (add-after
  53. 'unpack 'patch-paths
  54. (lambda* (#:key inputs outputs #:allow-other-keys)
  55. (let ((out (assoc-ref outputs "out"))
  56. (gnuplot (string-append (assoc-ref inputs "gnuplot")
  57. "/bin/gnuplot")))
  58. (substitute* "tools/plot/fio2gnuplot"
  59. (("/usr/share/fio") (string-append out "/share/fio"))
  60. ;; FIXME (upstream): The 'gnuplot' executable is used inline
  61. ;; in various os.system() calls mixed with *.gnuplot filenames.
  62. (("; do gnuplot") (string-append "; do " gnuplot))
  63. (("gnuplot mymath") (string-append gnuplot " mymath"))
  64. (("gnuplot mygraph") (string-append gnuplot " mygraph")))
  65. #t)))
  66. (replace 'configure
  67. (lambda* (#:key outputs #:allow-other-keys)
  68. ;; The configure script doesn't understand some of the
  69. ;; GNU options, so we can't use #:configure-flags.
  70. (let ((out (assoc-ref outputs "out")))
  71. (invoke "./configure"
  72. (string-append "--prefix=" out))
  73. #t)))
  74. ;; The main `fio` executable is fairly small and self contained.
  75. ;; Moving the auxiliary python and gnuplot scripts to a separate
  76. ;; output saves almost 400 MiB on the closure.
  77. (add-after 'install 'move-outputs
  78. (lambda* (#:key outputs #:allow-other-keys)
  79. (let ((oldbin (string-append (assoc-ref outputs "out") "/bin"))
  80. (newbin (string-append (assoc-ref outputs "utils") "/bin")))
  81. (mkdir-p newbin)
  82. (for-each (lambda (file)
  83. (let ((src (string-append oldbin "/" file))
  84. (dst (string-append newbin "/" file)))
  85. (link src dst)
  86. (delete-file src)))
  87. '("fio2gnuplot" "fiologparser_hist.py"
  88. "fiologparser.py"))
  89. ;; Make sure numpy et.al is found.
  90. (wrap-program (string-append newbin "/fiologparser_hist.py")
  91. `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))
  92. #t))))))
  93. (outputs '("out" "utils"))
  94. (inputs
  95. `(("ceph" ,ceph "lib")
  96. ("libaio" ,libaio)
  97. ("gnuplot" ,gnuplot)
  98. ("zlib" ,zlib)
  99. ("python-numpy" ,python2-numpy)
  100. ("python-pandas" ,python2-pandas)
  101. ("python" ,python-2)))
  102. (home-page "https://github.com/axboe/fio")
  103. (synopsis "Flexible I/O tester")
  104. (description
  105. "fio is a tool that will spawn a number of threads or processes doing a
  106. particular type of I/O action as specified by the user. The typical use of fio
  107. is to write a job file matching the I/O load one wants to simulate.")
  108. ;; The software is distributed under the GPL2, but a handful of components
  109. ;; are covered by other licenses.
  110. (license (list license:gpl2 license:gpl2+ license:bsd-2
  111. license:public-domain))))
  112. ;; Parameterized in anticipation of m(va)pich support
  113. (define (imb mpi)
  114. (package
  115. (name (string-append "imb-" (package-name mpi)))
  116. (version "2019.1")
  117. (source
  118. (origin
  119. (method git-fetch)
  120. (uri (git-reference
  121. (url "https://github.com/intel/mpi-benchmarks.git")
  122. (commit (string-append "v" version))))
  123. (file-name (git-file-name name version))
  124. (sha256 (base32 "18hfdyvl5i172gadiq9si1qxif5rvic0lifxpbrr7s59ylg8f9c4"))))
  125. (build-system gnu-build-system)
  126. (inputs
  127. `(("mpi" ,mpi)))
  128. (arguments
  129. `(#:phases
  130. (modify-phases %standard-phases
  131. (delete 'configure)
  132. (delete 'check)
  133. (replace 'build
  134. (lambda* (#:key inputs #:allow-other-keys)
  135. (let ((mpi-home (assoc-ref inputs "mpi")))
  136. ;; Override default parallelism
  137. (substitute* "Makefile"
  138. (("make -j[[:digit:]]+")
  139. (format #f "make -j~d" (parallel-job-count))))
  140. (invoke "make" "SHELL=sh" "CC=mpicc" "CXX=mpic++"))))
  141. (replace 'install
  142. (lambda* (#:key outputs #:allow-other-keys)
  143. (let* ((out (assoc-ref outputs "out"))
  144. (bin (string-append out "/bin")))
  145. (for-each
  146. (lambda (file)
  147. (install-file file bin))
  148. '("IMB-IO" "IMB-EXT" "IMB-MPI1" "IMB-NBC" "IMB-RMA" "IMB-MT")))
  149. #t)))))
  150. (home-page "https://software.intel.com/en-us/articles/intel-mpi-benchmarks")
  151. (synopsis "Intel MPI Benchmarks")
  152. (description
  153. "This package provides benchmarks for implementations of the @dfn{Message
  154. Passing Interface} (MPI). It contains MPI performance measurements for
  155. point-to-point and global communication, and file, operations for a range of
  156. message sizes. The generated benchmark data fully characterize:
  157. @itemize
  158. @item
  159. Performance of a cluster system, including node performance, network latency,
  160. and throughput;
  161. @item
  162. Efficiency of the MPI implementation.
  163. @end itemize")
  164. (license license:cpl1.0)))
  165. (define-public imb-openmpi (imb openmpi))