On Fri, Feb 10, 2012 at 11:10 PM, recrusader <span dir="ltr"><<a href="mailto:recrusader@gmail.com">recrusader@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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>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> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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 class="HOEnZb"><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><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>