Mercurial > repos > public > sbplib_julia
comparison README.md @ 1362:a6918dfb0cf5 bugfix/lazytensors
Merge with default
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Sun, 21 May 2023 20:51:52 +0200 |
parents | 68dd0c9f5cac |
children | 2b5480e2d4bf 471a948cd2b2 |
comparison
equal
deleted
inserted
replaced
1359:646027afe74b | 1362:a6918dfb0cf5 |
---|---|
26 ``` | 26 ``` |
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 | |
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 | |
34 `benchmark/` contains a julia environment with the necessary packages for working with the benchmarks. | |
35 | |
36 To run the benchmarks, either use `make` run them manually from the REPL, as explained further below. | |
37 | |
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 | |
49 | |
50 ```julia | |
51 main() # Runs the suite for the current working directory | |
52 main(rev) # Runs the suite at the specified revision | |
53 main(target, baseline) # Compares two revisions | |
54 ``` | |
55 | |
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. | |
57 | |
58 PkgBenchmark can also be used directly. | |
59 | |
60 ```julia | |
61 using PkgBenchmark | |
62 import Sbplib | |
63 r = benchmarkpkg(Sbplib) | |
64 | |
65 export_markdown(stdout, r) | |
66 ``` | |
31 | 67 |
32 ## Generating and using the documentation | 68 ## Generating and using the documentation |
33 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. |
34 | 70 |
35 Using `make` there are three targets | 71 Using `make` there are four targets for documentation |
36 ```shell | 72 ```shell |
37 make docs | 73 make docs # generates files suitable for webserver deployment, i.e with `prettyurls=true` |
38 make localdocs | 74 make localdocs # generates files suitable for local viewing in a web browser, i.e `prettyurls=false` |
39 make opendocs | 75 make opendocs # build and view documentation locally |
40 make help | 76 make cleandocs # cleans up generated files |
41 ``` | |
42 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 | |
43 ```shell | |
44 make opendocs | |
45 ``` | 77 ``` |
46 | 78 |
47 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. |
48 | 80 |
49 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. |