Hello,
we are currently trying to integrate mkl_pardiso into our software and are facing some questions regarding mkl_pardiso and the computation of the Schur-complement.
Given a real symmetric matrix we wanted to compute the Schur-complement of a certain size and afterwards use the partial factorization from that computation to solve a part of the original linear equation system. We are using sparse matrices and thus also iparm[35] = -2/-1.
First of all we started out by modifying the supplied pardiso_schur_c.c example and used the pseudocode found here as an orientation. You can find the used code as an attachment. The compile command can be found as a comment in the upper part of the c-File.
First thing was, that when setting
int iparm35 = -1; iparm[1-1] = 1; /* No solver default */ iparm[2-1] = 2; /* Fill-in reordering from METIS */ iparm[5-1] = 0; iparm[10-1] = 8; /* Perturb the pivot elements with 1E-13 */ iparm[11-1] = 0; /* Use nonsymmetric permutation and scaling MPS */ iparm[13-1] = 0; /* Maximum weighted matching algorithm is switched-off (default for symmetric). Try iparm[12] = 1 in case of inappropriate accuracy */ iparm[14-1] = 0; /* Output: Number of perturbed pivots */ iparm[18-1] = -1; /* Output: Number of nonzeros in the factor LU */ iparm[19-1] = -1; /* Output: Mflops for LU factorization */ iparm[24 - 1] = 10; iparm[31 - 1] = 0; iparm[36 - 1] = iparm35; /* Use Schur complement */
we ran into a segmentation fault thrown by the pardiso_export function. We do not know why this happens, but setting iparm[23] = 1 instead of 10 resolved the issue. The documentation on iparm[23] simply says that it cannot be 0 when setting iparm[35] to either -1 or -2. Did we do something wrong here?
Another thing we found is that when setting iparm[35] = -2 in the above settings (so with iparm[23] = 10) we don't get the number of non-zeros as output in iparm[35] but instead -2 again (even though error == 0).
After 'resolving' the above issue by setting iparm[23] = 1 we were able to compute the Schur-complement and get it returned in sparse format (that was all correct, even though it was quite surprising to us, that pardiso, despite getting all matrices supplied in 1-based indexing, returned the Schur-complement with zero based indexing - is there a parameter to control this ?).
Still we were not quite sure on how to use the parameter perm. If we set perm to something like
perm = {1, 0, 0, 0, 1}
what exactly does "perm specifies elements for a Schur complement" in the documentation mean? Will pardiso perform a Schur-complement computation equivalent to one where we specify perm as
perm = {0, 0, 0, 1, 1}
but swap row 1 and 4? If yes, will pardiso always "stable" sort the rows?
A last question we have that is somewhat more general:
Given a linear system
[A11 A12] [x1] [b1]
[A21 A22] [x2] = [b2]
we want to do two things:
a) compute the Schur-complement S = A22 - A21 A11^-1 A12
b) solve the linear system A11 x1 = b1
We assumed that, similar to pardiso from the pardiso-project, we could do that by computing the Schur-complement with iparm[35] = -2 (so that the factorization is kept for solving phase) and afterwards use that partial factorization in pardiso and phase=33 to compute x1.
From our tests we found that pardiso instead solves the complete system for x1 and x2. Is that the expected behaviour?
If so, is there a way to efficiently only solve A11 x1 = b1?
With best regards,
Nils