Repository navigation
Conversation
|
@sbillinge PR ready for review. CI failed due to codecov not enabled. |
|
this is great. Here is a Fable review: I read all the source changes in PR #76 and found no correctness bugs, but I could not build it or run the tests. Things to raise with the author
Minor
What I checked and found sound
|
|
Is this ready to merge? Can anyone see any issues? @cadenmyers13 please can we build an env with this version of libdiffpy and srreal and run all the examples? |
|
@sbillinge @SYMSCAE Wow this is amazing!!! Ran this on the diffpy.cmi examples and everything looked good. The examples used to take ~20-25 min to run. This only took ~6 min |
|
@sbillinge Investigating on msvc builds which the linker oddly expose vectorized stl functions out of scope. Should be ready within an hour or so. |
Summary
Speeds up
PDFCalculator,DebyePDFCalculatorand bond generation for periodic and crystal structures. Most of the gain comes from SIMD calculation kernels, batched bond generation, and dropping uBLAS in favor of fixed-size vector and matrix types.Changes per commit
1. Fixed-size linear algebra and hashing
R3::VectorandR3::Matrixare nowstd::arraytypes.diffpy/hash.hppwhich uses the same mixing scheme as Boost.R3::inverse,R3::floor,R3::mxvecproductand theLatticecoordinate and matrix methods now return by value instead of a reference to a shared static. This makes them thread-safe for future multithreaded use.2. SIMD kernels for the Gaussian and Debye loops
xsimdand selects the best kernel the CPU supports on the fly with manual override option available.-fno-fast-math -ffp-contract=off) so they give consistent results. The SIMD files are built with-fno-ltoso their ISA-specific inline functions can't leak into the rest of the library.PeakProfile::addRDFPeak. New protected hookGaussianProfile::kernelShapelets derived profiles use the kernels.3. Batched periodic bond generation
PeriodicStructureBondGeneratorstores the unit cell positions and lattice vectors as separate cartesian arrays and finds candidate bonds in chunks.CrystalStructureAdapterreuses symmetry-expanded positions and expands again only when atoms, the lattice or the symmetry operations change.4. Build: LTO and
-fno-semantic-interposition-fno-semantic-interpositionwhen the compiler supports it.5. Faster FFT
fftgtofandfftftogcompute the sine transform with a half-length complex FFT instead of a 4N-point odd extension. GSL wavetables are cached per thread for each power-of-two length.Benchmarks