In spring 2021 I joined forces with three classmates, and as part of the ETH lecture “Advanced Systems Lab” we revisited the FLIP Fluids Solver project from two years prior. The goal this time was to optimise the code using the skills acquired in this lecture and improve the time required to run a simulation.
Overall we were quite successful, and the final solver is about 8x times faster than the original, allowing us to either run larger simulations, or the same ones in much less time. The main techniques involved in the optimisation were streamlined data structures, optimisations allowing for better ILP and automatic vectorisation, use of SSE/AVX instructions for manual vectorisation, and much more. If you want to find out all the gory details and analysis, here is the report in PDF format.
You can find the full open-source code on GitHub!