|
1 | | -# Benchmark |
| 1 | +# LinearOperator - a generic, high-level expression syntax for linear algebra |
2 | 2 |
|
3 | | -## files: |
| 3 | +This repository contains all benchmarks and source codes to reproduce the |
| 4 | +results of the article |
4 | 5 |
|
5 | | - - **./bench_scripts/run.sh** : generate all benchmark |
| 6 | +*LinearOperator - a generic, high-level expression syntax for linear algebra* |
6 | 7 |
|
7 | | -## benchmarks: |
| 8 | +2016, Matthias Maier, Mauro Bardelloni, Luca Heltai |
| 9 | + |
| 10 | +In particular, it requires the deal.II library (version greater or equal than 8.3) |
| 11 | +and the eigen and blaze libraries. |
8 | 12 |
|
9 | | -### eigen.cc |
| 13 | +Submodules for both eigen and blaze are provided, for your convenience. If you install |
| 14 | +from github, you should make sure you download all submodules: |
10 | 15 |
|
11 | | -Compare a simple and a smart implementation of a code based on Eigen with a |
12 | | -code based on LinearOperator Class. |
| 16 | + git clone --recursive https://github.com/mathLab/LinearOperator.git |
13 | 17 |
|
14 | | -The benchmark consists in the evaluation of **A^3** where **A** is a |
15 | | -matrix. |
| 18 | +or, if you already have a clone of the LinearOperator repository, you can get the |
| 19 | +submodules by the following command (inside your local LinearOperator repository) |
16 | 20 |
|
17 | | -### full_matrix_01.cc |
| 21 | + git submodule update --init --recursive |
18 | 22 |
|
19 | | -Define a full matrix and compare a raw implementation of matrix-vector |
20 | | -multiplication with the one based on LinearOperator Class. |
| 23 | +## Installation |
21 | 24 |
|
22 | | -### full_matrix_02.cc |
| 25 | +Assuming you installed correctly the `deal.II` library (www.dealii.org) under the path |
| 26 | +`/path/to/dealii`, then issuing the following commands should create all executables |
| 27 | +for the benchmarks presented in the paper: |
23 | 28 |
|
24 | | -Define a full matrix **A** and compare a raw implementation of **(3Id + |
25 | | -A)A** with the one based on LinearOperator Class. |
| 29 | + mkdir build |
| 30 | + cd build |
| 31 | + cmake -DDEAL_II_DIR=/path/to/dealii .. # Alternatively, set DEAL_II_DIR env variable |
| 32 | + make |
26 | 33 |
|
27 | | -### sparse_matrix_01.cc |
| 34 | +this will create a few executables in the `build` directory. |
28 | 35 |
|
29 | | -Define a sparse matrix and compare a raw implementation of matrix-vector |
30 | | -multiplication with the one based on LinearOperator Class. |
| 36 | +If you want to reproduce the results of the articles, we provide the following script |
| 37 | + |
| 38 | + ./script/matrix.sh |
31 | 39 |
|
32 | | -### sparse_matrix_02.cc |
| 40 | +which will create a directory `build_matrix_test`, configure, build and run all tests, |
| 41 | +outputting the results into the directory `./build_matrix_test/output_dir` |
33 | 42 |
|
34 | | -Define a sparse matrix **A** and compare a raw implementation of $(3Id + |
35 | | -A)A$ with the one based on LinearOperator Class. |
| 43 | +## benchmarks: |
36 | 44 |
|
37 | | -### triple_add_01.cc |
| 45 | +Each benchmark is included in the directory `./apps`, and makes a comparison between |
| 46 | +some simple operations involving either dense matrices or sparse matrices implemented |
| 47 | +in `dealii`, `eigen`, or `blaze`, and two variants involving `LinearOperator` and |
| 48 | +`PackagedOperation` objects. The first variant involves the creation of temporary |
| 49 | +`PackagedOperation` objects in each loop, while the second makes one construction |
| 50 | +outside the loop, and only uses the objects that have been previously constructed. |
38 | 51 |
|
39 | | -Compare a raw implementation of $A(x+y+z)$ with the one based on |
40 | | -LinearOperator Class. |
| 52 | +The following tests are provided: |
41 | 53 |
|
42 | | -This code uses **vmult_add** in the raw section. |
| 54 | +### `{full,sparse}_matrix_01.cc` |
43 | 55 |
|
44 | | -### triple_add_02.cc |
| 56 | +Compute `M*v` |
45 | 57 |
|
46 | | -Compare a raw implementation of $A(x+y+z)$ with the one based on |
47 | | -LinearOperator Class. |
| 58 | +### `{full,sparse}_matrix_02.cc` |
48 | 59 |
|
49 | | -This code uses **+=** in the raw section. |
| 60 | +Compute `M*M*M*v` |
50 | 61 |
|
51 | | -### Stokes |
| 62 | +### `{full,sparse}_matrix_03.cc` |
52 | 63 |
|
53 | | -Benchmark for the LinearOperator class. This code assemble a preconditioner |
54 | | -for Stokes using two different approaches: |
55 | | - - Assembling the matrix and performing |
56 | | -every operation in the usual way |
57 | | - - Assembling the matrix, defining the |
58 | | -associated LinearOperators, and then performing all the operations using an |
59 | | -high-level syntax (LinearOperator). |
| 64 | +Compute `(3*Id+M)*M*v` |
60 | 65 |
|
61 | | -### step-6 |
| 66 | +### `{full,sparse}_matrix_04.cc` |
62 | 67 |
|
63 | | -Benchmark for constraints linear operator. |
| 68 | +Compute `M*(x+y+z)` |
64 | 69 |
|
65 | | -### step-40 |
| 70 | +### step_32.cc |
66 | 71 |
|
67 | | -Parallel version of the previous benchmark. |
| 72 | +Compute a preconditioner for Stokes system, using a low level `deal.II` implementation, |
| 73 | +or using a `LinearOperator` variant. |
0 commit comments