diff --git a/pardiso_schur.cpp b/pardiso_schur.cpp index 63953b1..131fda9 100644 --- a/pardiso_schur.cpp +++ b/pardiso_schur.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "mkl.h" @@ -95,7 +96,9 @@ int main (void) 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[36-1] = 1; /* Use Schur complement */ + iparm[36-1] = -2; /* Use Schur complement */ + iparm[24-1] = 1; + iparm[36] = -1; maxfct = 1; /* Maximum number of numerical factorizations. */ mnum = 1; /* Which factorization to use. */ @@ -125,10 +128,20 @@ int main (void) /* -------------------------------------------------------------------- */ /* .. Numerical factorization. */ /* -------------------------------------------------------------------- */ + MKL_INT schur_nnz = iparm[35]; + printf ("\nschur_nnz is %d \n", schur_nnz); + MKL_INT* schur_rows = (MKL_INT*)mkl_malloc(n_schur+1, sizeof(MKL_INT)); + MKL_INT* schur_columns = (MKL_INT*)mkl_malloc(schur_nnz, sizeof(MKL_INT)); + double* schur_values = (double *)mkl_malloc(schur_nnz, sizeof(double)); + int step = 1; + pardiso_export (pt, schur_values, schur_rows, schur_columns, &step, iparm, &error); + + phase = 22; + iparm[36-1] = -2; pardiso(pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, perm, &nrhs, - iparm, &msglvl, &ddum, &schur, &error); + iparm, &msglvl, &ddum, &ddum, &error); if ( error != 0 ) { printf ("\nERROR during numerical factorization: " IFORMAT, error); @@ -140,7 +153,7 @@ int main (void) { for(j=0; j