Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Chiho_Y_
Beginner
160 Views

FEAST algorithm : feastinit input parameter setting problem

Jump to solution

Hi,

I have a problem with setting the input parameters at MKL FEAST algorithm library.

(I currently use MKL 11.3 version and Intel parallel studio xe 2016 for c++ at Linux)

I was trying to use the dfeast_syev function, so I set the extended eigensolver input parameters by using the array fpm, as written in the reference manual.

When I modify the fpm values to change the options for dfeast_syev function, I get errors for setting illegal number in fpm.

But since the function dfeast_syev runs well and gives the right eigenvalues and vectors for the default option, the array fpm initialized with feastinit(fpm);, I checked the default fpm values initialized with feastinit. The initialized values are the followings :

fpm[0] = 0, fpm[1] = 12, fpm[2] = 0, fpm[3] = 5, fpm[4] = 0, fpm[5] =1, fpm[6] = 0, ... (rest fpm values are all zeros.),

which is different from the default value written in the reference manual. 

Please help me if you know what is wrong with me.

Thanks.

 

Sincerely,

Chiho Yoon

Here's my code. 

----------

#include "mkl.h"
#include "mkl_solvers_ee.h"

void FEAST_eigen(int iN, double *A, double Emin, double Emax, double *E, double *X)
{
    /* Matrix A in dense format, size N by N*/
	/* Lower/upper bound of search interval [Emin,Emax] */
   
	char          UPLO = 'F'; /* Type of matrix: (F=full matrix, L/U - lower/upper triangular part of the matrix) */
    const MKL_INT N = (MKL_INT) iN;

    /* Declaration of FEAST variables */
    MKL_INT      fpm[128];      /* Array to pass parameters to Intel MKL Extended Eigensolvers */

    double       epsout;        /* Relative error on the trace */
    MKL_INT      loop;          /* Number of refinement loop */

    MKL_INT      M0 = N;            /* Initial guess for subspace dimension to be used */
    MKL_INT      M;             /* Total number of eigenvalues found in the interval */

    double       *res = (double *)  malloc (sizeof(double) * iN);       /* Residual */

    /* Declaration of local variables */
    MKL_INT      info;          /* Errors */
    double       *R = (double *) malloc (sizeof(double) * iN);         /* R = |E-Eig| */
    double       **Y = (double **)  malloc (sizeof(double*) * iN);     /* Y=(X')*X-I */

    MKL_INT      i, j;

    for (i=0; i<N*N; i++)
        X = 0.0;

	for (i = 0; i < N; i++)
		Y = (double *)  malloc (sizeof(double) * iN);
    
    /* Step 1. Call  FEASTINIT to define the default values for the input FEAST parameters */

	printf("ho!\n");	
	feastinit(fpm);

//	fpm[0] = 1;
//	fpm[1] = 8;
//	fpm[2] = 15;
//	fpm[3] = 100;

///////////////////////////////////////////////////////////////////
//--------------> This code runs well, but once I set the numbers (fpm[0]~fpm[4]), I get these messages :
//Intel MKL Extended Eigensolvers: double precision driver
//Intel MKL Extended Eigensolvers: List of input parameters fpm(1:64)-- if different from default
//Intel MKL Extended Eigensolvers: fpm(1)=1
//Intel MKL Extended Eigensolvers: fpm(2)=0
//Intel MKL Extended Eigensolvers: fpm(3)=8
//Intel MKL Extended Eigensolvers: fpm(4)=0
//Intel MKL Extended Eigensolvers: fpm(5)=15
//Intel MKL Extended Eigensolvers: fpm(7)=100
//Search interval [-1.000000000000000e+01;1.000000000000000e+01]
//Intel MKL Extended Eigensolvers ERROR: Problem with array parameters
//==>INFO code =: 102
//Routine dfeast_syev returns code of ERROR: 102
////////////////////////////////////////////////////////////////////

	for (i = 0; i < 64 ; i++)
	{
		printf("%i\n",fpm);
	}

    /* Step 2. Solve the standard Ax = ex eigenvalue problem. */

	dfeast_syev(
        &UPLO,   /* IN: UPLO = 'F', stores the full matrix */
        &N,      /* IN: Size of the problem */
        A,       /* IN: dense matrix A */
        &N,      /* IN: The first dimension of the matrix A */
        fpm,     /* IN/OUT: Array is used to pass parameters to Intel MKL Extended Eigensolvers */
        &epsout, /* OUT: Relative error of on the trace */
        &loop,   /* OUT: Contains the number of refinement loop executed */
        &Emin,   /* IN: Lower bound of search interval */
        &Emax,   /* IN: Upper bound of search interval */
        &M0,     /* IN: The initial guess for subspace dimension to be used. */
        E,       /* OUT: The first M entries of Eigenvalues */
        X,       /* IN/OUT: The first M entries of Eigenvectors */
        &M,      /* OUT: The total number of eigenvalues found in the interval */
        res,     /* OUT: The first M components contain the relative residual vector */
        &info    /* OUT: Error code */
        );

    if ( (int)info != 0 )
    {
        printf("Routine dfeast_syev returns code of ERROR: %i\n", (int)info);
        return;
    }

}

 

