<div dir="ltr">Hello all,<div>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. <br>Thank you for your time. <br>Regards,</div><div>Pranay.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 30, 2019 at 2:57 PM <<a href="mailto:petsc-users-request@mcs.anl.gov">petsc-users-request@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Send petsc-users mailing list submissions to<br>
<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/petsc-users" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/petsc-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:petsc-users-request@mcs.anl.gov" target="_blank">petsc-users-request@mcs.anl.gov</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:petsc-users-owner@mcs.anl.gov" target="_blank">petsc-users-owner@mcs.anl.gov</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of petsc-users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Outputting matrix for viewing in matlab (baikadi pranay)<br>
2. Floating point exception (baikadi pranay)<br>
3. Re: Floating point exception (Matthew Knepley)<br>
4. Re: Floating point exception (baikadi pranay)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sat, 30 Nov 2019 13:30:51 -0700<br>
From: baikadi pranay <<a href="mailto:pranayreddy865@gmail.com" target="_blank">pranayreddy865@gmail.com</a>><br>
To: "Smith, Barry F." <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>><br>
Cc: "<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>" <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
Subject: Re: [petsc-users] Outputting matrix for viewing in matlab<br>
Message-ID:<br>
<CA+zFCTkqxYmE_BGOU92dSAVZ=bPL9W1CkjmCw9=<a href="mailto:sVZYoM7%2B4hA@mail.gmail.com" target="_blank">sVZYoM7+4hA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Thank you all for the suggestions. I have it working now.<br>
<br>
Regards,<br>
Pranay.<br>
<br>
On Fri, Nov 29, 2019 at 10:39 AM Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> wrote:<br>
<br>
><br>
><br>
> > On Nov 28, 2019, at 7:07 PM, baikadi pranay <<a href="mailto:pranayreddy865@gmail.com" target="_blank">pranayreddy865@gmail.com</a>><br>
> wrote:<br>
> ><br>
> > Hello PETSc users,<br>
> ><br>
> > I have a sparse matrix built and I want to output the matrix for viewing<br>
> in matlab. However i'm having difficulty outputting the matrix. I am<br>
> writing my program in Fortran90 and I've included the following lines to<br>
> output the matrix.<br>
> ><br>
> > call<br>
> PetscViewerBinaryOpen(PETSC_COMM_SELF,'matrix',FILE_MODE_WRITE,view,ierr)<br>
><br>
> Normally on would use to save the matrix and then use the scripts<br>
> Patrick mentioned to read the matrix into Matlab or Python.<br>
><br>
> call MatView(matrix, view,ierr)<br>
> call PetscViewerDestroy(view,ierr)<br>
><br>
><br>
><br>
> > call PetscViewerBinaryGetDescriptor(view,fd,ierr)<br>
> > call PetscBinaryWrite(fd,ham,1,PETSC_SCALAR,PETSC_FALSE,ierr)<br>
> ><br>
> > These lines do create a matrix but matlab says its not a binary file.<br>
> Could you please provide me some inputs on where I'm going wrong and how to<br>
> proceed with this problem. I can provide any further information that you<br>
> might need to help me solve this problem.<br>
> ><br>
> ><br>
> > Thank you.<br>
> ><br>
> > Sincerely,<br>
> > Pranay.<br>
><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/94be3de8/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/94be3de8/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Sat, 30 Nov 2019 14:18:12 -0700<br>
From: baikadi pranay <<a href="mailto:pranayreddy865@gmail.com" target="_blank">pranayreddy865@gmail.com</a>><br>
To: <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
Subject: [petsc-users] Floating point exception<br>
Message-ID:<br>
<<a href="mailto:CA%2BzFCTkX2Nf-dHnWdxKZtqtLzn2deRRstJbk_dHn9hKxCe6ZsA@mail.gmail.com" target="_blank">CA+zFCTkX2Nf-dHnWdxKZtqtLzn2deRRstJbk_dHn9hKxCe6ZsA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello PETSc users,<br>
<br>
I am currently trying to build a 1-D Schrodinger solver. I have built my<br>
hamiltonian matrix (of size 121 x 121) and i'm trying to find the<br>
eigenvalues. I have the following lines of code for the solver:<br>
<br>
*call EPSCreate(PETSC_COMM_WORLD,eps,ierr)*<br>
<br>
*call EPSSetOperators(eps,ham,S,ierr)call<br>
EPSSetProblemType(eps,EPS_GHEP,ierr)*<br>
<br>
<br>
<br>
*call EPSSetFromOptions(eps,ierr)call<br>
EPSSetDimensions(eps,10,PETSC_DEFAULT_INTEGER,PETSC_DEFAULT_INTEGER,ierr)call<br>
EPSSolve(eps,ierr)call EPSDestroy(eps,ierr)*<br>
<br>
At the EPSSolve line, i get the following error:<br>
<br>
<br>
<br>
<br>
<br>
*[0]PETSC ERROR: --------------------- Error Message<br>
--------------------------------------------------------------[0]PETSC<br>
ERROR: Floating point exception[0]PETSC ERROR: Vec entry at local location<br>
0 is not-a-number or infinite at end of function: Parameter number<br>
3[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a><br>
<<a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a>> for trouble<br>
shooting.[0]PETSC ERROR: Petsc Release Version 3.11.1, Apr, 12, 2019*<br>
<br>
I am using the options *-st_pc_factor_shift_type NONZERO<br>
-st_pc_factor_shift_amount 1* ( else I end up getting the "zero pivot<br>
in LU factorization" error ).<br>
<br>
I outputted my matrix to matlab and confirmed that the null space is empty<br>
and the matrix is not singular. I am not sure why I'm getting this error.<br>
Could you provide me a hint as to how to solve this problem.<br>
<br>
Sincerely,<br>
Pranay.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/0333a083/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/0333a083/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Sat, 30 Nov 2019 15:45:55 -0600<br>
From: Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
To: baikadi pranay <<a href="mailto:pranayreddy865@gmail.com" target="_blank">pranayreddy865@gmail.com</a>><br>
Cc: PETSc <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
Subject: Re: [petsc-users] Floating point exception<br>
Message-ID:<br>
<CAMYG4GkU9hQGk+bOKm81xab8UbNsGp5OvV3fTF=<a href="mailto:t7uTi3eDeZA@mail.gmail.com" target="_blank">t7uTi3eDeZA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
On Sat, Nov 30, 2019 at 3:19 PM baikadi pranay <<a href="mailto:pranayreddy865@gmail.com" target="_blank">pranayreddy865@gmail.com</a>><br>
wrote:<br>
<br>
> Hello PETSc users,<br>
><br>
> I am currently trying to build a 1-D Schrodinger solver. I have built my<br>
> hamiltonian matrix (of size 121 x 121) and i'm trying to find the<br>
> eigenvalues. I have the following lines of code for the solver:<br>
><br>
> *call EPSCreate(PETSC_COMM_WORLD,eps,ierr)*<br>
><br>
> *call EPSSetOperators(eps,ham,S,ierr)call<br>
> EPSSetProblemType(eps,EPS_GHEP,ierr)*<br>
><br>
><br>
><br>
> *call EPSSetFromOptions(eps,ierr)call<br>
> EPSSetDimensions(eps,10,PETSC_DEFAULT_INTEGER,PETSC_DEFAULT_INTEGER,ierr)call<br>
> EPSSolve(eps,ierr)call EPSDestroy(eps,ierr)*<br>
><br>
> At the EPSSolve line, i get the following error:<br>
><br>
><br>
><br>
><br>
><br>
> *[0]PETSC ERROR: --------------------- Error Message<br>
> --------------------------------------------------------------[0]PETSC<br>
> ERROR: Floating point exception[0]PETSC ERROR: Vec entry at local location<br>
> 0 is not-a-number or infinite at end of function: Parameter number<br>
> 3[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a><br>
> <<a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a>> for trouble<br>
> shooting.[0]PETSC ERROR: Petsc Release Version 3.11.1, Apr, 12, 2019*<br>
><br>
<br>
You need to show the entire stack trace that is output here.<br>
<br>
Thanks,<br>
<br>
Matt<br>
<br>
<br>
> I am using the options *-st_pc_factor_shift_type NONZERO<br>
> -st_pc_factor_shift_amount 1* ( else I end up getting the "zero pivot<br>
> in LU factorization" error ).<br>
><br>
> I outputted my matrix to matlab and confirmed that the null space is empty<br>
> and the matrix is not singular. I am not sure why I'm getting this error.<br>
> Could you provide me a hint as to how to solve this problem.<br>
><br>
> Sincerely,<br>
> Pranay.<br>
><br>
<br>
<br>
-- <br>
What most experimenters take for granted before they begin their<br>
experiments is infinitely more interesting than any results to which their<br>
experiments lead.<br>
-- Norbert Wiener<br>
<br>
<a href="https://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a> <<a href="http://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">http://www.cse.buffalo.edu/~knepley/</a>><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/d57a4cd7/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/d57a4cd7/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Sat, 30 Nov 2019 14:56:15 -0700<br>
From: baikadi pranay <<a href="mailto:pranayreddy865@gmail.com" target="_blank">pranayreddy865@gmail.com</a>><br>
To: Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
Cc: PETSc <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
Subject: Re: [petsc-users] Floating point exception<br>
Message-ID:<br>
<<a href="mailto:CA%2BzFCTk4fLaGf8WXdKiuLHtj6H8S7wJWHYtiE%2ByJfFayqBC4uw@mail.gmail.com" target="_blank">CA+zFCTk4fLaGf8WXdKiuLHtj6H8S7wJWHYtiE+yJfFayqBC4uw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello,<br>
<br>
The entire output is the following:<br>
<br>
<br>
[0]PETSC ERROR: --------------------- Error Message<br>
--------------------------------------------------------------<br>
[0]PETSC ERROR: Floating point exception<br>
[0]PETSC ERROR: Vec entry at local location 0 is not-a-number or infinite<br>
at end of function: Parameter number 3<br>
[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for<br>
trouble shooting.<br>
[0]PETSC ERROR: Petsc Release Version 3.11.1, Apr, 12, 2019<br>
[0]PETSC ERROR: ./a.out on a linux-gnu-c-debug named <a href="http://agave1.agave.rc.asu.edu" rel="noreferrer" target="_blank">agave1.agave.rc.asu.edu</a><br>
by pbaikadi Sat Nov 30 14:54:31 2019<br>
[0]PETSC ERROR: Configure options<br>
[0]PETSC ERROR: #1 VecValidValues() line 28 in<br>
/packages/7x/petsc/3.11.1/petsc-3.11.1/src/vec/vec/interface/rvector.c<br>
[0]PETSC ERROR: #2 PCApply() line 464 in<br>
/packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/pc/interface/precon.c<br>
[0]PETSC ERROR: #3 KSP_PCApply() line 281 in<br>
/packages/7x/petsc/3.11.1/petsc-3.11.1/include/petsc/private/kspimpl.h<br>
[0]PETSC ERROR: #4 KSPSolve_PREONLY() line 22 in<br>
/packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/impls/preonly/preonly.c<br>
[0]PETSC ERROR: #5 KSPSolve() line 782 in<br>
/packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/interface/itfunc.c<br>
[0]PETSC ERROR: #6 STMatSolve() line 193 in<br>
/packages/7x/slepc/3.11.1/slepc-3.11.1/src/sys/classes/st/interface/stsles.c<br>
[0]PETSC ERROR: #7 STApply_Shift() line 25 in<br>
/packages/7x/slepc/3.11.1/slepc-3.11.1/src/sys/classes/st/impls/shift/shift.c<br>
[0]PETSC ERROR: #8 STApply() line 57 in<br>
/packages/7x/slepc/3.11.1/slepc-3.11.1/src/sys/classes/st/interface/stsolve.c<br>
[0]PETSC ERROR: #9 EPSGetStartVector() line 797 in<br>
/packages/7x/slepc/3.11.1/slepc-3.11.1/src/eps/interface/epssolve.c<br>
[0]PETSC ERROR: #10 EPSSolve_KrylovSchur_Symm() line 32 in<br>
/packages/7x/slepc/3.11.1/slepc-3.11.1/src/eps/impls/krylov/krylovschur/ks-symm.c<br>
[0]PETSC ERROR: #11 EPSSolve() line 149 in<br>
/packages/7x/slepc/3.11.1/slepc-3.11.1/src/eps/interface/epssolve.c<br>
<br>
Regards,<br>
Pranay.<br>
<br>
On Sat, Nov 30, 2019 at 2:46 PM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
<br>
> On Sat, Nov 30, 2019 at 3:19 PM baikadi pranay <<a href="mailto:pranayreddy865@gmail.com" target="_blank">pranayreddy865@gmail.com</a>><br>
> wrote:<br>
><br>
>> Hello PETSc users,<br>
>><br>
>> I am currently trying to build a 1-D Schrodinger solver. I have built my<br>
>> hamiltonian matrix (of size 121 x 121) and i'm trying to find the<br>
>> eigenvalues. I have the following lines of code for the solver:<br>
>><br>
>> *call EPSCreate(PETSC_COMM_WORLD,eps,ierr)*<br>
>><br>
>> *call EPSSetOperators(eps,ham,S,ierr)call<br>
>> EPSSetProblemType(eps,EPS_GHEP,ierr)*<br>
>><br>
>><br>
>><br>
>> *call EPSSetFromOptions(eps,ierr)call<br>
>> EPSSetDimensions(eps,10,PETSC_DEFAULT_INTEGER,PETSC_DEFAULT_INTEGER,ierr)call<br>
>> EPSSolve(eps,ierr)call EPSDestroy(eps,ierr)*<br>
>><br>
>> At the EPSSolve line, i get the following error:<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> *[0]PETSC ERROR: --------------------- Error Message<br>
>> --------------------------------------------------------------[0]PETSC<br>
>> ERROR: Floating point exception[0]PETSC ERROR: Vec entry at local location<br>
>> 0 is not-a-number or infinite at end of function: Parameter number<br>
>> 3[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a><br>
>> <<a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a>> for trouble<br>
>> shooting.[0]PETSC ERROR: Petsc Release Version 3.11.1, Apr, 12, 2019*<br>
>><br>
><br>
> You need to show the entire stack trace that is output here.<br>
><br>
> Thanks,<br>
><br>
> Matt<br>
><br>
><br>
>> I am using the options *-st_pc_factor_shift_type NONZERO<br>
>> -st_pc_factor_shift_amount 1* ( else I end up getting the "zero<br>
>> pivot in LU factorization" error ).<br>
>><br>
>> I outputted my matrix to matlab and confirmed that the null space is<br>
>> empty and the matrix is not singular. I am not sure why I'm getting this<br>
>> error. Could you provide me a hint as to how to solve this problem.<br>
>><br>
>> Sincerely,<br>
>> Pranay.<br>
>><br>
><br>
><br>
> --<br>
> What most experimenters take for granted before they begin their<br>
> experiments is infinitely more interesting than any results to which their<br>
> experiments lead.<br>
> -- Norbert Wiener<br>
><br>
> <a href="https://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
> <<a href="http://www.cse.buffalo.edu/~knepley/" rel="noreferrer" target="_blank">http://www.cse.buffalo.edu/~knepley/</a>><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/d2498b43/attachment.html" rel="noreferrer" target="_blank">http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20191130/d2498b43/attachment.html</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
petsc-users mailing list<br>
<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/petsc-users" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/petsc-users</a><br>
<br>
<br>
------------------------------<br>
<br>
End of petsc-users Digest, Vol 131, Issue 49<br>
********************************************<br>
</blockquote></div>