clean up of lattice library, added timers and more checks
Created by: dominikkiese
I cleaned up the documentation of the lattice library and added a check to guarantee that uc.basis[1]
is at the origin when loading the unitcell. Furthermore, I added the function get_lattice_timers
which allows to time the lattice building and reduction process. Since the lattice part of the code has not yet been optimized in any way this well help us testing optimizations and detecting possible performance degradations. For example on my computer I get
julia> get_lattice_timers()
────────────────────────────────────────────────────────────────────────────
Time Allocations
────────────────────── ───────────────────────
Tot / % measured: 36.0s / 100% 74.9GiB / 100%
Section ncalls time %tot avg alloc %tot avg
────────────────────────────────────────────────────────────────────────────
=> fcc 1 29.7s 82.6% 29.7s 61.5GiB 82.0% 61.5GiB
-> reduce 1 29.6s 82.2% 29.6s 61.3GiB 81.8% 61.3GiB
-> build 1 150ms 0.42% 150ms 150MiB 0.20% 150MiB
=> pyrochlore 1 3.77s 10.5% 3.77s 7.69GiB 10.3% 7.69GiB
-> reduce 1 3.72s 10.3% 3.72s 7.65GiB 10.2% 7.65GiB
-> build 1 52.7ms 0.15% 52.7ms 37.3MiB 0.05% 37.3MiB
=> cubic 1 1.98s 5.49% 1.98s 4.30GiB 5.74% 4.30GiB
-> reduce 1 1.97s 5.46% 1.97s 4.28GiB 5.71% 4.28GiB
-> build 1 11.4ms 0.03% 11.4ms 25.2MiB 0.03% 25.2MiB
=> diamond 1 458ms 1.27% 458ms 1.10GiB 1.46% 1.10GiB
-> reduce 1 367ms 1.02% 367ms 1.09GiB 1.45% 1.09GiB
-> build 1 91.0ms 0.25% 91.0ms 10.1MiB 0.01% 10.1MiB
=> hyperhoneycomb 1 34.8ms 0.10% 34.8ms 242MiB 0.32% 242MiB
-> reduce 1 33.1ms 0.09% 33.1ms 238MiB 0.31% 238MiB
-> build 1 1.70ms 0.00% 1.70ms 3.52MiB 0.00% 3.52MiB
=> kagome 1 13.6ms 0.04% 13.6ms 72.1MiB 0.09% 72.1MiB
-> reduce 1 12.8ms 0.04% 12.8ms 70.4MiB 0.09% 70.4MiB
-> build 1 807μs 0.00% 807μs 1.65MiB 0.00% 1.65MiB
=> square 1 13.2ms 0.04% 13.2ms 50.4MiB 0.07% 50.4MiB
-> reduce 1 12.5ms 0.03% 12.5ms 49.1MiB 0.06% 49.1MiB
-> build 1 635μs 0.00% 635μs 1.32MiB 0.00% 1.32MiB
=> honeycomb 1 4.41ms 0.01% 4.41ms 22.5MiB 0.03% 22.5MiB
-> reduce 1 4.04ms 0.01% 4.04ms 21.7MiB 0.03% 21.7MiB
-> build 1 368μs 0.00% 368μs 775KiB 0.00% 775KiB
────────────────────────────────────────────────────────────────────────────