0 Kudos
1 Solution
Ying_H_Intel
Employee
160 Views

Hi Chiho, 

In your discription, it seems several issues. 

1) MKL_INT fpm[128] is not zero by default (in different compiler, there is different rule). so you'd better to init it explicitly or call feastinit() function.  You can't think they are 0 automaically.

2) 102 error,  so your fpm[1]=0 error. 

Intel MKL Extended Eigensolvers ERROR: Problem with array parameters
58 ==>INFO code =: 102

 

fpm[0] 0 Specifies whether Extended Eigensolver routines print runtime status.
fpm[0]=0 Extended Eigensolver routines do not generate runtime
messages at all.
fpm[0]=1 Extended Eigensolver routines print runtime status to the
screen.
fpm[1] 8 The number of contour points N
e
= 8 (see the description of FEAST algorithm).
Must be one of {3,4,5,6,8,10,12,16,20,24,32,40,48}.
fpm[2] 12 Error trace double precision stopping criteria ε(ε= 10
-fpm[2]
) .
fpm[3] 20 Maximum number of Extended Eigensolver refinement loops allowed. If no
convergence is reached within fpm[3]refinement loops, Extended Eigensolver
routines return info=2.

3)  does it run well if you initialize the array as below  feastinit + fpm change. 

 MKL_INT      fpm[128];

    printf("ho!\n");   
39     feastinit(fpm);
40  
41  fpm[0] = 1;
42  fpm[1] = 8;
43  fpm[2] = 15;
44  fpm[3] = 100;

 

It should be right usage model,  I can run it without problem.  

The default value is as expected 0, 8, 12, 20 both 32bit or x64bit under windows. 

Best Regards,

Ying 

P.s I add prinpf clause and above,  in MKL example code dexample_dense_c.c and get the below result

    /* Step 1. Call  FEASTINIT to define the default values for the input FEAST parameters */
   

feastinit(
        fpm /* OUT: Array is used to pass parameters to Intel MKL Extended Eigensolvers */
        );

fpm[0] = 1;

fpm[1] = 8;

fpm[2] = 15;

fpm[3] = 100;


        for (i = 0; i < 64 ; i++)
    {
        printf("%i\n",fpm);
    }


     FEAST DFEAST_SYEV AND DFEAST_SYGV EXAMPLE
 Dense matrix size 11
Search interval [ 3.000000000000000e+000, 7.000000000000000e+000  ]
1
8
15
100
0
0
5
0
0
0
1
0
0
0
0
0
0
0
0

default value:


     FEAST DFEAST_SYEV AND DFEAST_SYGV EXAMPLE
 Dense matrix size 11
Search interval [ 3.000000000000000e+000, 7.000000000000000e+000  ]
Intel(R) Math Kernel Library Version 11.3.0 Product Build 20150730 for 32-bit ap
plications

0
8
12
20
0
0
5
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
 Testing dfeast_syev routine:
Intel MKL Extended Eigensolvers: double precision driver
Intel MKL Extended Eigensolvers: List of input parameters fpm(1:64)-- if differe
nt from default
Intel MKL Extended Eigensolvers: fpm(1)=1
Search interval [3.000000000000000e+000;7.000000000000000e+000]
Intel MKL Extended Eigensolvers: Size subspace 8
#Loop | #Eig  |    Trace     | Error-Trace |  Max-Residual
0,6,2.570747125938343e+001,1.000000000000000e+000,6.483072202261447e-006
1,6,2.570747126011607e+001,1.046624374469372e-010,3.382354100969164e-011
2,6,2.570747126011605e+001,2.537652627714644e-015,5.720011309032667e-016
Intel MKL Extended Eigensolvers have successfully converged (to desired toleranc
e).
FEAST OUTPUT INFO 0
Press any key to continue . . .

