<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><DIV>Hello,</DIV>
<DIV> Version3.3 makes some change on Preallocation.</DIV>
<DIV> (1)In version 3.2, my codes are as follows:<BR> <BR> call MatGetOwnershipRange(A,Istart,Iend,ierr)</DIV>
<DIV> !premalloc<BR> !find the max non-zero numbers of all rows<BR> maxnonzero=0<BR> do 19,II=Istart+1,Iend<BR> !no-zero numbers of this row<BR> maxnonzeroII=NROWIN(II+1)-NROWIN(II)<BR> if (maxnonzeroII>maxnonzero) then<BR> maxnonzero=maxnonzeroII<BR> endif<BR> 19 continue<BR> call MatMPIAIJSetPreallocation(A,maxnonzero,PETSC_NULL_INTEGER,maxnonzero,PETSC_NULL_INTEGER,ierr)<BR> <BR> (2)In version 3.3, my codes are as follows:</DIV>
<DIV> </DIV>
<DIV> !premalloc<BR> !find the max non-zero numbers of all rows<BR> maxnonzero=0<BR> do 19,II=1,m<BR> !no-zero numbers of this row<BR> maxnonzeroII=NROWIN(II+1)-NROWIN(II)<BR> if (maxnonzeroII>maxnonzero) then<BR> maxnonzero=maxnonzeroII<BR> endif<BR> 19 continue<BR> call MatMPIAIJSetPreallocation(A,maxnonzero,PETSC_NULL_INTEGER,maxnonzero,PETSC_NULL_INTEGER,ierr)</DIV>
<DIV> call MatGetOwnershipRange(A,Istart,Iend,ierr)</DIV>
<DIV><BR> The modification is:in version3.3, MatMPIAIJSetPreallocation must be in the front of MatGetOwnershipRange.</DIV>
<DIV>And then when I call MatMPIAIJSetPreallocation, I cannot get "Istart&Iend". So I have to use "do 19,II=1,m"</DIV>
<DIV>instead of "do 19,II=Istart+1,Iend" to get the maximum non-zero number of all rows for the use of</DIV>
<DIV>MatMPIAIJSetPreallocation.</DIV>
<DIV> Is this reasonable of using MatMPIAIJSetPreallocation?</DIV>
<DIV> Thanks.</DIV>
<DIV> Jim</DIV></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>