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

Stuck with PARDISO Solver

darkfate
Beginner
1,171 Views
... Outdated ...
0 Kudos
2 Replies
darkfate
Beginner
1,171 Views
Can anyone please help me to find that problem.. i need the solver for my bachelor theisis but my c skills seem to be not good enough. thank you

I get a "ERRORduringsymbolicfactorization:-7" while solving that symmetric-Matrix.

10.0 0 0 0 0.0 1.0
0 10.0 0 0 1.0 1.0
0 0 10.0 0 2.0 1.0
0 0 0 10.0 3.0 1.0
0.0 1.0 2.0 3.0 0 0
1.0 1.0 1.0 1.0 0 0

First i thought it was the lower right block of zeros which makes problems, so i changed the matrix to:


10.0 0 0 0 0.0 1.0
0 10.0 0 0 1.0 1.0
0 0 10.0 0 2.0 1.0
0 0 0 10.0 3.0 1.0
0.0 1.0 2.0 3.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0 1.0

It still does not work for me. What i am doing wrong?

Here is my Code:
[cpp]#include 
#include 
#include 
#include 

extern int omp_get_max_threads();
extern int PARDISO(void*,int*,int*,int*,int*,int*, double*,int*,int*,int*,int*,int*, int*,double*,double*,int*);

int main(void)
{
	int n=6;
	int ia[6]={1,4,7,10,13,14};
	int ja[14]={1,5,6,2,5,6,3,5,6,4,5,6,5,6};
	double a[14]={10.0,0.0,1.0,10.0,1.0,1.0,10.0,2.0,1.0,10.0,3.0,1.0,1.0,1.0};
	int mtype=-2;
	double b[6] = { 1.0,-1.0,1.0,-1.0,0.0,0.0 };
	double x[6];
	int nrhs=1;	
	void* pt[36];
	int iparm[64];
	int maxfct,mnum,phase,error,msglvl;
	int	i;
	double	ddum;
	int idum;

	for(i=0;i<64;i++){ iparm=0; }
	iparm[0]=1; iparm[1]=2;
	iparm[2]=mkl_get_max_threads();
	iparm[3]=0; iparm[4]=0; iparm[5]=0; iparm[6]=16; iparm[7]=2;
	iparm[8]=0; iparm[9]=13; iparm[10]=1; iparm[11]=0; iparm[12]=0;
	iparm[13]=0; iparm[14]=0; iparm[15]=0; iparm[16]=0; iparm[17]=-1;
	iparm[18]=-1; iparm[19]=0;
	maxfct=1; mnum=1; msglvl=0; error=0;
	
	for(i=0;i<36;i++){pt=0;}
	
	phase=11;
	PARDISO(pt,&maxfct,&mnum,&mtype,&phase,&n,a,ia,ja,&idum,&nrhs,iparm,&msglvl,&ddum,&ddum,&error);
	if(error!=0){ printf("nERRORduringsymbolicfactorization:%d",error); exit(1);}
	.................[/cpp]
I copy & pasted the code from the mkl_manual.pdf page 3379 - 3381.
The only i did to the code are changes are:

int n=6;
int ia[6]={1,4,7,10,13,14};
int ja[14]={1,5,6,2,5,6,3,5,6,4,5,6,5,6};
double a[14]={10.0,0.0,1.0,10.0,1.0,1.0,10.0,2.0,1.0,10.0,3.0,1.0,1.0,1.0};
double b[6] = { 1.0,-1.0,1.0,-1.0,0.0,0.0 };
double x[6];
void* pt[36];
for(i=0;i<36;i++){pt=0;}
0 Kudos
Alexander_K_Intel2
1,171 Views
Quoting - darkfate
Can anyone please help me to find that problem.. i need the solver for my bachelor theisis but my c skills seem to be not good enough. thank you

I get a "ERRORduringsymbolicfactorization:-7" while solving that symmetric-Matrix.

10.0 0 0 0 0.0 1.0
0 10.0 0 0 1.0 1.0
0 0 10.0 0 2.0 1.0
0 0 0 10.0 3.0 1.0
0.0 1.0 2.0 3.0 0 0
1.0 1.0 1.0 1.0 0 0

First i thought it was the lower right block of zeros which makes problems, so i changed the matrix to:


10.0 0 0 0 0.0 1.0
0 10.0 0 0 1.0 1.0
0 0 10.0 0 2.0 1.0
0 0 0 10.0 3.0 1.0
0.0 1.0 2.0 3.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0 1.0

It still does not work for me. What i am doing wrong?

Here is my Code:
[cpp]#include 
#include 
#include 
#include 

extern int omp_get_max_threads();
extern int PARDISO(void*,int*,int*,int*,int*,int*, double*,int*,int*,int*,int*,int*, int*,double*,double*,int*);

int main(void)
{
	int n=6;
	int ia[6]={1,4,7,10,13,14};
	int ja[14]={1,5,6,2,5,6,3,5,6,4,5,6,5,6};
	double a[14]={10.0,0.0,1.0,10.0,1.0,1.0,10.0,2.0,1.0,10.0,3.0,1.0,1.0,1.0};
	int mtype=-2;
	double b[6] = { 1.0,-1.0,1.0,-1.0,0.0,0.0 };
	double x[6];
	int nrhs=1;	
	void* pt[36];
	int iparm[64];
	int maxfct,mnum,phase,error,msglvl;
	int	i;
	double	ddum;
	int idum;

	for(i=0;i<64;i++){ iparm=0; }
	iparm[0]=1; iparm[1]=2;
	iparm[2]=mkl_get_max_threads();
	iparm[3]=0; iparm[4]=0; iparm[5]=0; iparm[6]=16; iparm[7]=2;
	iparm[8]=0; iparm[9]=13; iparm[10]=1; iparm[11]=0; iparm[12]=0;
	iparm[13]=0; iparm[14]=0; iparm[15]=0; iparm[16]=0; iparm[17]=-1;
	iparm[18]=-1; iparm[19]=0;
	maxfct=1; mnum=1; msglvl=0; error=0;
	
	for(i=0;i<36;i++){pt=0;}
	
	phase=11;
	PARDISO(pt,&maxfct,&mnum,&mtype,&phase,&n,a,ia,ja,&idum,&nrhs,iparm,&msglvl,&ddum,&ddum,&error);
	if(error!=0){ printf("nERRORduringsymbolicfactorization:%d",error); exit(1);}
	.................[/cpp]
I copy & pasted the code from the mkl_manual.pdf page 3379 - 3381.
The only i did to the code are changes are:

int n=6;
int ia[6]={1,4,7,10,13,14};
int ja[14]={1,5,6,2,5,6,3,5,6,4,5,6,5,6};
double a[14]={10.0,0.0,1.0,10.0,1.0,1.0,10.0,2.0,1.0,10.0,3.0,1.0,1.0,1.0};
double b[6] = { 1.0,-1.0,1.0,-1.0,0.0,0.0 };
double x[6];
void* pt[36];
for(i=0;i<36;i++){pt=0;}

Hi!
It's seems to be problem in array ia cause it must be length of n+1, in your case ia[7]probably is equal {1,3,6,9,12,14,15}. Nevertheless you can use internal matrix checker in pardiso by changing iparm[26] from default number 0 on 1.
With best regards,
Alexander Kalinkin
0 Kudos
Reply