Open simulkade opened 1 month ago
It will be great to have a notebook of 'recipes' for getting external sparse solvers to work with PyFVTool.
For our present calculations (2D cylindrical, 375000 cells), Pypardiso works well (Win11, miniconda, specific PyFVTool environment) and decreases total calculation time by a factor up to 10x (laptops, Intel i7, 32 Gb RAM). I think we are lucky.
Concerning MATLAB: you get what you pay for! I guess that MATLAB has been partnering for long with developers of sparse solvers to get these to work in a hassle-free manner and optimize the performance. This is probably true for other commercial software. Sparse array support in scientific Python still needs further work.
Some ideas:
requirements.txt
), so that these may be reproduced. I am quite happy with Anaconda/miniconda/Conda-Forge and environments.pysparse
on Linux (not Windows). It was really good, fast and easy-to-use, but not available in Python 3. I remember that our calculations became much slower, even with PETSc, in Python 3.ssh
and tmux
tools).I have the impression that the biggest chance of getting this kind of thing working easily, is to use a dedicated Linux installation, perhaps on a separate workstation.
I will give it a shot later, when my son does not play don't starve together
on our Linux machine.
UMFPACK via scikit-umfpack seems the way to go. Encouraging news concerning https://github.com/scikit-umfpack/scikit-umfpack/issues/85.
Totally agree. I wish it was installed by default in scipy
. It seems that the problem is a license incompatibility.
For now, Linux seems indeed to be the easiest OS for working with UMFPACK: https://github.com/scikit-umfpack/scikit-umfpack/issues/85#issuecomment-2291483189
In a discussion with my friend @skieninger about the speed of sparse linear solvers of Matlab versus Python for solving a large system of equation (around 1e6) , we compared the backslash solver of Matlab with scipy's SuperLU, we observed a huge difference (with Matlab much faster), which is due to the fact that
suitesparse
and its poly algorithm (umfpack
) is not installed by default in scipy. A package is available here but is a pain to install on Windows and even on WSL (or I had difficulties getting it to work easily with all the recent changes innumpy
and scipy). When it works though, it makes a huge difference. For me,Pypardiso
also did not work either with system and memory errors. I also noticed that switching between the different existingscipy
solvers can also make a significant difference.The problem is very well documented here.
To address this problem, I suggest the following list of tasks/objectives:
Here's the script I am using to test the solvers: