arpackpp icon indicating copy to clipboard operation
arpackpp copied to clipboard

Integer overflow

Open IdontKehr opened this issue 4 years ago • 4 comments

Hello,

i recently found a problem in the arpackpp library when trying to compute eigenvalues of very large matrices. This is caused by an integer overflow in the Prepare function in the arrseig.h header when memory gets allocated by V=new ARTYPE[n*ncv+1] because n*ncv exceeds the maximum integer value (for example for n=4000000 and ncv=601). It is sufficient to change the datatype of n, ncv, etc from int unsigned long in the arrseig.h header or might there occur further problems in other header files or in the Fortran routines?

Also sometimes the calculations get stuck at some iteration when choosing the dimensions such that the integer overflow problem does not occur. Might this also be caused by a bug of the library or might it be caused by the algorithm used?

It would be nice if somebody could help me out with these problems.

Best regards IdontKehr

IdontKehr avatar Aug 13 '20 15:08 IdontKehr

Not sure. Could be that there is also a limit on the matrix size in the underlying Fortran code (arpack) ?

m-reuter avatar Aug 13 '20 20:08 m-reuter

Did you get this working?

m-reuter avatar Jul 03 '21 19:07 m-reuter

I‘m using the SLEPc library now, which contains a more efficient method (the Krylov-Schur method) than the IRAM provided by ARPACK. One has the option to install this library with 64-bit integers such that the overflow does not occur. Another installation option allows SLEPc to also use ARPACK, where the integer overflow does not occur either when using the 64-bit integer option. So the problem should lie in the arpackpp library and not in the ARPACK library itself.

IdontKehr avatar Jul 03 '21 20:07 IdontKehr

Thanks for the update! Good to know that it is not a limitation of ARPACK, so changing int to unsigned long should fix the first problem.

m-reuter avatar Jul 05 '21 13:07 m-reuter