Hi all,
I have recently started using MKL. I'm trying to solve Ax=b sort of equation with sparse A matrix using PARDISO. It is actually time domain finite element problem and I need to call the solver in a for loop. So I solve Ax=b at each time step while using values of the previous step to update A matrix.
For smaller systems my code is running fine; however for bigger ones, depending on matrix size, after some time in the loop I get the error: -2 during numerical factorization. I don't think NNZ changes a lot.
I'm using Visual Studio on Windows and when I get the error at least half of the RAM seems to be available and empty. So I'm not sure why I get this error at all.
This a part from the message it prompts:
=== PARDISO is running in In-Core mode, because iparam(60)=0 ===
*** Error in PARDISO ( insufficient_memory) error_num= 8
*** Error in PARDISO memory allocation: FACTORIZE_SOLVING_LU_DATA, allocation of 6861 bytes failed
total memory wanted here: 32291 kbyte
I'm open to try any suggestions.
Below is the part where I call PARDISO.
MKL_INT mtype = 11; /* Real unsymmetric matrix */
MKL_INT nrhs = 1; /* Number of right hand sides. */
void *pt[64];
char *uplo;
for (i = 0; i < 64; i++)
{
iparm[i] = 0;
}
iparm[0] = 0; /* No solver default */
iparm[1] = 2; /* Fill-in reordering from METIS */
iparm[2] = 2;
iparm[3] = 0; /* No iterative-direct algorithm */
iparm[4] = 0; /* No user fill-in reducing permutation */
iparm[5] = 0; /* Write solution into x */
iparm[6] = 0; /* Not in use */
iparm[7] = 2; /* Max numbers of iterative refinement steps */
iparm[8] = 0; /* Not in use */
iparm[9] = 13; /* Perturb the pivot elements with 1E-13 */
iparm[10] = 1; /* Use nonsymmetric permutation and scaling MPS */
iparm[11] = 0; /* Conjugate transposed/transpose solve */
iparm[12] = 1; /* Maximum weighted matching algorithm is switched-on (default for non-symmetric) */
iparm[13] = 0; /* Output: Number of perturbed pivots */
iparm[14] = 0; /* Not in use */
iparm[15] = 0; /* Not in use */
iparm[16] = 0; /* Not in use */
iparm[17] = -1; /* Output: Number of nonzeros in the factor LU */
iparm[18] = -1; /* Output: Mflops for LU factorization */
iparm[19] = 0; /* Output: Numbers of CG Iterations */
maxfct = 1; /* Maximum number of numerical factorizations. */
mnum = 1; /* Which factorization to use. */
msglvl = 1; /* Print statistical information in file */
error = 0; /* Initialize error flag */
for (i = 0; i < 64; i++)
{
pt[i] = 0;
}
phase = 11;
PARDISO(pt, &maxfct, &mnum, &mtype, &phase,
&aRowN, vallsA, rowwsA, collsA, &idum, &nrhs, iparm, &msglvl, &ddum, &ddum, &error);
cout << iparm[16] << endl;
if (error != 0)
{
printf("\nERROR during symbolic factorization: %d", error);
cin.get();
exit(1);
}
phase = 22;
PARDISO(pt, &maxfct, &mnum, &mtype, &phase,
&aRowN, vallsA, rowwsA, collsA, &idum, &nrhs, iparm, &msglvl, &ddum, &ddum, &error);
if (error != 0)
{
printf("\nERROR during numerical factorization: %d", error);
cout << "Press any key to exit."<< endl;
cin.get();
exit(2);
}
phase = 33;
if (iparm[11] == 0)
uplo = "non-transposed";
PARDISO(pt, &maxfct, &mnum, &mtype, &phase,
&aRowN, vallsA, rowwsA, collsA, &idum, &nrhs, iparm, &msglvl, matBB, solVals, &error);
if (error != 0)
{
printf("\nERROR during solution: %d", error);
cin.get();
exit(3);
}
phase = -1; /* Release internal memory. */
PARDISO(pt, &maxfct, &mnum, &mtype, &phase,
&aRowN, &ddum, rowwsA, collsA, &idum, &nrhs,
iparm, &msglvl, &ddum, &ddum, &error);