[petsc-users] error with slepc shift invert: New nonzero at (0, 0) caused a malloc!

Jose E. Roman jroman at dsic.upv.es
Tue Aug 27 09:25:38 CDT 2013


El 27/08/2013, a las 16:18, Jed Brown escribió:

> 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.
> 
>> 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.

Note that you should use -eps_target 0.0,0.5 instead of -st_shift.

Jose



More information about the petsc-users mailing list