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