<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>You are seeing half precision (like 7 digits) in 10-20% of the entries and full in the rest.<br></div><div><br></div><div>Someone will probably chime in who knows about this but I can see where a serial matrix is printed in ASCII Matlab in MatView_SeqAIJ_ASCII in src/mat/impls/aij/seq/aij.c. </div><div><br></div><div>I think this line is operative and is should clearly work:</div><div><br></div><div><div> ierr = PetscViewerASCIIPrintf(viewer,"%D %D %18.16e\n",i+1,a->j[j]+1,(double)a->a[j]);CHKERRQ(ierr);</div></div><div><br></div><div>Could you run in serial (this code could very well be used for MPI Mats also) with Matlab/ASCII to verify that you have this problem. And you could modify this print statement and remake PETSc, if that's easy, to verify that this code is operative.</div><div dir="ltr"><br></div><div>I think %18.16e should print 16 digits even if they are 0s ...</div><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 14, 2019 at 8:34 PM Sanjay Govindjee <<a href="mailto:s_g@berkeley.edu">s_g@berkeley.edu</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">
<div bgcolor="#FFFFFF">
I'm seeing half precision on at least 10 to 20% of the entries :(<br>
Knowing I should see full precision, I will dig deeper.<br>
<br>
-sanjay<br>
<pre class="gmail-m_6050898487887618878moz-signature" cols="72"></pre>
<div class="gmail-m_6050898487887618878moz-cite-prefix">On 5/14/19 5:22 PM, Mark Adams wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">I would hope you get full precision. How many
digits are you seeing?</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, May 14, 2019 at 7:15
PM Sanjay Govindjee via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@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">I
am using the following bit of code to debug a matrix. What is
the <br>
expected precision of the numbers that I will find in my ASCII
file?<br>
As far as I can tell it is not the full double precision that
I was <br>
expecting.<br>
<br>
call PetscViewerASCIIOpen(PETSC_COMM_WORLD, <br>
tangview,K_view, ierr)<br>
call PetscViewerSetFormat(K_view, <br>
PETSC_VIEWER_ASCII_MATLAB, ierr)<br>
call MatView (Kmat, K_view,
ierr)<br>
<br>
-sanjay<br>
<br>
</blockquote>
</div>
</blockquote>
<br>
</div>
</blockquote></div></div></div></div></div></div>