Dear MKL developers,
I use Intel MKL's Pardiso solver on a medical image processing project based on FEM (Finite Element Method). My problem is to solve a linear equation 'Ax=b' where 'A' is a real symmetric sparse matrix, and 'b' is a vector. The dimension of A is about 700K in my problem. And I am only interested in certain elements in 'x' which indices are known in advance.
MKL's example program 'pardiso_sym_reduced_solve_c.
PardisoError: The Pardiso solver failed with error code -2. See Pardiso documentation for details.
Question: Is there an efficient, less memory-consuming way in Pardiso to solve AX=b on only half of the elements in 'x'? In general, how does the consumed memory (in solving Ax=b) scale up with the number of selected elements in x with the 'perm' option enabled?
As you are solving a system of equations with a direct method, unless it has a special structure, you have to compute all the factors I think.
So, the partial solve feature is targeting reduced memory consumption on the solving phase (and allows exploiting the potentially known sparsity structure of the righthand sides), but not on the factorization and reordering steps.
Hence I assume you actually don't have enough memory for the factorization. But we better check that. For this, please separate the calls to the phases (instead of a single call with phase = 13 do three calls with phase = 11, 22 and 33) and check error-info after each call.
If you get -2 after the call with phase = 22, then I suspect not much can be done. You can potentially use Out-Of-Core mode (iparm=2 or 1) but it will use disc storage and be slower. Or, if the structure is particularly good, try to solve the Schur complement system for the subset of unknowns which you want to find. But in this case a lot of sparsity is likely to get lost.
But if you are getting this error status after factorization completes successfully, at the solving phase (phase = 33), then we can talk more details.
Thank you for your swift response.
You are right. I am indeed interested in the time performance on the solving phase 33, not on the reordering phase 11 or factorization phase 22. Thus, I use 'perm' to select elements to save computation for the last step, phase 33.
However, the problem is that I always get the error -2 after phase 11. I tried to set iparm=2 and 1 as you mentioned, but still get error -2 with phase 11. As mentioned earlier, the left side stiffness matrix A is a real symmetric sparse matrix of 700K x 700K; the number of selected elements in 'x' is about 350K. Any ideas on why it is in the phase 11 that memory runs out ?
It would be relatively easy to find the reason if you share your data with us (a small reproducer with PARDISO settings and your matrix data + its reader). In general, it is not easy (at least for me) to estimate memory for the reordering step.
A correction to my previous reply: you should have iparm = 0 to be able to use the partial solve feature as the docs say. So, please use the in-core mode.
Also, VBSR feature (see iparm) helps to reduce the memory consumption for the reordering phase. But it has restrictions on when it works and the exact benefit depends on the sparsity pattern.
I have uploaded the data and a small reproducer with PARDISO settings to GitHub:
Please let me know if you have questions. Thank you very much.