View solution in original post

2 Replies
Ying_H_Intel
Employee
161 Views

Hi Chiho, 

In your discription, it seems several issues. 

1) MKL_INT fpm[128] is not zero by default (in different compiler, there is different rule). so you'd better to init it explicitly or call feastinit() function.  You can't think they are 0 automaically.

2) 102 error,  so your fpm[1]=0 error. 

Intel MKL Extended Eigensolvers ERROR: Problem with array parameters
58 ==>INFO code =: 102

 

fpm[0] 0 Specifies whether Extended Eigensolver routines print runtime status.
fpm[0]=0 Extended Eigensolver routines do not generate runtime
messages at all.
fpm[0]=1 Extended Eigensolver routines print runtime status to the
screen.
fpm[1] 8 The number of contour points N
e
= 8 (see the description of FEAST algorithm).
Must be one of {3,4,5,6,8,10,12,16,20,24,32,40,48}.
fpm[2] 12 Error trace double precision stopping criteria ε(ε= 10
-fpm[2]
) .
fpm[3] 20 Maximum number of Extended Eigensolver refinement loops allowed. If no
convergence is reached within fpm[3]refinement loops, Extended Eigensolver
routines return info=2.

3)  does it run well if you initialize the array as below  feastinit + fpm change. 

 MKL_INT      fpm[128];

    printf("ho!\n");   
39     feastinit(fpm);
40  
41  fpm[0] = 1;
42  fpm[1] = 8;
43  fpm[2] = 15;
44  fpm[3] = 100;

 

It should be right usage model,  I can run it without problem.  

The default value is as expected 0, 8, 12, 20 both 32bit or x64bit under windows. 

Best Regards,

Ying 

P.s I add prinpf clause and above,  in MKL example code dexample_dense_c.c and get the below result

    /* Step 1. Call  FEASTINIT to define the default values for the input FEAST parameters */
   

feastinit(
        fpm /* OUT: Array is used to pass parameters to Intel MKL Extended Eigensolvers */
        );

fpm[0] = 1;

fpm[1] = 8;

fpm[2] = 15;

fpm[3] = 100;


        for (i = 0; i < 64 ; i++)
    {
        printf("%i\n",fpm);
    }


     FEAST DFEAST_SYEV AND DFEAST_SYGV EXAMPLE
 Dense matrix size 11
Search interval [ 3.000000000000000e+000, 7.000000000000000e+000  ]
1
8
15
100
0
0
5
0
0
0
1
0
0
0
0
0
0
0
0

default value:


     FEAST DFEAST_SYEV AND DFEAST_SYGV EXAMPLE
 Dense matrix size 11
Search interval [ 3.000000000000000e+000, 7.000000000000000e+000  ]
Intel(R) Math Kernel Library Version 11.3.0 Product Build 20150730 for 32-bit ap
plications

0
8
12
20
0
0
5
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
 Testing dfeast_syev routine:
Intel MKL Extended Eigensolvers: double precision driver
Intel MKL Extended Eigensolvers: List of input parameters fpm(1:64)-- if differe
nt from default
Intel MKL Extended Eigensolvers: fpm(1)=1
Search interval [3.000000000000000e+000;7.000000000000000e+000]
Intel MKL Extended Eigensolvers: Size subspace 8
#Loop | #Eig  |    Trace     | Error-Trace |  Max-Residual
0,6,2.570747125938343e+001,1.000000000000000e+000,6.483072202261447e-006
1,6,2.570747126011607e+001,1.046624374469372e-010,3.382354100969164e-011
2,6,2.570747126011605e+001,2.537652627714644e-015,5.720011309032667e-016
Intel MKL Extended Eigensolvers have successfully converged (to desired toleranc
e).
FEAST OUTPUT INFO 0
Press any key to continue . . .

View solution in original post

Chiho_Y_
Beginner
160 Views

Dear Ying H,

Thank you very much for your help.

Actually, I found out that the problem was due to wrong compiler option settings.

However your answer helped me to understand how to set the options for the FEAST functions.

Thanks again, and have a nice day.

 

Sincerely,

Chiho Yoon

Reply