Hi,
We are trying to use the MKL FEAST 11.0.3.1 solver for symmetric sparse CSR matrices of doubles. The call we are using is something like:
--------------------------------------------
#include "mkl.h"
......
//declaring & preparing data...
....
feastinit(&feastparam[0]); dfeast_scsrev(&UPLO,&N,sa,ia,ja,feastparam,&epsout,&loop,&Emin,&Emax,&M0,E,X,&M,res,&info);
--------------------------------------------
We have no warnings at compiling time, but at runtime the feast call throws an exception like this:
First exception in 0x000007fee1b8249c in feast.exe: 0xC0000005: Invalid read in 0xffffffffffffffff.
Which could be our mistake? Input data? Bad linkage/compiler version-mkl version combination? We are not getting any compiling warnings.
Intel Composer XE 2011 Update 7 (package 258)
Thanks in advance!
Aurora
Link Copied
It's hard to see what's wrong in the a few lines of code you've shown. Please provide your entire test code. What is your OS? How do you compile/link the code?
Please first check the FEAST example in MKL: $MKLROOT/examples/solvers_eec/source/dexample_sparse_c.c. Does it work for you?
Hi again,
The example that you told us worked fine. We are essentially doing the same. However we are still having problems on runtime.
We are working in Windows 7 x64.
//!!!!!!!!!!!!!!! Matrix declaration variables !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
char UPLO='F';
const MKL_INT N = matrix_size;
double * val = new double[size];
int * rows = new int [size_rows + 1];
int * cols = new int [size];
for(int i=0;i<size;i++){ val=matrix_CSR.pr; }
for(int i=0;i<(size_rows+1);i++){ rows=matrix_CSR.jc; }
for(int i=0;i<size;i++){ cols=matrix_CSR.ir; }
//!!!!!!!!!!!!!!! Declaration of FEAST variables !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//!!!!!!!!!!!!!!! E - eigenvalues, X - eigenvectors, res - residual !!!!!!!!!!!!!
MKL_INT fpm[128];
double Emin, Emax;
double epsout;
MKL_INT loop;
MKL_INT L = 20;
MKL_INT M0,M, info;
double * E = new double
for(int i=0;i<N;i++){ E=0; }
double * X = new double [N*N];
for(int i=0;i<N*N;i++){ X=0; }
double * res = new double
for(int i=0;i<N;i++){ res=0; }
//!!!!!!!!!!!!!! search interval [Emin,Emax] including M eigenpairs !!!!!!!!!!!!
Emin=(double)-0.5;
Emax=(double)0.01;
M0=L;
M=M0;
printf(" Search interval [ %.15e, %.15e ] \n", Emin, Emax);
epsout=(double)0.0;
loop=0;
info=0;
// Task 1. Call FEASTINIT to define the default values for the input
// FEAST parameters.
feastinit(fpm);
fpm[0]=1;
// Task 2. Solve the standard Ax=ex eigenvalue problem.
dfeast_scsrev(&UPLO,&N,val,rows,cols,fpm,&epsout,&loop,&Emin,&Emax,&M0,E,X,&M,res,&info);
if ( info != 0 ) return 1;
It could be a problem in your input data. How big is your matrix? What are the values for variables such as N, size, and size_row? Can you attach your matrix please?
Thanks for providing the test matrix. Please check a few things in your code:
Thank you for your advice!
Now our example is working properly. The problem was that the row and column indices were 0-based instead of 1-based as MKL FEAST needs.
Thanks again!
Seems hard to learn how to use this routine at first, but if one goes through the example and runs it, it would become clearer. Finally I got my problem resolved with the fixes for indices and column-oriented sparse matrix.
For more complete information about compiler optimizations, see our Optimization Notice.