[petsc-users] petsc-users Digest, Vol 131, Issue 49

baikadi pranay pranayreddy865 at gmail.com
Sat Nov 30 19:28:05 CST 2019


Hello all,
I was able to figure out why i was getting a floating point error. Although
i knew that petsc uses 0-based indexing for fortran, i forgot to modify my
code accordingly. So it was accessing elements of the array which are
essentially zero.
Thank you for your time.
Regards,
Pranay.

On Sat, Nov 30, 2019 at 2:57 PM <petsc-users-request at mcs.anl.gov> wrote:

> Send petsc-users mailing list submissions to
>         petsc-users at mcs.anl.gov
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.mcs.anl.gov/mailman/listinfo/petsc-users
> or, via email, send a message with subject or body 'help' to
>         petsc-users-request at mcs.anl.gov
>
> You can reach the person managing the list at
>         petsc-users-owner at mcs.anl.gov
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of petsc-users digest..."
>
>
> Today's Topics:
>
>    1. Re:  Outputting matrix for viewing in matlab (baikadi pranay)
>    2.  Floating point exception (baikadi pranay)
>    3. Re:  Floating point exception (Matthew Knepley)
>    4. Re:  Floating point exception (baikadi pranay)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 30 Nov 2019 13:30:51 -0700
> From: baikadi pranay <pranayreddy865 at gmail.com>
> To: "Smith, Barry F." <bsmith at mcs.anl.gov>
> Cc: "petsc-users at mcs.anl.gov" <petsc-users at mcs.anl.gov>
> Subject: Re: [petsc-users] Outputting matrix for viewing in matlab
> Message-ID:
>         <CA+zFCTkqxYmE_BGOU92dSAVZ=bPL9W1CkjmCw9=
> sVZYoM7+4hA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Thank you all for the suggestions. I have it working now.
>
> Regards,
> Pranay.
>
> On Fri, Nov 29, 2019 at 10:39 AM Smith, Barry F. <bsmith at mcs.anl.gov>
> wrote:
>
> >
> >
> > > On Nov 28, 2019, at 7:07 PM, baikadi pranay <pranayreddy865 at gmail.com>
> > wrote:
> > >
> > > Hello PETSc users,
> > >
> > > I have a sparse matrix built and I want to output the matrix for
> viewing
> > in matlab. However i'm having difficulty outputting the matrix. I am
> > writing my program in Fortran90 and I've included the following lines to
> > output the matrix.
> > >
> > >  call
> > PetscViewerBinaryOpen(PETSC_COMM_SELF,'matrix',FILE_MODE_WRITE,view,ierr)
> >
> >   Normally on would use to save the matrix and then use the scripts
> > Patrick mentioned to read the matrix into Matlab or Python.
> >
> >    call MatView(matrix, view,ierr)
> >    call PetscViewerDestroy(view,ierr)
> >
> >
> >
> > >  call PetscViewerBinaryGetDescriptor(view,fd,ierr)
> > >  call PetscBinaryWrite(fd,ham,1,PETSC_SCALAR,PETSC_FALSE,ierr)
> > >
> > > These lines do create a matrix but matlab says its not a binary file.
> > Could you please provide me some inputs on where I'm going wrong and how
> to
> > proceed with this problem. I can provide any further information that you
> > might need to help me solve this problem.
> > >
> > >
> > > Thank you.
> > >
> > > Sincerely,
> > > Pranay.
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/94be3de8/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Sat, 30 Nov 2019 14:18:12 -0700
> From: baikadi pranay <pranayreddy865 at gmail.com>
> To: petsc-users at mcs.anl.gov
> Subject: [petsc-users] Floating point exception
> Message-ID:
>         <
> CA+zFCTkX2Nf-dHnWdxKZtqtLzn2deRRstJbk_dHn9hKxCe6ZsA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 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*
>
> 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.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/0333a083/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 3
> Date: Sat, 30 Nov 2019 15:45:55 -0600
> From: Matthew Knepley <knepley at gmail.com>
> To: baikadi pranay <pranayreddy865 at gmail.com>
> Cc: PETSc <petsc-users at mcs.anl.gov>
> Subject: Re: [petsc-users] Floating point exception
> Message-ID:
>         <CAMYG4GkU9hQGk+bOKm81xab8UbNsGp5OvV3fTF=
> t7uTi3eDeZA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 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/>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/d57a4cd7/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 4
> Date: Sat, 30 Nov 2019 14:56:15 -0700
> From: baikadi pranay <pranayreddy865 at gmail.com>
> To: Matthew Knepley <knepley at gmail.com>
> Cc: PETSc <petsc-users at mcs.anl.gov>
> Subject: Re: [petsc-users] Floating point exception
> Message-ID:
>         <
> CA+zFCTk4fLaGf8WXdKiuLHtj6H8S7wJWHYtiE+yJfFayqBC4uw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello,
>
> The entire output is the following:
>
>
> [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/>
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/d2498b43/attachment.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> petsc-users mailing list
> petsc-users at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/petsc-users
>
>
> ------------------------------
>
> End of petsc-users Digest, Vol 131, Issue 49
> ********************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/83aabdab/attachment.html>


More information about the petsc-users mailing list