[petsc-users] Floating point exception
baikadi pranay
pranayreddy865 at gmail.com
Sun Dec 1 11:21:55 CST 2019
Hello,
I was able to fix the problem. You are correct that the matrix B is
singular although that was not the intention. I am using fortran and
although i knew that PETSc uses 0-based indexing for fortran, I forgot to
take this into account while filling out the B matrix. This resulted in the
program accessing matrix elements which are essentially zero.
Also I am not using the *-st_pc_factor_shift_amount* option or the
*-st_pc_factor_shift_type *and it works fine.
Thank you for your time.
Best wishes,
Pranay.
On Sun, Dec 1, 2019 at 9:33 AM Matthew Knepley <knepley at gmail.com> wrote:
> On Sat, Nov 30, 2019 at 3:56 PM baikadi pranay <pranayreddy865 at gmail.com>
> wrote:
>
>> Hello,
>>
>> The entire output is the following:
>>
>
> Okay, you are definitely getting an infinity in the output vector from the
> LU solve, so you are giving it a singular matrix.
> I am guessing this is B? How can you justify using a singular B?
> Also, -st_pc_factor_shift_amount 1 is strange. You
> would normally use a very small offset like 1.0e-10 or something.
>
> Thanks,
>
> Matt
>
>
>> [0]PETSC ERROR: --------------------- Error Message
>> --------------------------------------------------------------
>> [0]PETSC ERROR: Floating point exception
>> [0]PETSC ERROR: Vec entry at local location 0 is not-a-number or infinite
>> at end of function: Parameter number 3
>> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
>> for trouble shooting.
>> [0]PETSC ERROR: Petsc Release Version 3.11.1, Apr, 12, 2019
>> [0]PETSC ERROR: ./a.out on a linux-gnu-c-debug named
>> agave1.agave.rc.asu.edu by pbaikadi Sat Nov 30 14:54:31 2019
>> [0]PETSC ERROR: Configure options
>> [0]PETSC ERROR: #1 VecValidValues() line 28 in
>> /packages/7x/petsc/3.11.1/petsc-3.11.1/src/vec/vec/interface/rvector.c
>> [0]PETSC ERROR: #2 PCApply() line 464 in
>> /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/pc/interface/precon.c
>> [0]PETSC ERROR: #3 KSP_PCApply() line 281 in
>> /packages/7x/petsc/3.11.1/petsc-3.11.1/include/petsc/private/kspimpl.h
>> [0]PETSC ERROR: #4 KSPSolve_PREONLY() line 22 in
>> /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/impls/preonly/preonly.c
>> [0]PETSC ERROR: #5 KSPSolve() line 782 in
>> /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/interface/itfunc.c
>> [0]PETSC ERROR: #6 STMatSolve() line 193 in
>> /packages/7x/slepc/3.11.1/slepc-3.11.1/src/sys/classes/st/interface/stsles.c
>> [0]PETSC ERROR: #7 STApply_Shift() line 25 in
>> /packages/7x/slepc/3.11.1/slepc-3.11.1/src/sys/classes/st/impls/shift/shift.c
>> [0]PETSC ERROR: #8 STApply() line 57 in
>> /packages/7x/slepc/3.11.1/slepc-3.11.1/src/sys/classes/st/interface/stsolve.c
>> [0]PETSC ERROR: #9 EPSGetStartVector() line 797 in
>> /packages/7x/slepc/3.11.1/slepc-3.11.1/src/eps/interface/epssolve.c
>> [0]PETSC ERROR: #10 EPSSolve_KrylovSchur_Symm() line 32 in
>> /packages/7x/slepc/3.11.1/slepc-3.11.1/src/eps/impls/krylov/krylovschur/ks-symm.c
>> [0]PETSC ERROR: #11 EPSSolve() line 149 in
>> /packages/7x/slepc/3.11.1/slepc-3.11.1/src/eps/interface/epssolve.c
>>
>> Regards,
>> Pranay.
>>
>> On Sat, Nov 30, 2019 at 2:46 PM Matthew Knepley <knepley at gmail.com>
>> wrote:
>>
>>> On Sat, Nov 30, 2019 at 3:19 PM baikadi pranay <pranayreddy865 at gmail.com>
>>> wrote:
>>>
>>>> Hello PETSc users,
>>>>
>>>> I am currently trying to build a 1-D Schrodinger solver. I have built
>>>> my hamiltonian matrix (of size 121 x 121) and i'm trying to find the
>>>> eigenvalues. I have the following lines of code for the solver:
>>>>
>>>> *call EPSCreate(PETSC_COMM_WORLD,eps,ierr)*
>>>>
>>>> *call EPSSetOperators(eps,ham,S,ierr)call
>>>> EPSSetProblemType(eps,EPS_GHEP,ierr)*
>>>>
>>>>
>>>>
>>>> *call EPSSetFromOptions(eps,ierr)call
>>>> EPSSetDimensions(eps,10,PETSC_DEFAULT_INTEGER,PETSC_DEFAULT_INTEGER,ierr)call
>>>> EPSSolve(eps,ierr)call EPSDestroy(eps,ierr)*
>>>>
>>>> At the EPSSolve line, i get the following error:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *[0]PETSC ERROR: --------------------- Error Message
>>>> --------------------------------------------------------------[0]PETSC
>>>> ERROR: Floating point exception[0]PETSC ERROR: Vec entry at local location
>>>> 0 is not-a-number or infinite at end of function: Parameter number
>>>> 3[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
>>>> <http://www.mcs.anl.gov/petsc/documentation/faq.html> for trouble
>>>> shooting.[0]PETSC ERROR: Petsc Release Version 3.11.1, Apr, 12, 2019*
>>>>
>>>
>>> You need to show the entire stack trace that is output here.
>>>
>>> Thanks,
>>>
>>> Matt
>>>
>>>
>>>> I am using the options *-st_pc_factor_shift_type NONZERO
>>>> -st_pc_factor_shift_amount 1* ( else I end up getting the "zero
>>>> pivot in LU factorization" error ).
>>>>
>>>> I outputted my matrix to matlab and confirmed that the null space is
>>>> empty and the matrix is not singular. I am not sure why I'm getting this
>>>> error. Could you provide me a hint as to how to solve this problem.
>>>>
>>>> Sincerely,
>>>> Pranay.
>>>>
>>>
>>>
>>> --
>>> What most experimenters take for granted before they begin their
>>> experiments is infinitely more interesting than any results to which their
>>> experiments lead.
>>> -- Norbert Wiener
>>>
>>> https://www.cse.buffalo.edu/~knepley/
>>> <http://www.cse.buffalo.edu/~knepley/>
>>>
>>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> <http://www.cse.buffalo.edu/~knepley/>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191201/2768a1c2/attachment.html>
More information about the petsc-users
mailing list