Mercurial > repos > public > sbplib_julia
annotate README.md @ 1194:007d90b354af tooling/benchmarks
More readme
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 27 Jan 2023 22:09:13 +0100 |
parents | 04dda6aa9673 |
children | 8a1de954bdf9 |
rev | line source |
---|---|
333
01b851161018
Start converting to one package by moving all the files to their correct location
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
1 # Sbplib |
349
76aa1486124a
Add some info about running tests in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
333
diff
changeset
|
2 |
76aa1486124a
Add some info about running tests in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
333
diff
changeset
|
3 ## Running tests |
76aa1486124a
Add some info about running tests in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
333
diff
changeset
|
4 To run all tests simply run |
76aa1486124a
Add some info about running tests in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
333
diff
changeset
|
5 ``` |
76aa1486124a
Add some info about running tests in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
333
diff
changeset
|
6 (@v1.5) pkg> activate . |
76aa1486124a
Add some info about running tests in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
333
diff
changeset
|
7 (Sbplib) pkg> test |
76aa1486124a
Add some info about running tests in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
333
diff
changeset
|
8 ``` |
76aa1486124a
Add some info about running tests in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
333
diff
changeset
|
9 |
76aa1486124a
Add some info about running tests in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
333
diff
changeset
|
10 If you want to run tests from a specific file in `test/`, you can do |
76aa1486124a
Add some info about running tests in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
333
diff
changeset
|
11 ``` |
76aa1486124a
Add some info about running tests in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
333
diff
changeset
|
12 julia> using Pkg |
709
48a61e085e60
Add function for selecting tests
Jonatan Werpers <jonatan@werpers.com>
parents:
349
diff
changeset
|
13 julia> Pkg.test(test_args=["[glob pattern]"]) |
48a61e085e60
Add function for selecting tests
Jonatan Werpers <jonatan@werpers.com>
parents:
349
diff
changeset
|
14 ``` |
48a61e085e60
Add function for selecting tests
Jonatan Werpers <jonatan@werpers.com>
parents:
349
diff
changeset
|
15 For example |
48a61e085e60
Add function for selecting tests
Jonatan Werpers <jonatan@werpers.com>
parents:
349
diff
changeset
|
16 ``` |
48a61e085e60
Add function for selecting tests
Jonatan Werpers <jonatan@werpers.com>
parents:
349
diff
changeset
|
17 julia> Pkg.test(test_args=["SbpOperators/*"]) |
349
76aa1486124a
Add some info about running tests in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
333
diff
changeset
|
18 ``` |
709
48a61e085e60
Add function for selecting tests
Jonatan Werpers <jonatan@werpers.com>
parents:
349
diff
changeset
|
19 to run all test in the `SbpOperators` folder, or |
48a61e085e60
Add function for selecting tests
Jonatan Werpers <jonatan@werpers.com>
parents:
349
diff
changeset
|
20 ``` |
48a61e085e60
Add function for selecting tests
Jonatan Werpers <jonatan@werpers.com>
parents:
349
diff
changeset
|
21 julia> Pkg.test(test_args=["*/readoperators.jl"]) |
48a61e085e60
Add function for selecting tests
Jonatan Werpers <jonatan@werpers.com>
parents:
349
diff
changeset
|
22 ``` |
48a61e085e60
Add function for selecting tests
Jonatan Werpers <jonatan@werpers.com>
parents:
349
diff
changeset
|
23 to run only the tests in files named `readoperators.jl`. |
717
1c5600a711ae
Allow multiple filters
Jonatan Werpers <jonatan@werpers.com>
parents:
715
diff
changeset
|
24 Multiple filters are allowed and will cause files matching any of the provided |
1c5600a711ae
Allow multiple filters
Jonatan Werpers <jonatan@werpers.com>
parents:
715
diff
changeset
|
25 filters to be run. For example |
1c5600a711ae
Allow multiple filters
Jonatan Werpers <jonatan@werpers.com>
parents:
715
diff
changeset
|
26 ``` |
1c5600a711ae
Allow multiple filters
Jonatan Werpers <jonatan@werpers.com>
parents:
715
diff
changeset
|
27 Pkg.test(test_args=["*/lazy_tensor_operations_test.jl", "Grids/*"]) |
1c5600a711ae
Allow multiple filters
Jonatan Werpers <jonatan@werpers.com>
parents:
715
diff
changeset
|
28 ``` |
1c5600a711ae
Allow multiple filters
Jonatan Werpers <jonatan@werpers.com>
parents:
715
diff
changeset
|
29 will run any file named `lazy_tensor_operations_test.jl` and all the files in the `Grids` folder. |
840
221ce98d2612
Add some instructions to the README
Jonatan Werpers <jonatan@werpers.com>
parents:
717
diff
changeset
|
30 |
1171
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
31 ## Running benchmarks |
1193
04dda6aa9673
Add some things to README.md
Jonatan Werpers <jonatan@werpers.com>
parents:
1191
diff
changeset
|
32 Benchmarks are defined in `benchmark/` and use the tools for benchmark suites in BenchmarkTools.jl |
1171
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
33 The format is compatible with PkgBenchmark.jl which helps with running the suite, comparing results and presenting the results in a readable way. |
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
34 |
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
35 `benchmark/` contains a julia environment with the necessary packages for working with the benchmarks. |
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
36 |
1193
04dda6aa9673
Add some things to README.md
Jonatan Werpers <jonatan@werpers.com>
parents:
1191
diff
changeset
|
37 There are custom functions included for running the benchmarks in this Mercurial repository. To use this first activate the environment in `benchmark/` then include the file `benchmark_utils.jl`. |
1171
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
38 |
1194 | 39 The suite can the be run from the REPL by using the function `main` in one of the following ways |
40 | |
41 ```julia | |
42 main() | |
43 main(rev) | |
44 main(target, baseline) | |
45 ``` | |
46 | |
1171
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
47 ```julia |
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
48 using PkgBenchmark |
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
49 import Sbplib |
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
50 r = benchmarkpkg(Sbplib) |
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
51 |
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
52 export_markdown(stdout, r) |
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
53 ``` |
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
54 |
1191 | 55 #TODO: Finish this and clean it up |
1171
87bc91def1ff
Start setting things up
Jonatan Werpers <jonatan@werpers.com>
parents:
847
diff
changeset
|
56 |
840
221ce98d2612
Add some instructions to the README
Jonatan Werpers <jonatan@werpers.com>
parents:
717
diff
changeset
|
57 |
847 | 58 ## Generating and using the documentation |
840
221ce98d2612
Add some instructions to the README
Jonatan Werpers <jonatan@werpers.com>
parents:
717
diff
changeset
|
59 Generating the documentation can be done using either `make` or through activating the `docs` environment and including the script `docs/make.jl` at the REPL. |
221ce98d2612
Add some instructions to the README
Jonatan Werpers <jonatan@werpers.com>
parents:
717
diff
changeset
|
60 |
847 | 61 Using `make` there are three targets |
840
221ce98d2612
Add some instructions to the README
Jonatan Werpers <jonatan@werpers.com>
parents:
717
diff
changeset
|
62 ```shell |
221ce98d2612
Add some instructions to the README
Jonatan Werpers <jonatan@werpers.com>
parents:
717
diff
changeset
|
63 make docs |
221ce98d2612
Add some instructions to the README
Jonatan Werpers <jonatan@werpers.com>
parents:
717
diff
changeset
|
64 make localdocs |
847 | 65 make opendocs |
66 make help | |
840
221ce98d2612
Add some instructions to the README
Jonatan Werpers <jonatan@werpers.com>
parents:
717
diff
changeset
|
67 ``` |
847 | 68 The first variant generates files suitable for webserver deployment, i.e with `prettyurls=true`. The second generates files sutible for local viewing in a web browser, i.e `prettyurls=false`. To view the documentation locally simply open `docs/build/index.html` in your web browser. The documentation can be automatically built and opened using |
846
c9e35f1ca269
Make the targets properly depend on the source files
Jonatan Werpers <jonatan@werpers.com>
parents:
842
diff
changeset
|
69 ```shell |
c9e35f1ca269
Make the targets properly depend on the source files
Jonatan Werpers <jonatan@werpers.com>
parents:
842
diff
changeset
|
70 make opendocs |
c9e35f1ca269
Make the targets properly depend on the source files
Jonatan Werpers <jonatan@werpers.com>
parents:
842
diff
changeset
|
71 ``` |
842
ef78f730cbb4
More info in the readme
Jonatan Werpers <jonatan@werpers.com>
parents:
840
diff
changeset
|
72 |
840
221ce98d2612
Add some instructions to the README
Jonatan Werpers <jonatan@werpers.com>
parents:
717
diff
changeset
|
73 When including the `docs/make.jl` script `prettyurls` is set to `false` by default. |
221ce98d2612
Add some instructions to the README
Jonatan Werpers <jonatan@werpers.com>
parents:
717
diff
changeset
|
74 |
221ce98d2612
Add some instructions to the README
Jonatan Werpers <jonatan@werpers.com>
parents:
717
diff
changeset
|
75 Including `docs/make.jl` from the REPL may be preferable when repeatadely building the documentation since this avoids compilation latency. |