gnu: Separate Python core packages from the rest.
[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 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
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 build-system gnu)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages linux)
29 #:use-module (gnu packages maths)
30 #:use-module (gnu packages mpi)
31 #:use-module (gnu packages python)
32 #:use-module (gnu packages python-xyz)
33 #:use-module (gnu packages storage)
34 #:use-module (ice-9 match))
35
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
113 ;; Parameterized in anticipation of m(va)pich support
114 (define (imb mpi)
115 (package
116 (name (string-append "imb-" (package-name mpi)))
117 (version "2017.2")
118 (source
119 (origin
120 (method url-fetch)
121 (uri (match (string-split version #\.)
122 ((major minor)
123 (string-append
124 "https://software.intel.com/sites/default/files/managed/76/6c/IMB_"
125 major "_Update" minor ".tgz"))))
126 (sha256 (base32 "11nczxm686rsppmw9gjc2p2sxc0jniv5kv18yxm1lzp5qfh5rqyb"))))
127 (build-system gnu-build-system)
128 (inputs
129 `(("mpi" ,mpi)))
130 (arguments
131 `(#:phases
132 (modify-phases %standard-phases
133 (delete 'configure)
134 (delete 'check)
135 (replace 'build
136 (lambda* (#:key inputs #:allow-other-keys)
137 (let ((mpi-home (assoc-ref inputs "mpi")))
138 (zero?
139 ;; Not safe for parallel build
140 (system* "make" "-C" "imb/src" "-f" "make_mpich" "SHELL=sh"
141 (string-append "MPI_HOME=" mpi-home))))))
142 (replace 'install
143 (lambda* (#:key outputs #:allow-other-keys)
144 (let* ((out (assoc-ref outputs "out"))
145 (doc (string-append out "/share/doc/" ,name))
146 (bin (string-append out "/bin")))
147 (with-directory-excursion "imb/src"
148 (for-each
149 (lambda (file)
150 (install-file file bin))
151 '("IMB-IO" "IMB-EXT" "IMB-MPI1" "IMB-NBC" "IMB-RMA")))
152 (mkdir-p doc)
153 (with-directory-excursion "imb"
154 (copy-recursively "license" doc)))
155 #t)))))
156 (home-page "https://software.intel.com/en-us/articles/intel-mpi-benchmarks")
157 (synopsis "Intel MPI Benchmarks")
158 (description
159 "This package provides benchmarks for implementations of the @dfn{Message
160 Passing Interface} (MPI). It contains MPI performance measurements for
161 point-to-point and global communication, and file, operations for a range of
162 message sizes. The generated benchmark data fully characterize:
163
164 @itemize
165 @item
166 Performance of a cluster system, including node performance, network latency,
167 and throughput;
168 @item
169 Efficiency of the MPI implementation.
170 @end itemize")
171 (license license:cpl1.0)))
172
173 (define-public imb-openmpi (imb openmpi))