Community
cancel
Showing results for 
Search instead for 
Did you mean: 
vahid_s_
Beginner
38 Views

Stack Overflow Error in Eigenvalue Solver: dfeast_scsrgv

Hi,

I'm trying to solve eigenvalue problem for large sparse matrices using dfeast_scsrgv function. The function works fine for small problems (ex: 8*8 sparse matrix) but it gives System.StackOverflowException error for larger problems( ex: 200*200 sparse matrix) . I'm using Visual Studio 2008 and MKL version 11 with most recent updates installed. My system is windows 64 bit and the programming language is C++. Following I provided the eigenvalue solver code that I'm using. In debug mode when I reach  dfeast_scsrgv  line it gives me Stack Overflow error. I do not think I am using any infinite loop or unnecessary large arrays. I would appreciate if someone can help me to fix the problem. Thanks!

[cpp]   
//Convert stiffness and mass matrix to CSR format - Seldon library
int NumStiff = M_GStiff.GetDataSize();   
Vector<double> V_GStiffVal   (NumStiff);    
Vector<int>    V_GStiffColInd(NumStiff);
Vector<int>    V_GStiffRowPtr(PrbDim+1);
ConvertToCSR(M_GStiff, prop, V_GStiffRowPtr, V_GStiffColInd, V_GStiffVal);  
 
int NumMass = M_GMass.GetDataSize();
Vector<double> V_GMassVal   (NumMass);
Vector<int>    V_GMassColInd(NumMass);
Vector<int>    V_GMassRowPtr(PrbDim+1);
ConvertToCSR(M_GMass, prop, V_GMassRowPtr, V_GMassColInd, V_GMassVal);   
 
//Release memory
M_GStiff.Clear();
M_GMass.Clear();
 
//Convert Seldon format to typical C array
double* a = V_GStiffVal.GetData();
int*   ia = V_GStiffRowPtr.GetData();
int*   ja = V_GStiffColInd.GetData();   
 
double* b = V_GMassVal.GetData();
int*   ib = V_GMassRowPtr.GetData();
int*   jb = V_GMassColInd.GetData();
 
// Convert matrix from 0-based C-notation to Fortran 1-based
int nnz = ia[PrbDim]; 
for (int i = 0; i < PrbDim+1; i++)        ia += 1;    
for (int i = 0; i < nnz; i++)                 ja += 1;  
 
for (int i = 0; i < PrbDim+1; i++)      ib += 1;
for (int i = 0; i < nnz; i++)              jb += 1;
 
// Initialize variables for the solver
double Error    = 0;
int    Loop     = 0;
int    NumMode  = 10;
double Emin     = 0;
double Emax     = pow(10.0,10.0);    
int    Flag     = 0;
char   MTyp     = 'U';
int    NumEigen = NumMode;
 
vector<int>    V_FPM (128,0);
vector<double> V_Eigen(NumMode,0);
vector<double> V_Res (NumMode,0);    
 
V_FPM[0]  = 1;
V_FPM[1]  = 8;
V_FPM[2]  = 12;
V_FPM[3]  = 20;
V_FPM[4]  = 0;
V_FPM[5]  = 0;
V_FPM[6]  = 5;
V_FPM[13] = 0;
V_FPM[63] = 0;
 
int*    P_FPM          = &V_FPM[0];
double* P_Eigen        = &V_Eigen[0];  
double* P_Res          = &V_Res[0];    
double dDum;
 
// Call Eigenvalue Solver
dfeast_scsrgv (&MTyp, &PrbDim, a, ia, ja, b, ib, jb,
                P_FPM, &Error, &Loop, &Emin, &Emax, &NumMode, P_Eigen, &dDum, &NumEigen, P_Res, &Flag);

[/cpp]

0 Kudos
2 Replies
JenniferJ
Moderator
38 Views

This question might be better to be posted to the Intel MKL forum. I will transfer you there.

Have you checked some other postings about this API on the MKL forum? like this one: https://software.intel.com/en-us/forums/topic/515045

Thanks,

Jennifer

Bernard
Black Belt
38 Views

@vahid

Can you post VS debugger output?