comparison README.md @ 1284:f19c51ddbd72 tooling/benchmarks

Update readme with info about running benchmarks from make. Fix typos
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 02 Mar 2023 09:59:42 +0100
parents d4d1eae7c7ca
children 68dd0c9f5cac
comparison
equal deleted inserted replaced
1274:c8d6580d9307 1284:f19c51ddbd72
27 Pkg.test(test_args=["*/lazy_tensor_operations_test.jl", "Grids/*"]) 27 Pkg.test(test_args=["*/lazy_tensor_operations_test.jl", "Grids/*"])
28 ``` 28 ```
29 will run any file named `lazy_tensor_operations_test.jl` and all the files in the `Grids` folder. 29 will run any file named `lazy_tensor_operations_test.jl` and all the files in the `Grids` folder.
30 30
31 ## Running benchmarks 31 ## Running benchmarks
32 Benchmarks are defined in `benchmark/` and use the tools for benchmark suites in BenchmarkTools.jl 32 Benchmarks are defined in `benchmark/` and use the tools for benchmark suites in BenchmarkTools.jl. The format is compatible with PkgBenchmark.jl which helps with running the suite, comparing results and presenting the results in a readable way. There are custom functions included for running the benchmarks in this Mercurial repository.
33 The format is compatible with PkgBenchmark.jl which helps with running the suite, comparing results and presenting the results in a readable way.
34 33
35 `benchmark/` contains a julia environment with the necessary packages for working with the benchmarks. 34 `benchmark/` contains a julia environment with the necessary packages for working with the benchmarks.
36 35
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`. 36 To run the benchmarks, either use `make` run them manually from the REPL, as explained further below.
38 37
39 The suite can then be run from the REPL by using the function `main` in one of the following ways 38 Using `make` there are four targets for benchmarks
39 ```shell
40 make benchmark # Runs the suite for the current working directory
41 make benchmarkrev REV=rev # Runs the suite at the specified revision
42 make benchmarkcmp TARGET=target BASELINE=baseline # Compares two revisions
43 make cleanbenchmark # Cleans up benchmark tunings and results
44 ```
45 Here `rev`, `target` and `baseline` are any valid Mercurial revision specifiers. Note that `make benchmarkrev` and `make benchmarkcmp` will fail if you have pending changes in your repository.
46
47
48 Alternatively, the benchmarks can be run from the REPL. To do this, first activate the environment in `benchmark/` then include the file `benchmark_utils.jl`. The suite can then be run using the function `main` in one of the following ways
40 49
41 ```julia 50 ```julia
42 main() # Runs the suite for the current working directory 51 main() # Runs the suite for the current working directory
43 main(rev) # Runs the suite at the specified revision 52 main(rev) # Runs the suite at the specified revision
44 main(target, baseline) # Compares two revisions 53 main(target, baseline) # Compares two revisions
45 ``` 54 ```
46 55
47 Here `rev`, `target` and `baseline` can be any valid Mercurial revision specifier. 56 Again, `rev`, `target` and `baseline` are any valid Mercurial revision specifiers. Note that `main(rev)` and `main(target, baseline)` will fail if you have pending changes in your repository.
48 57
49 PkgBenchmark can also be used directly. 58 PkgBenchmark can also be used directly.
50 59
51 ```julia 60 ```julia
52 using PkgBenchmark 61 using PkgBenchmark
57 ``` 66 ```
58 67
59 ## Generating and using the documentation 68 ## Generating and using the documentation
60 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. 69 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.
61 70
62 Using `make` there are three targets 71 Using `make` there are four targets for documentation
63 ```shell 72 ```shell
64 make docs 73 make docs # generates files suitable for webserver deployment, i.e with `prettyurls=true`
65 make localdocs 74 make localdocs # generates files suitable for local viewing in a web browser, i.e `prettyurls=false`
66 make opendocs 75 make opendocs # view documentation locally
67 make help 76 make cleandocs # cleans up generated files
68 ```
69 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
70 ```shell
71 make opendocs
72 ``` 77 ```
73 78
74 When including the `docs/make.jl` script `prettyurls` is set to `false` by default. 79 Alternatively, to view the documentation locally simply open `docs/build/index.html` in your web browser. When including the `docs/make.jl` script `prettyurls` is set to `false` by default.
75 80
76 Including `docs/make.jl` from the REPL may be preferable when repeatadely building the documentation since this avoids compilation latency. 81 Including `docs/make.jl` from the REPL may be preferable when repeatedly building the documentation since this avoids compilation latency.