[petsc-users] error with slepc shift invert: New nonzero at (0, 0) caused a malloc!
John Travers
jtravs at gmail.com
Tue Aug 27 09:59:51 CDT 2013
On 27 Aug 2013, at 16:18, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> John Travers <jtravs at gmail.com> writes:
>
>> Hi all,
>>
>> I'm trying to use shift and invert to find interior eigenvalues using slepc.
>> I am using example 4 in slepc 3.41 which reads the matrix from a binary file ('A' saved from Matlab).
>>
>> If I run just:
>> ./ex4 -file A -eps_nev 1
>> the program runs fine, and correctly finds the largest eigenvalue (although much slower than Matlab's eigs).
>
> You can't compare performance when running in debug mode. If the
> algorithm converges slower, we can figure out why.
Thanks for this. It wasn't obvious to me. I recompiled and get much better performance.
>
>> However, if I run:
>> ./ex4 -file A -eps_nev 1 -st_type sinvert -st_shift 0.0,0.5
>> to try and find an eigenvalue near 0.0+0.5i, it outputs the error message below.
>
> Please just insert a value 0.0 along the diagonal of your matrix.
> MatShift would be more expensive and could hide memory performance bugs
> if it silently reallocated to add diagonal entries.
OK, this solved my problem. Although I couldn't add zeros on the diagonal (the software I use to write the sparse matrices optimises this out), so I put a diagonal of 1e-300. Do you think this will cause inaccuracies in the calculations (so far it seems OK).
Thanks,
John
More information about the petsc-users
mailing list