<div class="gmail_quote">2012/3/16 Xiangze Zeng <span dir="ltr"><<a href="mailto:zengshixiangze@163.com">zengshixiangze@163.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">After I changed the Mat type for using GPU, can I still use MatMPIAIJSetPreallocation to set preallocation?</div></blockquote><div><br></div><div>
Yes, the code looks okay to me. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">
<div><br><div>I have add Petsc events in the code.The attachments are the outputs of log_summary (I'll configure --with-debugging=no later).</div><div>The fileinterface.c is my code in which set preallocation and insert matrices values.</div>
<div></div></div></div></blockquote></div><br><div>You are running in serial so you should also call MatSeqAIJSetPreallocation(). The MPI allocation information is skipped because it's not an MPI matrix. It is safe to call all the preallocation routines, whichever matches will be used. Alternatively, you could call this function which will do all the variants for you:</div>
<div><br></div><div><a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatXAIJSetPreallocation.html">http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatXAIJSetPreallocation.html</a><br></div>