Dear Matt,<br><br>in <a href="http://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/examples/tutorials/ex43.c.html">http://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/examples/tutorials/ex43.c.html</a><br><br><a name="line1468">Why are two matrices set to MATAIJ? if I set MATAIJCUSP, is them changed? <br>
<br>1468: </a> <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DM/DMCreateMatrix.html#DMCreateMatrix">DMCreateMatrix</a>(da_Stokes,<a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MATAIJ.html#MATAIJ">MATAIJ</a>,&A);<br>
<pre width="80"><a name="line1469">1469: </a> <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DM/DMCreateMatrix.html#DMCreateMatrix">DMCreateMatrix</a>(da_Stokes,<a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MATAIJ.html#MATAIJ">MATAIJ</a>,&B);<br>
</pre><br>Thanks a lot.<br><br>Best,<br>Yujie<br><br><br><div class="gmail_quote">On Fri, Feb 10, 2012 at 11:30 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">On Fri, Feb 10, 2012 at 11:10 PM, recrusader <span dir="ltr"><<a href="mailto:recrusader@gmail.com" target="_blank">recrusader@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Dear Matt,<br><br>I added the print codes in libmesh after creating the matrix as follows:<br> " ierr = MatCreateMPIAIJ (libMesh::COMM_WORLD,<br> m_local, n_local,<br> m_global, n_global,<br>
PETSC_NULL, (int*) &n_nz[0],<br> PETSC_NULL, (int*) &n_oz[0], &_mat);<br> CHKERRABORT(libMesh::COMM_WORLD,ierr);<br><br> MatSetOption(_mat,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE); //by Yujie<br>
std::cout<<"MatSetOption"<<std::endl;"<br><br>I run the same codes in CPU and GPU modes (the same parameters except that GPU uses '-vec_type mpicusp -mat_type mpiaijcusp'). I can find "MatSetOption" output from both the modes. Does that mean that the codes set the options for both the modes?<br>
Thank you very much.<br></blockquote><div><br></div></div><div>Yes, so you should have no problem with allocation errors. Partial reports like this help no one. It would be</div><div>somewhat helpful to include a stack trace, to verify that after this change you see an error. If might actually</div>
<div>enable us to find your error if you sent a small test code which failed.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Best,<br>Yujie<br><br><br><div class="gmail_quote">On Fri, Feb 10, 2012 at 3:14 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>On Fri, Feb 10, 2012 at 3:12 PM, recrusader <span dir="ltr"><<a href="mailto:recrusader@gmail.com" target="_blank">recrusader@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Dear Jed,<br><br>The first example works. However, the example uses MatSetValuesStencil() not MatSetValues(). Are they same?<br></blockquote><div><br></div></div><div>MatSetValuesStencil() calls MatSetValues(). I suspect that your MPIAIJ matrix does not have the option set to</div>
<div>throw an error when inserting a new nonzero, and your MPICUSP matrix does.</div><div><br></div><div> Matt</div><div><div> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thanks a lot,<br>Yujie<br><br><div class="gmail_quote">On Fri, Feb 10, 2012 at 2:51 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><div>On Fri, Feb 10, 2012 at 14:49, recrusader <span dir="ltr"><<a href="mailto:recrusader@gmail.com" target="_blank">recrusader@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Since MATMPIAIJ works (I didn't change anything. Just set the vec and mat types to mpicusp and mpiaijcusp for GPU), I think the problem is likely from MatSetValues_MPIAIJ().<br><br>Which PETSc examples can test this function?</blockquote>
<div><br></div></div><div>Try src/ksp/ksp/examples/tutorials/ex43.c and src/snes/examples/tutorials/ex48.c</div></div>
</blockquote></div><br>
</blockquote></div></div><span><font color="#888888"><br><br clear="all"><span><font color="#888888"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</font></span></font></span></blockquote></div><br>
</blockquote></div></div><div class="HOEnZb"><div class="h5"><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</div></div></blockquote></div><br>