<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&nbsp;MatMPIAIJSetPreallocation to set preallocation?<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><br></div><div>Thank you.</div><div><br></div><div><div>Zeng</div></div><div><div><br><br>ÔÚ 2012-03-16 19:43:38£¬"Jed&nbsp;Brown"&nbsp;&lt;jedbrown@mcs.anl.gov&gt; Ð´µÀ£º<br> <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><div class="gmail_quote">2012/3/15 Xiangze Zeng <span dir="ltr">&lt;<a href="mailto:zengshixiangze@163.com">zengshixiangze@163.com</a>&gt;</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">I can see log_summary output when I use -log_summary [filename].<div><br><div>But the time of inserting the matrices values is almost the same when I use PCJACOBI &nbsp;to run the code on GPU instead of PCSOR.They are all much longer than that when I run the code in CPU(I still use a small system to test it). The attachments are outputs of log_summary, c_jacobi_sum is the output of using CPU, PCJACOBI;g_sor_sum using GPU, PCSOR;g_jac_sum using GPU, PCJACOBI.&nbsp;</div>
</div></div></blockquote></div><div><br></div><div><div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; ##########################################################</font></div><div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; # &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; # &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WARNING!!! &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#</font></div><div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; # &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; # &nbsp; This code was compiled with a debugging option, &nbsp; &nbsp; &nbsp;#</font></div><div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; # &nbsp; To get timing results run ./configure &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; # &nbsp; using --with-debugging=no, the performance will &nbsp; &nbsp; &nbsp;#</font></div><div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; # &nbsp; be generally two or three times faster. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; # &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#</font></div><div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; ##########################################################</font></div>
</div><div><br></div><div>It's a waste of time to look at performance of a debug build, especially when it only takes half a second.</div><br><div>You have probably lost preallocation information. I don't see an assembly event, so I can't tell if that is really where the time is. (SNES makes one automatically, you can PetscLogEventRegister(), PetscLogEventBegin/End().</div>
</blockquote></div></div></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>