<div dir="ltr"><p class="MsoNormal" style="margin:0cm 0cm 8pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US">Hello,</span></p>
<p class="MsoNormal" style="margin:0cm 0cm 8pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US">In matrix preallocation procedure, I tried 2
options to preallocate global matrix.<br>
The first is ‘MatSeqAIJSetPreallocation’ and the second is ‘MatSetPreallocationCOO’.</span></p>
<p class="MsoNormal" style="margin:0cm 0cm 8pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin:0cm 0cm 8pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US">When I adopt the first option “MatSeqAIJSetPreallocation(Mat,
nz, nnz)”, I just put overestimated nz for getting enough memory space and also
getting nice performance.</span></p>
<p class="MsoNormal" style="margin:0cm 0cm 8pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US">However, It couldn’t run without “MatSetOption(Mat,
MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);” And also, there are no speed up compare
with no preallocation case.</span></p>
<p class="MsoNormal" style="margin:0cm 0cm 8pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin:0cm 0cm 8pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US">When in the second option “MatSetPreallocationCOO(Mat,ncoo,coo_i,coo_j)”,
I put correct size parameters(ncoo, coo_i, coo_j). However, It couldn’t run without
“MatSetOption(Mat, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);” Regarding
this problem, I suspect that it is a problem caused by mapping a small-sized
local matrix with a different order from the order of coo_i and coo_j to the
global matrix by using “matsetvalue”. And also, there are no speed up compare with
no preallocation case.</span></p>
<p class="MsoNormal" style="margin:0cm 0cm 8pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US"> </span></p>
<p class="gmail-MsoListParagraph" style="margin:0cm 0cm 8pt 38pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US">1.<span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:"Times New Roman"">
</span></span><span lang="EN-US">How can I do proper preallocation
procedure? </span></p>
<p class="gmail-MsoListParagraph" style="margin:0cm 0cm 8pt 38pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US">2.<span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:7pt;line-height:normal;font-family:"Times New Roman"">
</span></span><span lang="EN-US">Why in my cases there are no speed
up?</span></p>
<p class="MsoNormal" style="margin:0cm 0cm 8pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin:0cm 0cm 8pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US">Thanks,</span></p>
<p class="MsoNormal" style="margin:0cm 0cm 8pt;text-align:justify;line-height:107%;font-size:10pt;font-family:"\00b9d1\00c740 \00ace0\00b515""><span lang="EN-US">Hyung Kim</span></p></div>