Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

PARDISO Error: -2

Gungor__Arif
Beginner
2,505 Views

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 = 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 = 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);
	

 

0 Kudos
1 Solution
Jonghak_K_Intel
Employee
2,505 Views

Hi Arif, 

thanks for the information. 

Please calculate a rough estimation for the total double precision memory consumption in Kbytes for
factorization and solver steps. It can be computed after the reordering and
symbolic factorization step according to the formula: Mem Required = max(iparm(15),iparm(16) + iparm(18)*8/1024). See if the size can be stored in your available memory safely.

Also, you can try to use out-of-core version ( set ipram(59) == 2). out-of-core (OOC) Intel MKL PARDISO can solve very large problems by holding the matrix factors in files on the disk, which requires a reduced amount of main memory compared to IC.

View solution in original post

0 Kudos
4 Replies
Jonghak_K_Intel
Employee
2,505 Views

Hi Arif, 

 

may I know the sizes of the matrix and your available memory? 

and what is the version of MKL you are using ? 

0 Kudos
Gungor__Arif
Beginner
2,505 Views

Hi Jon, 

Thanks for the reply.

The issue I described happened with a sparse matrix of (15000x15000) on a 16 GB RAM laptop (more than 13 GB available during code run). However I intend to use the solver later on with a (1Mx1M) matrix on a 64 or 128 GB RAM computer.

It's MKL 2018 Update 1 Package.

0 Kudos
Jonghak_K_Intel
Employee
2,506 Views

Hi Arif, 

thanks for the information. 

Please calculate a rough estimation for the total double precision memory consumption in Kbytes for
factorization and solver steps. It can be computed after the reordering and
symbolic factorization step according to the formula: Mem Required = max(iparm(15),iparm(16) + iparm(18)*8/1024). See if the size can be stored in your available memory safely.

Also, you can try to use out-of-core version ( set ipram(59) == 2). out-of-core (OOC) Intel MKL PARDISO can solve very large problems by holding the matrix factors in files on the disk, which requires a reduced amount of main memory compared to IC.

0 Kudos
Gungor__Arif
Beginner
2,505 Views

Thank you for the information. 

I actually had more than sufficient memory when I got that error, still a bit confusing. However, switching to pardiso_64 worked well. Then for a larger system as you suggested I ended up moving to  OOC PARDISO.

0 Kudos
Reply