[Arpack-ng] array sizes to ARPACK DS routines

classic Classic list List threaded Threaded
5 messages Options
Samuel Halliday Samuel Halliday
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Arpack-ng] array sizes to ARPACK DS routines

Hi all,

I'm the author of

  https://github.com/fommil/netlib-java

and the maintainer of

  https://github.com/fommil/matrix-toolkits-java


I have used ARPACK in the past but that code is beyond my reach, so I'm re-discovering the API. I'm in the process of adding support for real square symmetric matrices to MTJ in these files:

https://github.com/fommil/matrix-toolkits-java/blob/master/src/main/java/no/uib/cipr/matrix/sparse/ArpackSqSym.java

https://github.com/fommil/matrix-toolkits-java/blob/master/src/test/java/no/uib/cipr/matrix/sparse/ArpackSqSymTest.java


However, when I run the tests using the native backend of ARPACK (actually arpack-ng), I am getting malloc errors that usually appear when memory is being accessed outside the allocated region. This is happening when I enter the DSEUPD routine.


If I change the sizes of my arrays to be * NCV what they currently are, then the malloc errors go away. But obviously, that is just a workaround as it destroys the memory advantages of ARPACK.

The DSSIMP example is incredibly liberal in its allocation of memory: it assigns much more than the documentation says to use (and it also re-uses V as Z, which is probably because it doesn't want vectors).

Are there any known issues with the array size documentation for DSAUPD or DSEUPD?


In addition, I'm getting a lot of INFO = -17 errors from DSEUPD, which would indicate that the arrays are "changing" between calls of DSAUPD and DSEUPD. I am not changing the values of the arrays, but due to the nature of the Java / Native bridge, the arrays may be re-created at a different location on the heap. Does ARPACK use any absolute heap array references in DSAUPD or DSEUPD? (the IPNTR is relative, which is perfectly fine)


Also, as a tangential question to the above: is there any way to use ARPACK to calculate *all* the eigenvalues/eigenvectors for a large square symmetric real matrix?


--
Sam

_______________________________________________
Arpack-ng mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/arpack-ng
Samuel Halliday Samuel Halliday
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: array sizes to ARPACK DS routines

Looking deeper into the native side of things, something funky is happening. The actual values (at the pointer locations) of

  ncv, ldv, lworkl, info

are changing as a result of calling DSEUPD. Where I would only expect INFO to be changed.

Perhaps my C / Fortran mapping is incorrect.

Do these C definitions of the ARPACK routines look sensible? (BTW, if you provided these it would be incredibly useful)

  https://github.com/fommil/netlib-java/blob/master/netlib/ARPACK/arpack.h


--
Sam

On 15 Sep 2013, at 16:08, Samuel Halliday <[hidden email]> wrote:

> Hi all,
>
> I'm the author of
>
>  https://github.com/fommil/netlib-java
>
> and the maintainer of
>
>  https://github.com/fommil/matrix-toolkits-java
>
>
> I have used ARPACK in the past but that code is beyond my reach, so I'm re-discovering the API. I'm in the process of adding support for real square symmetric matrices to MTJ in these files:
>
> https://github.com/fommil/matrix-toolkits-java/blob/master/src/main/java/no/uib/cipr/matrix/sparse/ArpackSqSym.java
>
> https://github.com/fommil/matrix-toolkits-java/blob/master/src/test/java/no/uib/cipr/matrix/sparse/ArpackSqSymTest.java
>
>
> However, when I run the tests using the native backend of ARPACK (actually arpack-ng), I am getting malloc errors that usually appear when memory is being accessed outside the allocated region. This is happening when I enter the DSEUPD routine.
>
>
> If I change the sizes of my arrays to be * NCV what they currently are, then the malloc errors go away. But obviously, that is just a workaround as it destroys the memory advantages of ARPACK.
>
> The DSSIMP example is incredibly liberal in its allocation of memory: it assigns much more than the documentation says to use (and it also re-uses V as Z, which is probably because it doesn't want vectors).
>
> Are there any known issues with the array size documentation for DSAUPD or DSEUPD?
>
>
> In addition, I'm getting a lot of INFO = -17 errors from DSEUPD, which would indicate that the arrays are "changing" between calls of DSAUPD and DSEUPD. I am not changing the values of the arrays, but due to the nature of the Java / Native bridge, the arrays may be re-created at a different location on the heap. Does ARPACK use any absolute heap array references in DSAUPD or DSEUPD? (the IPNTR is relative, which is perfectly fine)
>
>
> Also, as a tangential question to the above: is there any way to use ARPACK to calculate *all* the eigenvalues/eigenvectors for a large square symmetric real matrix?
>
>
> --
> Sam
>

_______________________________________________
Arpack-ng mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/arpack-ng
Samuel Halliday Samuel Halliday
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: array sizes to ARPACK DS routines

mmm, sorry... ignore this update about ncv, ldv, lworkl changing... it was a mistaken interpretation.

--
Sam

On 15 Sep 2013, at 16:31, Samuel Halliday <[hidden email]> wrote:

> Looking deeper into the native side of things, something funky is happening. The actual values (at the pointer locations) of
>
>  ncv, ldv, lworkl, info
>
> are changing as a result of calling DSEUPD. Where I would only expect INFO to be changed.
>
> Perhaps my C / Fortran mapping is incorrect.
>
> Do these C definitions of the ARPACK routines look sensible? (BTW, if you provided these it would be incredibly useful)
>
>  https://github.com/fommil/netlib-java/blob/master/netlib/ARPACK/arpack.h
>
>
> --
> Sam
>
> On 15 Sep 2013, at 16:08, Samuel Halliday <[hidden email]> wrote:
>
>> Hi all,
>>
>> I'm the author of
>>
>> https://github.com/fommil/netlib-java
>>
>> and the maintainer of
>>
>> https://github.com/fommil/matrix-toolkits-java
>>
>>
>> I have used ARPACK in the past but that code is beyond my reach, so I'm re-discovering the API. I'm in the process of adding support for real square symmetric matrices to MTJ in these files:
>>
>> https://github.com/fommil/matrix-toolkits-java/blob/master/src/main/java/no/uib/cipr/matrix/sparse/ArpackSqSym.java
>>
>> https://github.com/fommil/matrix-toolkits-java/blob/master/src/test/java/no/uib/cipr/matrix/sparse/ArpackSqSymTest.java
>>
>>
>> However, when I run the tests using the native backend of ARPACK (actually arpack-ng), I am getting malloc errors that usually appear when memory is being accessed outside the allocated region. This is happening when I enter the DSEUPD routine.
>>
>>
>> If I change the sizes of my arrays to be * NCV what they currently are, then the malloc errors go away. But obviously, that is just a workaround as it destroys the memory advantages of ARPACK.
>>
>> The DSSIMP example is incredibly liberal in its allocation of memory: it assigns much more than the documentation says to use (and it also re-uses V as Z, which is probably because it doesn't want vectors).
>>
>> Are there any known issues with the array size documentation for DSAUPD or DSEUPD?
>>
>>
>> In addition, I'm getting a lot of INFO = -17 errors from DSEUPD, which would indicate that the arrays are "changing" between calls of DSAUPD and DSEUPD. I am not changing the values of the arrays, but due to the nature of the Java / Native bridge, the arrays may be re-created at a different location on the heap. Does ARPACK use any absolute heap array references in DSAUPD or DSEUPD? (the IPNTR is relative, which is perfectly fine)
>>
>>
>> Also, as a tangential question to the above: is there any way to use ARPACK to calculate *all* the eigenvalues/eigenvectors for a large square symmetric real matrix?
>>
>>
>> --
>> Sam
>>
>

_______________________________________________
Arpack-ng mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/arpack-ng
Samuel Halliday Samuel Halliday
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: array sizes to ARPACK DS routines

In reply to this post by Samuel Halliday
I fixed the INFO = -17 problem below by using a more liberal TOL. The issue was that the Ritz vectors hadn't converged according to the TOL I was passing.

However, I'm still bemused by the malloc problems. I even updated to the patched version thanks to Pauli Virtanen's patch and I'm still getting it.

--
Sam

On 15 Sep 2013, at 16:08, Samuel Halliday <[hidden email]> wrote:

> Hi all,
>
> I'm the author of
>
>  https://github.com/fommil/netlib-java
>
> and the maintainer of
>
>  https://github.com/fommil/matrix-toolkits-java
>
>
> I have used ARPACK in the past but that code is beyond my reach, so I'm re-discovering the API. I'm in the process of adding support for real square symmetric matrices to MTJ in these files:
>
> https://github.com/fommil/matrix-toolkits-java/blob/master/src/main/java/no/uib/cipr/matrix/sparse/ArpackSqSym.java
>
> https://github.com/fommil/matrix-toolkits-java/blob/master/src/test/java/no/uib/cipr/matrix/sparse/ArpackSqSymTest.java
>
>
> However, when I run the tests using the native backend of ARPACK (actually arpack-ng), I am getting malloc errors that usually appear when memory is being accessed outside the allocated region. This is happening when I enter the DSEUPD routine.
>
>
> If I change the sizes of my arrays to be * NCV what they currently are, then the malloc errors go away. But obviously, that is just a workaround as it destroys the memory advantages of ARPACK.
>
> The DSSIMP example is incredibly liberal in its allocation of memory: it assigns much more than the documentation says to use (and it also re-uses V as Z, which is probably because it doesn't want vectors).
>
> Are there any known issues with the array size documentation for DSAUPD or DSEUPD?
>
>
> In addition, I'm getting a lot of INFO = -17 errors from DSEUPD, which would indicate that the arrays are "changing" between calls of DSAUPD and DSEUPD. I am not changing the values of the arrays, but due to the nature of the Java / Native bridge, the arrays may be re-created at a different location on the heap. Does ARPACK use any absolute heap array references in DSAUPD or DSEUPD? (the IPNTR is relative, which is perfectly fine)
>
>
> Also, as a tangential question to the above: is there any way to use ARPACK to calculate *all* the eigenvalues/eigenvectors for a large square symmetric real matrix?
>
>
> --
> Sam
>

_______________________________________________
Arpack-ng mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/arpack-ng
Samuel Halliday Samuel Halliday
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: array sizes to ARPACK DS routines

errr... ignore this thread. *somebody* forgot how to use malloc correctly (innocent face)

Actually, this is still one question I'd like to know more about: is it possible to compute all the eigenvalues/eigenvectors for a matrix with ARPACK? The API seems to say NEV < N for symmetric matrices.


--
Sam

On 15 Sep 2013, at 17:23, Samuel Halliday <[hidden email]> wrote:

> I fixed the INFO = -17 problem below by using a more liberal TOL. The issue was that the Ritz vectors hadn't converged according to the TOL I was passing.
>
> However, I'm still bemused by the malloc problems. I even updated to the patched version thanks to Pauli Virtanen's patch and I'm still getting it.
>
> --
> Sam
>
> On 15 Sep 2013, at 16:08, Samuel Halliday <[hidden email]> wrote:
>
>> Hi all,
>>
>> I'm the author of
>>
>> https://github.com/fommil/netlib-java
>>
>> and the maintainer of
>>
>> https://github.com/fommil/matrix-toolkits-java
>>
>>
>> I have used ARPACK in the past but that code is beyond my reach, so I'm re-discovering the API. I'm in the process of adding support for real square symmetric matrices to MTJ in these files:
>>
>> https://github.com/fommil/matrix-toolkits-java/blob/master/src/main/java/no/uib/cipr/matrix/sparse/ArpackSqSym.java
>>
>> https://github.com/fommil/matrix-toolkits-java/blob/master/src/test/java/no/uib/cipr/matrix/sparse/ArpackSqSymTest.java
>>
>>
>> However, when I run the tests using the native backend of ARPACK (actually arpack-ng), I am getting malloc errors that usually appear when memory is being accessed outside the allocated region. This is happening when I enter the DSEUPD routine.
>>
>>
>> If I change the sizes of my arrays to be * NCV what they currently are, then the malloc errors go away. But obviously, that is just a workaround as it destroys the memory advantages of ARPACK.
>>
>> The DSSIMP example is incredibly liberal in its allocation of memory: it assigns much more than the documentation says to use (and it also re-uses V as Z, which is probably because it doesn't want vectors).
>>
>> Are there any known issues with the array size documentation for DSAUPD or DSEUPD?
>>
>>
>> In addition, I'm getting a lot of INFO = -17 errors from DSEUPD, which would indicate that the arrays are "changing" between calls of DSAUPD and DSEUPD. I am not changing the values of the arrays, but due to the nature of the Java / Native bridge, the arrays may be re-created at a different location on the heap. Does ARPACK use any absolute heap array references in DSAUPD or DSEUPD? (the IPNTR is relative, which is perfectly fine)
>>
>>
>> Also, as a tangential question to the above: is there any way to use ARPACK to calculate *all* the eigenvalues/eigenvectors for a large square symmetric real matrix?
>>
>>
>> --
>> Sam
>>
>

_______________________________________________
Arpack-ng mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/arpack-ng
Loading...