The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

Computing eigenvalues of large matrices with ARPACK

Open discussion regarding features, bugs, issues, vendors, etc.

Computing eigenvalues of large matrices with ARPACK

Postby bogdan » Sat Jun 19, 2010 11:43 am

I use ARPACK library for eigenvalues and eigenvectors computation of large complex matrices.
I have noticed that when using a complex matrix of size 1146 x 1146 and the number of requested eigenvalues is 300, the computation fails.
Interestingly, by reducing the precision with which the input matrix is represented, the eigenvalues computation does not fail anymore. Also when the number of requested values is much lower (70) the computation does not fail. When the computation fails, the error message is always the same and can be translated as:

"Error return from LAPACK eigenvalue calculation"

Could you give me a hint why this happens and how this problem could be solved ? Is there other library providing such eigenvalue computation algorithms with which I can compare our results (MATLAB and Octave use also ARPACK library and in our case the computation fails)?
Below is the relevant code used for eigenvalues computation:

while (ido != 99)
{
znaupd_(ido, bmat, n, which, k, tol, resid, p, v, n, iparam, ipntr,
workd, workl, lworkl, rwork, info);
if (info < 0)
{
std::cerr << "TestArpack::eigs:" << __LINE__ << ": Error with ARPACK routine znaupd: info = " << info << std::endl;
flag = -1;
switch(info)
{
case -8:
std::cerr << "Error return from LAPACK eigenvalue calculation" << std::endl;
break;
}
return;
}

// The TestArpack reverse communication parameter ido tells EIGS what to do
switch(ido)
{
case -1:
case 1:
zgemv_(trans, n, n, alpha, a, n, workd+2*(ipntr[0]-1), incx, beta, workd+2*(ipntr[1]-1), incy);
break;
case 2: //in this case, in zschur method, we exit from while loop
std::cout << "TestArpack::eigs: ido = 2, don't know what to do here" << std::endl;
break;
case 99:
// ARPACK has converged
break;
default:
std::cerr << "TestArpack::eigs: Unknown ido." << std::endl;
}
nbIterations++;
}// while (ido ~= 99)
nbConvergedEigs = iparam[4];

if((info != 0) && (info != 1))
{
std::cout << "TestArpack::eigs:" << __LINE__ << ": zschur method exits here" << std::endl;
}

int rvec = 1;//logical type in Fortran
char howmny = 'A';//Compute NEV Ritz vectors (zschur uses 'P')
int *select = new int[p];
for(i=0; i < p; i++)
{
select[i] = 0;//logical false
}
d = new double[2*(k+1)];//output
double *z = new double[2*n*p];//output
double sigma[] = {0.0, 0.0};
double *workev = new double[4*p];
zneupd_(rvec, howmny, select, d, z, n, sigma, workev,
bmat, n, which, k, tol, resid, p, v, n, iparam, ipntr,
workd, workl, lworkl, rwork, info);//same as for znaupd
bogdan
 
Posts: 1
Joined: Sat Jun 19, 2010 10:46 am
Location: Brasov, Romania

Re: Computing eigenvalues of large matrices with ARPACK

Postby CyLith » Thu Jun 24, 2010 3:50 pm

Amusingly, the comments in the ARPACK code say that the -8 return code should never happen. It happens when LAPACK's zlahqr returns nonzero, indicating some failure at computing all the eigenvalues during QR iteration. Since your matrix is only 1146x1146, what does LAPACK say about the eigenvalues if you just use it instead of ARPACK? You may need to precondition if its spectrum is too unfriendly.
CyLith
 
Posts: 41
Joined: Sun Feb 08, 2009 7:23 am
Location: Stanford, CA

Re: Computing eigenvalues of large matrices with ARPACK

Postby Julien Langou » Fri Jun 25, 2010 8:04 am

ARPACK is using LAPACK-2.0. LAPACK-2.0 is fairly outdated. There has ben an interface change between LAPACK-2.0 and LAPACK-3.0 so ARPACK does not work with the current LAPACK. Julien.
Julien Langou
 
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: Computing eigenvalues of large matrices with ARPACK

Postby CyLith » Sat Jun 26, 2010 3:08 am

That's odd; I'm pretty sure I've linked ARPACK against a modern LAPACK. Either way, I have translated complex versions of ARPACK routines and its dependent LAPACK pieces into C++ located here if you're interested. Also, it's multiple call safe since I got rid of its stupid global variables.
CyLith
 
Posts: 41
Joined: Sun Feb 08, 2009 7:23 am
Location: Stanford, CA

Re: Computing eigenvalues of large matrices with ARPACK

Postby minh_ht » Tue Jul 20, 2010 2:43 am

Dear All,


I use ARPACK library to solve the Complex Generalized Nonsymmetric Eigenvalue Problems, http://www.caam.rice.edu/software/ARPACK/index.html and Visual Fortran was chosen as the language programming.

Firstly, I try to run a example from the folder NONSYM, the driver : dndrv5.f in the Fotran Console Application. I do not modify any command in this file. Then, I added whole files from the Library LAPACK, BLAS,UTIL,SRC into the Header File Folder. Also the location of the 'debug.h' and 'stat.h' are in Header File Folder

Finally, I get errors from the debug program,which are listing as follows,

Compiling Fortran...

F:\ARPACK\PACK\SRC\znaupd.f

F:\ARPACK\PACK\SRC\znaupd.f(387) : Error: Cannot open include file 'debug.h'

include 'debug.h'

----------------^

F:\ARPACK\PACK\SRC\znaupd.f(388) : Error: Cannot open include file 'stat.h'

include 'stat.h'

......

.....

....

Error executing df.exe.

Test.exe - 56 error(s), 0 warning(s)

Any help will be greately appreciated.
minh_ht
 
Posts: 2
Joined: Wed Jul 14, 2010 2:04 pm


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 7 guests