reflectivity / analysis

Data analysis for Neutron and X-ray Reflectometry
https://www.reflectometry.org/
Creative Commons Zero v1.0 Universal
0 stars 4 forks source link

Document efficient ways to parallelise reflectometry fitting programs #44

Open bmaranville opened 4 years ago

bmaranville commented 3 years ago

Comments from the workshop: Do you parallelize this over the model, or over the NR?

andyfaff commented 3 years ago

https://github.com/reflectivity/analysis/wiki/Efficient-calculation-in-a-(unpolarised)-reflectivity-analysis https://github.com/reflectivity/analysis/wiki/Parallelisation-in-reflectivity-analysis-software

aljosahafner commented 3 years ago

If a program is written in Python and has a well-written (compliant) kernel, then numba package is a very good way of compiling Python code with LLVM and then also parallelising.

andyfaff commented 3 years ago

The reflectivity calculation can be vectorised quite easily, so I'm not sure how much improvement you'd see when using numba over numpy (if one takes care to avoid temp arrays). I've messed around a little bit with numba and could never get it to outperform numpy.

aljosahafner commented 3 years ago

Sure, you're right! When I was working on off-specular calculation I had to use the proposed solution.